fix(workers): workaround worker execution context flakiness (#2596)

Some of the worker tests were failing on the bots. After investigating, I found one race in the test, and one race upstream in Chromium which I filed upstream as https://crbug.com/846099. But I added a small hack here as a temporary workaround.

References #2632
This commit is contained in:
Joel Einbinder
2018-05-30 18:08:27 -07:00
committed by Andrey Lushnikov
parent 469b910a2d
commit 1c2adf61e9
2 changed files with 10 additions and 3 deletions

View File

@@ -1627,8 +1627,9 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip
});
describe('Workers', function() {
it('Page.workers', async function({page, server}) {
await page.goto(server.PREFIX + '/worker/worker.html');
await page.waitForFunction(() => !!worker);
await Promise.all([
new Promise(x => page.once('workercreated', x)),
page.goto(server.PREFIX + '/worker/worker.html')]);
const worker = page.workers()[0];
expect(worker.url()).toContain('worker.js');
const executionContext = await worker.executionContext();