File tree Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Original file line number Diff line number Diff line change @@ -187,13 +187,19 @@ export async function cleanupAllBrowsers( { verbose } ) {
187
187
const workersRemaining = Object . values ( workers ) ;
188
188
const numRemaining = workersRemaining . length ;
189
189
if ( numRemaining ) {
190
- await Promise . all (
191
- workersRemaining . map ( ( worker ) => deleteWorker ( worker . id ) )
192
- ) ;
193
- if ( verbose ) {
194
- console . log (
195
- `Stopped ${ numRemaining } browser${ numRemaining > 1 ? "s" : "" } .`
190
+ try {
191
+ await Promise . all (
192
+ workersRemaining . map ( ( worker ) => deleteWorker ( worker . id ) )
196
193
) ;
194
+ if ( verbose ) {
195
+ console . log (
196
+ `Stopped ${ numRemaining } browser${ numRemaining > 1 ? "s" : "" } .`
197
+ ) ;
198
+ }
199
+ } catch ( error ) {
200
+
201
+ // Log the error, but do not consider the test run failed
202
+ console . error ( error ) ;
197
203
}
198
204
}
199
205
}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export function retryTest( reportId, maxRetries ) {
39
39
console . log (
40
40
`Retrying test ${ reportId } for ${ chalk . yellow (
41
41
test . options . modules . join ( ", " )
42
- ) } ...`
42
+ ) } ...${ test . retries } `
43
43
) ;
44
44
return test ;
45
45
}
Original file line number Diff line number Diff line change @@ -83,7 +83,19 @@ export async function run( {
83
83
if ( errors ) {
84
84
pendingErrors [ reportId ] [ message . data . name ] = errors ;
85
85
} else {
86
- delete pendingErrors [ reportId ] [ message . data . name ] ;
86
+ const existing = pendingErrors [ reportId ] [ message . data . name ] ;
87
+
88
+ // Show a message for flakey tests
89
+ if ( existing ) {
90
+ console . log ( ) ;
91
+ console . warn (
92
+ chalk . italic (
93
+ chalk . gray ( existing . replace ( "Test failed" , "Test flakey" ) )
94
+ )
95
+ ) ;
96
+ console . log ( ) ;
97
+ delete pendingErrors [ reportId ] [ message . data . name ] ;
98
+ }
87
99
}
88
100
break ;
89
101
}
@@ -103,24 +115,15 @@ export async function run( {
103
115
// Handle failure
104
116
if ( failed ) {
105
117
const retry = retryTest ( reportId , retries ) ;
118
+
119
+ // Retry if retryTest returns a test
106
120
if ( retry ) {
107
121
return retry ;
108
122
}
109
123
errorMessages . push ( ...Object . values ( pendingErrors [ reportId ] ) ) ;
110
- return getNextBrowserTest ( reportId ) ;
111
124
}
112
125
113
- // Handle success
114
- if (
115
- pendingErrors [ reportId ] &&
116
- Object . keys ( pendingErrors [ reportId ] ) . length
117
- ) {
118
- console . warn ( "Detected flaky tests:" ) ;
119
- for ( const [ , error ] in Object . entries ( pendingErrors [ reportId ] ) ) {
120
- console . warn ( chalk . italic ( chalk . gray ( error ) ) ) ;
121
- }
122
- delete pendingErrors [ reportId ] ;
123
- }
126
+ // Run the next test
124
127
return getNextBrowserTest ( reportId ) ;
125
128
}
126
129
case "ack" : {
You can’t perform that action at this time.
0 commit comments