提交 528efc5b 编写于 作者: J Joao Moreno

smoketest: log last poll message

上级 89163a5f
......@@ -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);
});
}
......
......@@ -139,6 +139,10 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
return connect(child, outPath, handle, options.verbose);
}
export const polling = {
lastTimeoutMessage: ''
};
async function poll<T>(
fn: () => Promise<T>,
acceptFn: (result: T) => boolean,
......@@ -155,6 +159,7 @@ async function poll<T>(
let result;
try {
polling.lastTimeoutMessage = timeoutMessage;
result = await fn();
if (acceptFn(result)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册