@@ -849,8 +849,8 @@ def test_b(): pass
849
849
res = testdir .runpytest (f , "-n1" )
850
850
res .stdout .fnmatch_lines (
851
851
[
852
- "*Replacing crashed worker*" ,
853
- "*Worker *crashed while running*" ,
852
+ "replacing crashed worker gw *" ,
853
+ "worker *crashed while running*" ,
854
854
"*1 failed*1 passed*" ,
855
855
]
856
856
)
@@ -868,8 +868,8 @@ def test_d(): pass
868
868
res = testdir .runpytest (f , "-n2" )
869
869
res .stdout .fnmatch_lines (
870
870
[
871
- "*Replacing crashed worker*" ,
872
- "*Worker *crashed while running*" ,
871
+ "replacing crashed worker gw *" ,
872
+ "worker *crashed while running*" ,
873
873
"*1 failed*3 passed*" ,
874
874
]
875
875
)
@@ -885,8 +885,8 @@ def test_b(): pass
885
885
res = testdir .runpytest (f , "--dist=each" , "--tx=popen" )
886
886
res .stdout .fnmatch_lines (
887
887
[
888
- "*Replacing crashed worker*" ,
889
- "*Worker *crashed while running*" ,
888
+ "replacing crashed worker gw *" ,
889
+ "worker *crashed while running*" ,
890
890
"*1 failed*1 passed*" ,
891
891
]
892
892
)
@@ -922,14 +922,35 @@ def test_d(): pass
922
922
res = testdir .runpytest (f , "-n4" , "--max-worker-restart=1" )
923
923
res .stdout .fnmatch_lines (
924
924
[
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*" ,
929
929
"*2 failed*2 passed*" ,
930
930
]
931
931
)
932
932
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
+
933
954
def test_max_worker_restart_die (self , testdir ):
934
955
f = testdir .makepyfile (
935
956
"""
@@ -939,7 +960,10 @@ def test_max_worker_restart_die(self, testdir):
939
960
)
940
961
res = testdir .runpytest (f , "-n4" , "--max-worker-restart=0" )
941
962
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
+ ]
943
967
)
944
968
945
969
def test_disable_restart (self , testdir ):
@@ -954,9 +978,10 @@ def test_c(): pass
954
978
res = testdir .runpytest (f , "-n4" , "--max-worker-restart=0" )
955
979
res .stdout .fnmatch_lines (
956
980
[
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 *" ,
960
985
]
961
986
)
962
987
0 commit comments