test: deflake flaky tests on linux (#44402)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
6b79679e5b
commit
359cfecce0
2 changed files with 5 additions and 6 deletions
|
@ -940,12 +940,11 @@ describe('BrowserWindow module', () => {
|
|||
'did-frame-navigate',
|
||||
'did-navigate'
|
||||
];
|
||||
const allEvents = Promise.all(navigationEvents.map(event =>
|
||||
const allEvents = Promise.all(expectedEventOrder.map(event =>
|
||||
once(w.webContents, event).then(() => firedEvents.push(event))
|
||||
));
|
||||
const timeout = setTimeout(1000);
|
||||
w.loadURL(url);
|
||||
await Promise.race([allEvents, timeout]);
|
||||
await allEvents;
|
||||
expect(firedEvents).to.deep.equal(expectedEventOrder);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue