test: deflake ses.setProxy test (#26167)

This commit is contained in:
Jeremy Rose 2020-10-27 10:53:27 -07:00 committed by GitHub
parent 1c99a9b425
commit 8c396d0512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ import * as send from 'send';
import * as auth from 'basic-auth';
import { closeAllWindows } from './window-helpers';
import { emittedOnce } from './events-helpers';
import { defer } from './spec-helpers';
import { defer, delay } from './spec-helpers';
import { AddressInfo } from 'net';
/* The whole session API doesn't use standard callbacks */
@ -341,9 +341,16 @@ describe('session module', () => {
describe('ses.setProxy(options)', () => {
let server: http.Server;
let customSession: Electron.Session;
let created = false;
beforeEach(async () => {
customSession = session.fromPartition('proxyconfig');
if (!created) {
// Work around for https://github.com/electron/electron/issues/26166 to
// reduce flake
await delay(100);
created = true;
}
});
afterEach(() => {