-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
The CI sometimes produces test failures for no obvious reasons. Those failures are not reproducible locally and seem to be more likely, when the CI machine is under heavy load.
Thats from weblinks tests, where all neighboring tests take a moderate time of ~130ms, while one test runs into a timeout. Those tests actually poll for a certain change to happen on the DOM, but for some reason that change never happened.
Our playwright test modules run all in the same page on the same terminal instance, but separate tests by a
test.beforeEach(async () => {
await ctx.page.evaluate(`
window.term.reset();
window._some_addon?.dispose();
window._some_addon = new SomeAddon();
window.term.loadAddon(window._some_addon);
`);
});to reset the terminal and the tested addon to initial state. This raised my suspicion, whether there might be something off with the reset handling here. This is further backed by the fact, that introducing a wait after term.reset solves the issue:
test.beforeEach(async () => {
await ctx.page.evaluate(`
window.term.reset();
window._linkaddon?.dispose();
`);
await timeout(10);
await ctx.page.evaluate(`
window._linkaddon = new WebLinksAddon();
window.term.loadAddon(window._linkaddon);
`);
});