From 6b65407ab6ee634cede15727045c6395419d81fc Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 2 Nov 2018 13:23:44 -0700 Subject: [PATCH] test: unflake cookie test on windows (#3489) --- test/headful.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/headful.spec.js b/test/headful.spec.js index 6aa06e51561..75b6feeb86b 100644 --- a/test/headful.spec.js +++ b/test/headful.spec.js @@ -17,8 +17,8 @@ const path = require('path'); const os = require('os'); const fs = require('fs'); -const rm = require('rimraf').sync; const {helper} = require('../lib/helper'); +const rmAsync = helper.promisify(require('rimraf')); const utils = require('./utils'); const {waitEvent} = utils; const puppeteer = utils.requireRoot('index.js'); @@ -97,7 +97,8 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions}) await headlessPage.goto(server.EMPTY_PAGE); const cookie = await headlessPage.evaluate(() => document.cookie); await headlessBrowser.close(); - rm(userDataDir); + // This might throw. See https://github.com/GoogleChrome/puppeteer/issues/2778 + await rmAsync(userDataDir).catch(e => {}); expect(cookie).toBe('foo=true'); }); it('OOPIF: should report google.com frame', async({server}) => {