Skip to content

Commit 688dc1f

Browse files
committed
Added sanity check to ensure that the original job is also completed.
1 parent ddbfe65 commit 688dc1f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/test_executor.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ def test_simple_job_redirect(execparams: ExecutorTestParams) -> None:
3232

3333

3434
def test_attach(execparams: ExecutorTestParams) -> None:
35-
job = Job(JobSpec(executable='/bin/sleep', arguments=['1']))
36-
ex = _get_executor_instance(execparams, job)
37-
ex.submit(job)
38-
job.wait(target_states=[JobState.ACTIVE, JobState.COMPLETED])
39-
native_id = job.native_id
35+
job1 = Job(JobSpec(executable='/bin/sleep', arguments=['1']))
36+
ex = _get_executor_instance(execparams, job1)
37+
ex.submit(job1)
38+
job1.wait(target_states=[JobState.ACTIVE, JobState.COMPLETED])
39+
native_id = job1.native_id
4040

4141
assert native_id is not None
4242
job2 = Job()
4343
ex.attach(job2, native_id)
44-
status = job2.wait(timeout=_get_timeout(execparams))
45-
assert_completed(job2, status)
44+
status2 = job2.wait(timeout=_get_timeout(execparams))
45+
assert_completed(job2, status2)
46+
status1 = job1.wait(timeout=_get_timeout(execparams))
47+
assert_completed(job1, status1)
4648

4749

4850
def test_attach2(execparams: ExecutorTestParams) -> None:

0 commit comments

Comments
 (0)