Skip to content

Commit ffe44c2

Browse files
committed
increase timeouts in an attempt fix #1301
1 parent fd29890 commit ffe44c2

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/test/autocomplete/base.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ suite('Autocomplete', () => {
2626
let isPython2: boolean;
2727
let ioc: UnitTestIocContainer;
2828

29-
suiteSetup(async () => {
29+
suiteSetup(async function () {
30+
// Attempt to fix #1301
31+
// tslint:disable-next-line:no-invalid-this
32+
this.timeout(60000);
3033
await initialize();
3134
initializeDI();
3235
isPython2 = await ioc.getPythonMajorVersion(rootWorkspaceUri) === 2;

src/test/initialize.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,17 @@ export async function initializeTest(): Promise<any> {
4242
// Dispose any cached python settings (used only in test env).
4343
PythonSettings.dispose();
4444
}
45-
4645
export async function closeActiveWindows(): Promise<void> {
47-
return new Promise<void>((resolve, reject) => vscode.commands.executeCommand('workbench.action.closeAllEditors')
48-
// tslint:disable-next-line:no-unnecessary-callback-wrapper
49-
.then(() => resolve(), reject));
46+
return new Promise<void>((resolve, reject) => {
47+
vscode.commands.executeCommand('workbench.action.closeAllEditors')
48+
// tslint:disable-next-line:no-unnecessary-callback-wrapper
49+
.then(() => resolve(), reject);
50+
// Attempt to fix #1301.
51+
// Lets not waste too much time.
52+
setTimeout(() => {
53+
reject(new Error('Command \'workbench.action.closeAllEditors\' timedout'));
54+
}, 15000);
55+
});
5056
}
5157

5258
function getPythonPath(): string {

0 commit comments

Comments
 (0)