@@ -509,6 +509,11 @@ def test_executor_submit_happy_case(mock_start, mock_job_settings, parallelism):
509
509
future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
510
510
future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
511
511
512
+ future_1 .wait ()
513
+ future_2 .wait ()
514
+ future_3 .wait ()
515
+ future_4 .wait ()
516
+
512
517
mock_start .assert_has_calls (
513
518
[
514
519
call (ANY , job_function , (1 , 2 ), {"c" : 3 , "d" : 4 }, None ),
@@ -517,10 +522,6 @@ def test_executor_submit_happy_case(mock_start, mock_job_settings, parallelism):
517
522
call (ANY , job_function , (13 , 14 ), {"c" : 15 , "d" : 16 }, None ),
518
523
]
519
524
)
520
- mock_job_1 .describe .assert_called ()
521
- mock_job_2 .describe .assert_called ()
522
- mock_job_3 .describe .assert_called ()
523
- mock_job_4 .describe .assert_called ()
524
525
525
526
assert future_1 .done ()
526
527
assert future_2 .done ()
@@ -545,14 +546,15 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
545
546
future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
546
547
future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
547
548
549
+ future_1 .wait ()
550
+ future_2 .wait ()
551
+
548
552
mock_start .assert_has_calls (
549
553
[
550
554
call (ANY , job_function , (1 , 2 ), {"c" : 3 , "d" : 4 }, run_info ),
551
555
call (ANY , job_function , (5 , 6 ), {"c" : 7 , "d" : 8 }, run_info ),
552
556
]
553
557
)
554
- mock_job_1 .describe .assert_called ()
555
- mock_job_2 .describe .assert_called ()
556
558
557
559
assert future_1 .done ()
558
560
assert future_2 .done ()
@@ -562,14 +564,15 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
562
564
future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
563
565
future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
564
566
567
+ future_3 .wait ()
568
+ future_4 .wait ()
569
+
565
570
mock_start .assert_has_calls (
566
571
[
567
572
call (ANY , job_function , (9 , 10 ), {"c" : 11 , "d" : 12 }, run_info ),
568
573
call (ANY , job_function , (13 , 14 ), {"c" : 15 , "d" : 16 }, run_info ),
569
574
]
570
575
)
571
- mock_job_3 .describe .assert_called ()
572
- mock_job_4 .describe .assert_called ()
573
576
574
577
assert future_3 .done ()
575
578
assert future_4 .done ()
@@ -621,7 +624,7 @@ def test_executor_fails_to_start_job(mock_start, *args):
621
624
622
625
with pytest .raises (TypeError ):
623
626
future_1 .result ()
624
- print ( future_2 ._state )
627
+ future_2 .wait ( )
625
628
assert future_2 .done ()
626
629
627
630
@@ -678,6 +681,8 @@ def test_executor_describe_job_throttled_temporarily(mock_start, *args):
678
681
# submit second job
679
682
future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
680
683
684
+ future_1 .wait ()
685
+ future_2 .wait ()
681
686
assert future_1 .done ()
682
687
assert future_2 .done ()
683
688
@@ -697,9 +702,9 @@ def test_executor_describe_job_failed_permanently(mock_start, *args):
697
702
future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
698
703
699
704
with pytest .raises (RuntimeError ):
700
- future_1 .done ()
705
+ future_1 .result ()
701
706
with pytest .raises (RuntimeError ):
702
- future_2 .done ()
707
+ future_2 .result ()
703
708
704
709
705
710
@pytest .mark .parametrize (
0 commit comments