Skip to content

Commit abf3603

Browse files
committed
add some debugging information for flaky test
1 parent e04eefe commit abf3603

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/src/test/shared/utilities/processUtils.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ function getSleepCmd() {
364364
async function stopAndWait(cp: ChildProcess, clock: FakeTimers.InstalledClock) {
365365
cp.stop(true)
366366
await clock.tickAsync(ChildProcess.stopTimeout * 2)
367+
assert.ok(cp.stopped, `Failed to stop process with id: ${cp.pid()}`)
367368
}
368369

369370
function startSleepProcess(timeout: number = 90) {
@@ -405,7 +406,7 @@ describe('ChildProcessTracker', function () {
405406
await clock.tickAsync(ChildProcessTracker.pollingInterval)
406407
assert.strictEqual(tracker.has(childProcess), false, 'process was not removed after stopping')
407408
})
408-
for (const _ of Array.from({ length: 100 })) {
409+
for (const _ of Array.from({ length: 1000 })) {
409410
it('multiple processes from same command are tracked seperately', async function () {
410411
const childProcess1 = startSleepProcess()
411412
const childProcess2 = startSleepProcess()
@@ -417,6 +418,10 @@ describe('ChildProcessTracker', function () {
417418

418419
await stopAndWait(childProcess1, clock)
419420
await clock.tickAsync(ChildProcessTracker.pollingInterval)
421+
if (tracker.has(childProcess1)) {
422+
console.log('process: %O', childProcess1)
423+
console.log('tracker: %O', tracker)
424+
}
420425
assert.strictEqual(tracker.has(childProcess2), true, 'second process was mistakenly removed')
421426
assert.strictEqual(tracker.has(childProcess1), false, 'first process was not removed after stopping it')
422427
})

0 commit comments

Comments
 (0)