@@ -849,8 +849,8 @@ def test_b(): pass
849849 res = testdir .runpytest (f , "-n1" )
850850 res .stdout .fnmatch_lines (
851851 [
852- "*Replacing crashed worker*" ,
853- "*Worker *crashed while running*" ,
852+ "replacing crashed worker gw *" ,
853+ "worker *crashed while running*" ,
854854 "*1 failed*1 passed*" ,
855855 ]
856856 )
@@ -868,8 +868,8 @@ def test_d(): pass
868868 res = testdir .runpytest (f , "-n2" )
869869 res .stdout .fnmatch_lines (
870870 [
871- "*Replacing crashed worker*" ,
872- "*Worker *crashed while running*" ,
871+ "replacing crashed worker gw *" ,
872+ "worker *crashed while running*" ,
873873 "*1 failed*3 passed*" ,
874874 ]
875875 )
@@ -885,8 +885,8 @@ def test_b(): pass
885885 res = testdir .runpytest (f , "--dist=each" , "--tx=popen" )
886886 res .stdout .fnmatch_lines (
887887 [
888- "*Replacing crashed worker*" ,
889- "*Worker *crashed while running*" ,
888+ "replacing crashed worker gw *" ,
889+ "worker *crashed while running*" ,
890890 "*1 failed*1 passed*" ,
891891 ]
892892 )
@@ -922,14 +922,35 @@ def test_d(): pass
922922 res = testdir .runpytest (f , "-n4" , "--max-worker-restart=1" )
923923 res .stdout .fnmatch_lines (
924924 [
925- "*Replacing crashed worker*" ,
926- "*Maximum crashed workers reached: 1*" ,
927- "*Worker *crashed while running*" ,
928- "*Worker *crashed while running*" ,
925+ "replacing crashed worker*" ,
926+ "maximum crashed workers reached: 1*" ,
927+ "worker *crashed while running*" ,
928+ "worker *crashed while running*" ,
929929 "*2 failed*2 passed*" ,
930930 ]
931931 )
932932
933+ def test_max_worker_restart_tests_queued (self , testdir ):
934+ f = testdir .makepyfile (
935+ """
936+ import os, pytest
937+ @pytest.mark.parametrize('i', range(10))
938+ def test(i): os._exit(1)
939+ """
940+ )
941+ res = testdir .runpytest (f , "-n2" , "--max-worker-restart=3" )
942+ res .stdout .fnmatch_lines (
943+ [
944+ "replacing crashed worker*" ,
945+ "maximum crashed workers reached: 3*" ,
946+ "worker*crashed while running*" ,
947+ "worker*crashed while running*" ,
948+ "* xdist: maximum crashed workers reached: 3 *" ,
949+ "* 4 failed in *" ,
950+ ]
951+ )
952+ assert "INTERNALERROR" not in res .stdout .str ()
953+
933954 def test_max_worker_restart_die (self , testdir ):
934955 f = testdir .makepyfile (
935956 """
@@ -939,7 +960,10 @@ def test_max_worker_restart_die(self, testdir):
939960 )
940961 res = testdir .runpytest (f , "-n4" , "--max-worker-restart=0" )
941962 res .stdout .fnmatch_lines (
942- ["*Unexpectedly no active workers*" , "*INTERNALERROR*" ]
963+ [
964+ "* xdist: worker gw* crashed and worker restarting disabled *" ,
965+ "* no tests ran in *" ,
966+ ]
943967 )
944968
945969 def test_disable_restart (self , testdir ):
@@ -954,9 +978,10 @@ def test_c(): pass
954978 res = testdir .runpytest (f , "-n4" , "--max-worker-restart=0" )
955979 res .stdout .fnmatch_lines (
956980 [
957- "*Worker restarting disabled*" ,
958- "*Worker*crashed while running*" ,
959- "*1 failed*2 passed*" ,
981+ "worker gw* crashed and worker restarting disabled" ,
982+ "*worker*crashed while running*" ,
983+ "* xdist: worker gw* crashed and worker restarting disabled *" ,
984+ "* 1 failed, 2 passed in *" ,
960985 ]
961986 )
962987
0 commit comments