test: deflake ses.setProxy test (#26167)
This commit is contained in:
parent
1c99a9b425
commit
8c396d0512
1 changed files with 8 additions and 1 deletions
|
@ -9,7 +9,7 @@ import * as send from 'send';
|
||||||
import * as auth from 'basic-auth';
|
import * as auth from 'basic-auth';
|
||||||
import { closeAllWindows } from './window-helpers';
|
import { closeAllWindows } from './window-helpers';
|
||||||
import { emittedOnce } from './events-helpers';
|
import { emittedOnce } from './events-helpers';
|
||||||
import { defer } from './spec-helpers';
|
import { defer, delay } from './spec-helpers';
|
||||||
import { AddressInfo } from 'net';
|
import { AddressInfo } from 'net';
|
||||||
|
|
||||||
/* The whole session API doesn't use standard callbacks */
|
/* The whole session API doesn't use standard callbacks */
|
||||||
|
@ -341,9 +341,16 @@ describe('session module', () => {
|
||||||
describe('ses.setProxy(options)', () => {
|
describe('ses.setProxy(options)', () => {
|
||||||
let server: http.Server;
|
let server: http.Server;
|
||||||
let customSession: Electron.Session;
|
let customSession: Electron.Session;
|
||||||
|
let created = false;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
customSession = session.fromPartition('proxyconfig');
|
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(() => {
|
afterEach(() => {
|
||||||
|
|
Loading…
Reference in a new issue