Skip to content

Commit 6700d14

Browse files
committed
[TS] Fix CI when we log while the browser is shutting down
1 parent eab6928 commit 6700d14

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ts/test/browser.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ for (const browserType of [chromium, firefox]) { // We'd like to test webkit, bu
1010
const context = await browser.newContext();
1111
const page = await context.newPage();
1212
page.on('console', async msg => {
13-
const values = [];
14-
for (const arg of msg.args())
15-
values.push(await arg.jsonValue());
16-
console.log(...values);
13+
try {
14+
const values = [];
15+
for (const arg of msg.args())
16+
values.push(await arg.jsonValue());
17+
console.log(...values);
18+
} catch (_) { /* sometimes this gets hit if we're logging while the browser shuts down */ }
1719
});
1820
await page.goto('http://localhost:8000/test/index.html');
1921
var ret;

0 commit comments

Comments
 (0)