Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02d2347

Browse files
authored
Tests: fix flakey message logs; ignore delete worker failures
Closegh-5432
1 parent95a4c94 commit02d2347

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

‎test/runner/browserstack/browsers.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,19 @@ export async function cleanupAllBrowsers( { verbose } ) {
187187
constworkersRemaining=Object.values(workers);
188188
constnumRemaining=workersRemaining.length;
189189
if(numRemaining){
190-
awaitPromise.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+
awaitPromise.all(
192+
workersRemaining.map((worker)=>deleteWorker(worker.id))
196193
);
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);
197203
}
198204
}
199205
}

‎test/runner/browserstack/queue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function retryTest( reportId, maxRetries ) {
3939
console.log(
4040
`Retrying test${reportId} for${chalk.yellow(
4141
test.options.modules.join(", ")
42-
)}...`
42+
)}...${test.retries}`
4343
);
4444
returntest;
4545
}

‎test/runner/run.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,19 @@ export async function run( {
8383
if(errors){
8484
pendingErrors[reportId][message.data.name]=errors;
8585
}else{
86-
deletependingErrors[reportId][message.data.name];
86+
constexisting=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+
deletependingErrors[reportId][message.data.name];
98+
}
8799
}
88100
break;
89101
}
@@ -103,24 +115,15 @@ export async function run( {
103115
// Handle failure
104116
if(failed){
105117
constretry=retryTest(reportId,retries);
118+
119+
// Retry if retryTest returns a test
106120
if(retry){
107121
returnretry;
108122
}
109123
errorMessages.push( ...Object.values(pendingErrors[reportId]));
110-
returngetNextBrowserTest(reportId);
111124
}
112125

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]inObject.entries(pendingErrors[reportId])){
120-
console.warn(chalk.italic(chalk.gray(error)));
121-
}
122-
deletependingErrors[reportId];
123-
}
126+
// Run the next test
124127
returngetNextBrowserTest(reportId);
125128
}
126129
case"ack":{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp