From 08a0538e450dfcd5a9f1e7b95cd3f7fad2afd09a Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 2 Jul 2020 10:22:59 -0700 Subject: [PATCH] Add some logging to a flaky test (#12711) For #12690 Added some logging to see whats causing the tests to fail. --- src/test/common/process/pythonDaemonPool.unit.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/common/process/pythonDaemonPool.unit.test.ts b/src/test/common/process/pythonDaemonPool.unit.test.ts index e49bbd8dc90f..87502a311662 100644 --- a/src/test/common/process/pythonDaemonPool.unit.test.ts +++ b/src/test/common/process/pythonDaemonPool.unit.test.ts @@ -20,6 +20,7 @@ import { IProcessLogger, IPythonExecutionService, Output } from '../../../client import { sleep } from '../../../client/common/utils/async'; import { InterpreterInformation } from '../../../client/pythonEnvironments/info'; import { noop } from '../../core'; +import { asyncDump } from '../asyncDump'; use(chaiPromised); // tslint:disable: no-any max-func-body-length @@ -48,7 +49,11 @@ suite('Daemon - Python Daemon Pool', () => { listenStub.returns(undefined); sendRequestStub.returns({ pong: 'hello' }); }); - teardown(() => { + teardown(function () { + // tslint:disable-next-line: no-invalid-this + if (this.currentTest && this.currentTest.state === 'failed') { + asyncDump(); + } if (clock) { clock.uninstall(); }