diff --git a/src/test/autocomplete/base.test.ts b/src/test/autocomplete/base.test.ts index 5219e4ababd9..d67d322dbb7b 100644 --- a/src/test/autocomplete/base.test.ts +++ b/src/test/autocomplete/base.test.ts @@ -26,7 +26,10 @@ suite('Autocomplete', () => { let isPython2: boolean; let ioc: UnitTestIocContainer; - suiteSetup(async () => { + suiteSetup(async function () { + // Attempt to fix #1301 + // tslint:disable-next-line:no-invalid-this + this.timeout(60000); await initialize(); initializeDI(); isPython2 = await ioc.getPythonMajorVersion(rootWorkspaceUri) === 2; diff --git a/src/test/initialize.ts b/src/test/initialize.ts index 5914d38185e9..0a428faa4dbd 100644 --- a/src/test/initialize.ts +++ b/src/test/initialize.ts @@ -42,11 +42,17 @@ export async function initializeTest(): Promise { // Dispose any cached python settings (used only in test env). PythonSettings.dispose(); } - export async function closeActiveWindows(): Promise { - return new Promise((resolve, reject) => vscode.commands.executeCommand('workbench.action.closeAllEditors') - // tslint:disable-next-line:no-unnecessary-callback-wrapper - .then(() => resolve(), reject)); + return new Promise((resolve, reject) => { + vscode.commands.executeCommand('workbench.action.closeAllEditors') + // tslint:disable-next-line:no-unnecessary-callback-wrapper + .then(() => resolve(), reject); + // Attempt to fix #1301. + // Lets not waste too much time. + setTimeout(() => { + reject(new Error('Command \'workbench.action.closeAllEditors\' timedout')); + }, 15000); + }); } function getPythonPath(): string {