Skip to content

Commit bdd12a8

Browse files
committed
Bug 1872171 - add and support --restartAfterFailure for desktop mochitests. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D197365 UltraBlame original commit: 39c1f4cb2135dc97883ba694417a713f52325891
1 parent 7ac6a5b commit bdd12a8

File tree

8 files changed

+838
-11
lines changed

8 files changed

+838
-11
lines changed

testing/mochitest/mochitest_options.py

+54
Original file line numberDiff line numberDiff line change
@@ -6346,6 +6346,60 @@
63466346

63476347
}
63486348

6349+
]
6350+
6351+
[
6352+
6353+
[
6354+
"
6355+
-
6356+
-
6357+
restart
6358+
-
6359+
after
6360+
-
6361+
failure
6362+
"
6363+
]
6364+
6365+
{
6366+
6367+
"
6368+
dest
6369+
"
6370+
:
6371+
"
6372+
restartAfterFailure
6373+
"
6374+
6375+
"
6376+
default
6377+
"
6378+
:
6379+
False
6380+
6381+
"
6382+
help
6383+
"
6384+
:
6385+
"
6386+
Terminate
6387+
the
6388+
session
6389+
on
6390+
first
6391+
failure
6392+
and
6393+
restart
6394+
where
6395+
you
6396+
left
6397+
off
6398+
.
6399+
"
6400+
6401+
}
6402+
63496403
]
63506404

63516405
]

testing/mochitest/runtests.py

+182
Original file line numberDiff line numberDiff line change
@@ -21727,6 +21727,10 @@
2172721727
=
2172821728
None
2172921729

21730+
restartAfterFailure
21731+
=
21732+
False
21733+
2173021734
marionette_args
2173121735
=
2173221736
None
@@ -22413,6 +22417,10 @@
2241322417
bisectChunk
2241422418
=
2241522419
bisectChunk
22420+
22421+
restartAfterFailure
22422+
=
22423+
restartAfterFailure
2241622424

2241722425
)
2241822426

@@ -24698,6 +24706,128 @@
2469824706
result
2469924707
)
2470024708

24709+
elif
24710+
options
24711+
.
24712+
restartAfterFailure
24713+
:
24714+
24715+
#
24716+
NOTE
24717+
:
24718+
ideally
24719+
browser
24720+
will
24721+
halt
24722+
on
24723+
first
24724+
failure
24725+
then
24726+
this
24727+
will
24728+
always
24729+
be
24730+
the
24731+
last
24732+
test
24733+
24734+
if
24735+
not
24736+
self
24737+
.
24738+
expectedError
24739+
:
24740+
24741+
status
24742+
=
24743+
-
24744+
1
24745+
24746+
else
24747+
:
24748+
24749+
firstFail
24750+
=
24751+
len
24752+
(
24753+
testsToRun
24754+
)
24755+
24756+
for
24757+
key
24758+
in
24759+
self
24760+
.
24761+
expectedError
24762+
:
24763+
24764+
full_key
24765+
=
24766+
[
24767+
x
24768+
for
24769+
x
24770+
in
24771+
testsToRun
24772+
if
24773+
key
24774+
in
24775+
x
24776+
]
24777+
24778+
if
24779+
full_key
24780+
:
24781+
24782+
if
24783+
testsToRun
24784+
.
24785+
index
24786+
(
24787+
full_key
24788+
[
24789+
0
24790+
]
24791+
)
24792+
<
24793+
firstFail
24794+
:
24795+
24796+
firstFail
24797+
=
24798+
testsToRun
24799+
.
24800+
index
24801+
(
24802+
full_key
24803+
[
24804+
0
24805+
]
24806+
)
24807+
24808+
testsToRun
24809+
=
24810+
testsToRun
24811+
[
24812+
firstFail
24813+
+
24814+
1
24815+
:
24816+
]
24817+
24818+
if
24819+
testsToRun
24820+
=
24821+
=
24822+
[
24823+
]
24824+
:
24825+
24826+
status
24827+
=
24828+
-
24829+
1
24830+
2470124831
else
2470224832
:
2470324833

@@ -29496,6 +29626,12 @@
2949629626
.
2949729627
bisectChunk
2949829628

29629+
restartAfterFailure
29630+
=
29631+
options
29632+
.
29633+
restartAfterFailure
29634+
2949929635
marionette_args
2950029636
=
2950129637
marionette_args
@@ -30672,6 +30808,10 @@
3067230808
bisectChunk
3067330809
=
3067430810
None
30811+
30812+
restartAfterFailure
30813+
=
30814+
None
3067530815

3067630816
)
3067730817
:
@@ -30749,6 +30889,12 @@
3074930889
=
3075030890
bisectChunk
3075130891

30892+
self
30893+
.
30894+
restartAfterFailure
30895+
=
30896+
restartAfterFailure
30897+
3075230898
self
3075330899
.
3075430900
browserProcessId
@@ -30929,6 +31075,10 @@
3092931075
self
3093031076
.
3093131077
bisectChunk
31078+
or
31079+
self
31080+
.
31081+
restartAfterFailure
3093231082
:
3093331083

3093431084
handlers
@@ -32381,6 +32531,38 @@
3238132531
=
3238232532
True
3238332533

32534+
#
32535+
run
32536+
until
32537+
failure
32538+
then
32539+
loop
32540+
until
32541+
all
32542+
tests
32543+
have
32544+
ran
32545+
32546+
#
32547+
using
32548+
looping
32549+
similar
32550+
to
32551+
bisection
32552+
code
32553+
32554+
if
32555+
options
32556+
.
32557+
restartAfterFailure
32558+
:
32559+
32560+
options
32561+
.
32562+
runUntilFailure
32563+
=
32564+
True
32565+
3238432566
if
3238532567
options
3238632568
.

testing/mochitest/runtestsremote.py

+4
Original file line numberDiff line numberDiff line change
@@ -2589,6 +2589,10 @@
25892589
=
25902590
None
25912591

2592+
restartAfterFailure
2593+
=
2594+
False
2595+
25922596
marionette_args
25932597
=
25942598
None

testing/mochitest/tests/SimpleTest/TestRunner.js

+5
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,11 @@ _numTimeouts
12861286
TestRunner
12871287
.
12881288
maxTimeouts
1289+
|
1290+
|
1291+
TestRunner
1292+
.
1293+
runUntilFailure
12891294
)
12901295
{
12911296
TestRunner

0 commit comments

Comments
 (0)