@@ -518,11 +518,6 @@ def test_executor_submit_happy_case(mock_start, mock_job_settings, parallelism):
518
518
future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
519
519
future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
520
520
521
- future_1 .wait ()
522
- future_2 .wait ()
523
- future_3 .wait ()
524
- future_4 .wait ()
525
-
526
521
mock_start .assert_has_calls (
527
522
[
528
523
call (ANY , job_function , (1 , 2 ), {"c" : 3 , "d" : 4 }, None ),
@@ -531,6 +526,10 @@ def test_executor_submit_happy_case(mock_start, mock_job_settings, parallelism):
531
526
call (ANY , job_function , (13 , 14 ), {"c" : 15 , "d" : 16 }, None ),
532
527
]
533
528
)
529
+ mock_job_1 .describe .assert_called ()
530
+ mock_job_2 .describe .assert_called ()
531
+ mock_job_3 .describe .assert_called ()
532
+ mock_job_4 .describe .assert_called ()
534
533
535
534
assert future_1 .done ()
536
535
assert future_2 .done ()
@@ -555,15 +554,14 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
555
554
future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
556
555
future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
557
556
558
- future_1 .wait ()
559
- future_2 .wait ()
560
-
561
557
mock_start .assert_has_calls (
562
558
[
563
559
call (ANY , job_function , (1 , 2 ), {"c" : 3 , "d" : 4 }, run_info ),
564
560
call (ANY , job_function , (5 , 6 ), {"c" : 7 , "d" : 8 }, run_info ),
565
561
]
566
562
)
563
+ mock_job_1 .describe .assert_called ()
564
+ mock_job_2 .describe .assert_called ()
567
565
568
566
assert future_1 .done ()
569
567
assert future_2 .done ()
@@ -573,15 +571,14 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
573
571
future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
574
572
future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
575
573
576
- future_3 .wait ()
577
- future_4 .wait ()
578
-
579
574
mock_start .assert_has_calls (
580
575
[
581
576
call (ANY , job_function , (9 , 10 ), {"c" : 11 , "d" : 12 }, run_info ),
582
577
call (ANY , job_function , (13 , 14 ), {"c" : 15 , "d" : 16 }, run_info ),
583
578
]
584
579
)
580
+ mock_job_3 .describe .assert_called ()
581
+ mock_job_4 .describe .assert_called ()
585
582
586
583
assert future_3 .done ()
587
584
assert future_4 .done ()
@@ -633,7 +630,7 @@ def test_executor_fails_to_start_job(mock_start, *args):
633
630
634
631
with pytest .raises (TypeError ):
635
632
future_1 .result ()
636
- future_2 .wait ( )
633
+ print ( future_2 ._state )
637
634
assert future_2 .done ()
638
635
639
636
@@ -698,8 +695,6 @@ def test_executor_describe_job_throttled_temporarily(mock_start, *args):
698
695
# submit second job
699
696
future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
700
697
701
- future_1 .wait ()
702
- future_2 .wait ()
703
698
assert future_1 .done ()
704
699
assert future_2 .done ()
705
700
@@ -719,9 +714,9 @@ def test_executor_describe_job_failed_permanently(mock_start, *args):
719
714
future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
720
715
721
716
with pytest .raises (RuntimeError ):
722
- future_1 .result ()
717
+ future_1 .done ()
723
718
with pytest .raises (RuntimeError ):
724
- future_2 .result ()
719
+ future_2 .done ()
725
720
726
721
727
722
@pytest .mark .parametrize (
0 commit comments