diff --git a/spec/afterStart.test.ts b/spec/afterStart.test.ts index 1c15039..5023465 100644 --- a/spec/afterStart.test.ts +++ b/spec/afterStart.test.ts @@ -5,6 +5,7 @@ const android = new Android({ debug: true }); let emulatorId = ''; beforeAll(async () => { + console.log('start', new Date().toUTCString()); const avds = await android.listAVDs(); let avdName = ''; if (avds.length === 0) { @@ -13,7 +14,6 @@ beforeAll(async () => { } else { avdName = avds[0].Name; } - console.log('start', new Date().toUTCString()); const res = await android.start({ avd: avdName, noaudio: true, @@ -29,6 +29,7 @@ beforeAll(async () => { } else { throw Error('no emulator'); } + console.log('start-end', new Date().toUTCString()); }, 1200000); afterAll(async () => { diff --git a/src/util.ts b/src/util.ts index 3df1535..7a24f86 100644 --- a/src/util.ts +++ b/src/util.ts @@ -76,6 +76,7 @@ export function spawnWaitFor(command: string, regex: RegExp, timeout = 600000) { const { cmd, args } = transformCommand(command); const proc = spawn(cmd, args, { stdio: ['ignore', 'pipe', 'ignore'] }); const clock = setTimeout(() => { + console.log('clock timeout'); proc.kill(); reject(Error('Execution timeout')); }, timeout); @@ -84,6 +85,7 @@ export function spawnWaitFor(command: string, regex: RegExp, timeout = 600000) { proc.stdout.on('data', (data: string) => { output += data; const matches = data.match(regex); + console.log('matches', matches, data); if (matches) { clearTimeout(clock); resolve({ @@ -95,7 +97,6 @@ export function spawnWaitFor(command: string, regex: RegExp, timeout = 600000) { }); proc.on('close', (code, signal) => { console.log('code,signal', code, signal); - console.log('output', output); clearTimeout(clock); reject(Error(output));