fix(windows): wait for pipe available again (#993)
This commit is contained in:
parent
f8f818f676
commit
f7fb35bdbf
|
|
@ -22,7 +22,7 @@ import * as types from '../types';
|
||||||
import { WKBrowser } from '../webkit/wkBrowser';
|
import { WKBrowser } from '../webkit/wkBrowser';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
import { PipeTransport } from './pipeTransport';
|
import { PipeTransport } from './pipeTransport';
|
||||||
import { launchProcess } from './processLauncher';
|
import { launchProcess, waitForLine } from './processLauncher';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as platform from '../platform';
|
import * as platform from '../platform';
|
||||||
|
|
@ -97,6 +97,7 @@ export class WebKit implements BrowserType {
|
||||||
handleSIGINT = true,
|
handleSIGINT = true,
|
||||||
handleSIGTERM = true,
|
handleSIGTERM = true,
|
||||||
handleSIGHUP = true,
|
handleSIGHUP = true,
|
||||||
|
timeout = 30000
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
let temporaryUserDataDir: string | null = null;
|
let temporaryUserDataDir: string | null = null;
|
||||||
|
|
@ -148,6 +149,8 @@ export class WebKit implements BrowserType {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const timeoutError = new TimeoutError(`Timed out after ${timeout} ms while trying to connect to WebKit! The only WebKit revision guaranteed to work is r${this._revision}`);
|
||||||
|
await waitForLine(launchedProcess, launchedProcess.stdout, /^Web Inspector is reading from pipe #3$/, timeout, timeoutError);
|
||||||
transport = new PipeTransport(launchedProcess.stdio[3] as NodeJS.WritableStream, launchedProcess.stdio[4] as NodeJS.ReadableStream);
|
transport = new PipeTransport(launchedProcess.stdio[3] as NodeJS.WritableStream, launchedProcess.stdio[4] as NodeJS.ReadableStream);
|
||||||
browserServer = new BrowserServer(launchedProcess, gracefullyClose, launchType === 'server' ? await wrapTransportWithWebSocket(transport, port || 0) : null);
|
browserServer = new BrowserServer(launchedProcess, gracefullyClose, launchType === 'server' ? await wrapTransportWithWebSocket(transport, port || 0) : null);
|
||||||
return { browserServer, transport };
|
return { browserServer, transport };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue