@@ -57,7 +57,7 @@ def test_load(submit_job):
57
57
58
58
# Load the step info, waiting one second to make sure the Step
59
59
# actually exists.
60
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
60
+ util .wait ( )
61
61
step = JobStep .load (job .id , "batch" )
62
62
63
63
assert step .id == "batch"
@@ -101,7 +101,7 @@ def test_load(submit_job):
101
101
def test_collection (submit_job ):
102
102
job = submit_job (script = create_job_script_multi_step ())
103
103
104
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
104
+ util .wait ( )
105
105
steps = JobSteps .load (job )
106
106
107
107
assert steps
@@ -115,7 +115,7 @@ def test_collection(submit_job):
115
115
def test_cancel (submit_job ):
116
116
job = submit_job (script = create_job_script_multi_step ())
117
117
118
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
118
+ util .wait ( )
119
119
steps = JobSteps .load (job )
120
120
assert len (steps ) == 3
121
121
assert ("batch" in steps and
@@ -124,7 +124,7 @@ def test_cancel(submit_job):
124
124
125
125
steps [0 ].cancel ()
126
126
127
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
127
+ util .wait ( )
128
128
steps = JobSteps .load (job )
129
129
assert len (steps ) == 2
130
130
assert ("batch" in steps and
@@ -135,7 +135,7 @@ def test_modify(submit_job):
135
135
steps = "srun -t 20 sleep 100"
136
136
job = submit_job (script = create_job_script_multi_step (steps ))
137
137
138
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
138
+ util .wait ( )
139
139
step = JobStep .load (job , 0 )
140
140
assert step .time_limit == 20
141
141
@@ -150,7 +150,7 @@ def test_send_signal(submit_job):
150
150
steps = "srun -t 10 sleep 100"
151
151
job = submit_job (script = create_job_script_multi_step (steps ))
152
152
153
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
153
+ util .wait ( )
154
154
step = JobStep .load (job , 0 )
155
155
assert step .state == "RUNNING"
156
156
@@ -159,7 +159,7 @@ def test_send_signal(submit_job):
159
159
160
160
# Make sure the job is actually cancelled.
161
161
# If a RPCError is raised, this means the Step got cancelled.
162
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
162
+ util .wait ( )
163
163
with pytest .raises (RPCError ):
164
164
step = JobStep .load (job , 0 )
165
165
@@ -173,5 +173,5 @@ def test_load_with_wrong_step_id(submit_job):
173
173
174
174
def test_parse_all (submit_job ):
175
175
job = submit_job ()
176
- time . sleep ( util .WAIT_SECS_SLURMCTLD )
176
+ util .wait ( )
177
177
JobStep .load (job , "batch" ).to_dict ()
0 commit comments