From 528efc5bbb82f9861900818fbf2c03f9a89d16f4 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 18 Apr 2018 15:23:43 +0200 Subject: [PATCH] smoketest: log last poll message --- test/smoke/src/main.ts | 3 +++ test/smoke/src/vscode/code.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index ab2586f5c9e..ea4f1365bf2 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -27,6 +27,7 @@ import { setup as setupDataExtensionTests } from './areas/extensions/extensions. import { setup as setupTerminalTests } from './areas/terminal/terminal.test'; import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.test'; import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test'; +import { polling } from './vscode/code'; const tmpDir = tmp.dirSync({ prefix: 't' }) as { name: string; removeCallback: Function; }; const testDataPath = tmpDir.name; @@ -287,6 +288,8 @@ describe('Test', () => { const name = this.currentTest.fullTitle().replace(/[^a-z0-9\-]/ig, '_'); const screenshotPath = path.join(screenshotsPath, `${name}.png`); + + console.log('Last poll message: ', polling.lastTimeoutMessage); fs.writeFileSync(screenshotPath, buffer); }); } diff --git a/test/smoke/src/vscode/code.ts b/test/smoke/src/vscode/code.ts index 039bd05d4a2..5240380e776 100644 --- a/test/smoke/src/vscode/code.ts +++ b/test/smoke/src/vscode/code.ts @@ -139,6 +139,10 @@ export async function spawn(options: SpawnOptions): Promise { return connect(child, outPath, handle, options.verbose); } +export const polling = { + lastTimeoutMessage: '' +}; + async function poll( fn: () => Promise, acceptFn: (result: T) => boolean, @@ -155,6 +159,7 @@ async function poll( let result; try { + polling.lastTimeoutMessage = timeoutMessage; result = await fn(); if (acceptFn(result)) { -- GitLab