@@ -509,6 +509,11 @@ def test_executor_submit_happy_case(mock_start, mock_job_settings, parallelism):
509509 future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
510510 future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
511511
512+ future_1 .wait ()
513+ future_2 .wait ()
514+ future_3 .wait ()
515+ future_4 .wait ()
516+
512517 mock_start .assert_has_calls (
513518 [
514519 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):
517522 call (ANY , job_function , (13 , 14 ), {"c" : 15 , "d" : 16 }, None ),
518523 ]
519524 )
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 ()
524525
525526 assert future_1 .done ()
526527 assert future_2 .done ()
@@ -545,14 +546,15 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
545546 future_1 = e .submit (job_function , 1 , 2 , c = 3 , d = 4 )
546547 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
547548
549+ future_1 .wait ()
550+ future_2 .wait ()
551+
548552 mock_start .assert_has_calls (
549553 [
550554 call (ANY , job_function , (1 , 2 ), {"c" : 3 , "d" : 4 }, run_info ),
551555 call (ANY , job_function , (5 , 6 ), {"c" : 7 , "d" : 8 }, run_info ),
552556 ]
553557 )
554- mock_job_1 .describe .assert_called ()
555- mock_job_2 .describe .assert_called ()
556558
557559 assert future_1 .done ()
558560 assert future_2 .done ()
@@ -562,14 +564,15 @@ def test_executor_submit_with_run(mock_start, mock_job_settings, run_obj):
562564 future_3 = e .submit (job_function , 9 , 10 , c = 11 , d = 12 )
563565 future_4 = e .submit (job_function , 13 , 14 , c = 15 , d = 16 )
564566
567+ future_3 .wait ()
568+ future_4 .wait ()
569+
565570 mock_start .assert_has_calls (
566571 [
567572 call (ANY , job_function , (9 , 10 ), {"c" : 11 , "d" : 12 }, run_info ),
568573 call (ANY , job_function , (13 , 14 ), {"c" : 15 , "d" : 16 }, run_info ),
569574 ]
570575 )
571- mock_job_3 .describe .assert_called ()
572- mock_job_4 .describe .assert_called ()
573576
574577 assert future_3 .done ()
575578 assert future_4 .done ()
@@ -621,7 +624,7 @@ def test_executor_fails_to_start_job(mock_start, *args):
621624
622625 with pytest .raises (TypeError ):
623626 future_1 .result ()
624- print ( future_2 ._state )
627+ future_2 .wait ( )
625628 assert future_2 .done ()
626629
627630
@@ -678,6 +681,8 @@ def test_executor_describe_job_throttled_temporarily(mock_start, *args):
678681 # submit second job
679682 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
680683
684+ future_1 .wait ()
685+ future_2 .wait ()
681686 assert future_1 .done ()
682687 assert future_2 .done ()
683688
@@ -697,9 +702,9 @@ def test_executor_describe_job_failed_permanently(mock_start, *args):
697702 future_2 = e .submit (job_function , 5 , 6 , c = 7 , d = 8 )
698703
699704 with pytest .raises (RuntimeError ):
700- future_1 .done ()
705+ future_1 .result ()
701706 with pytest .raises (RuntimeError ):
702- future_2 .done ()
707+ future_2 .result ()
703708
704709
705710@pytest .mark .parametrize (
0 commit comments