From f5215b2ed03df2cdb6cb14dc077b2d63a50e4f2f Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 20 Jul 2017 15:29:09 -0700 Subject: [PATCH] Restart browser once in a while during unit testing The unit testing on mac is unreliable, making the last tests to hang. This seems to be related to the upstream bug: crbug.com/741689 For now, this patch restarts the browser in the middle of unit testing. This should be reverted once the upstream is fixed. References #100. --- test/test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.js b/test/test.js index 607c82d5..caab5916 100644 --- a/test/test.js +++ b/test/test.js @@ -835,6 +835,14 @@ describe('Puppeteer', function() { expect(keyboard.modifiers().Alt).toBe(false); })); }); + + // FIXME: remove this when crbug.com/741689 is fixed. + it('RESTART BROWSER crbug.com/741689', SX(async function() { + page.close(); + browser = new Browser({headless, args: ['--no-sandbox']}); + page = await browser.newPage(); + })); + describe('Page.setUserAgent', function() { it('should work', SX(async function() { expect(page.userAgent()).toContain('Mozilla');