ci: fix flaky test (#10335)

This commit is contained in:
Nikolay Vitkov 2023-06-07 10:18:01 +02:00 committed by GitHub
parent 60acefc1d6
commit dde569b97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
let timeout = process.platform === 'win32' ? 20_000 : 10_000;
if (!!process.env.DEBUGGER_ATTACHED) {
timeout = 0;
}
module.exports = {
reporter: 'dot',
logLevel: 'debug',
@ -22,6 +26,6 @@ module.exports = {
exit: !!process.env.CI,
retries: process.env.CI ? 3 : 0,
parallel: !!process.env.PARALLEL,
timeout: process.platform === 'win32' ? 20_000 : 10_000,
timeout: timeout,
reporter: process.env.CI ? 'spec' : 'dot',
};

View File

@ -37,7 +37,10 @@
"--no-coverage",
"--no-suggestions"
],
"outFiles": ["${workspaceFolder}/**/*.js"]
"outFiles": ["${workspaceFolder}/**/*.js"],
"env": {
"DEBUGGER_ATTACHED": true
}
}
]
}

View File

@ -819,7 +819,9 @@ describe('network', function () {
});
const [response] = await Promise.all([
waitEvent<HTTPResponse>(page, 'response'),
waitEvent<HTTPResponse>(page, 'response', res => {
return !isFavicon(res);
}),
page.evaluate(() => {
const xhr = new XMLHttpRequest();
xhr.open('GET', '/foo');