Skip to content

Commit

Permalink
increase timeouts in an attempt fix #1301
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Apr 5, 2018
1 parent fd29890 commit ffe44c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/test/autocomplete/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 10 additions & 4 deletions src/test/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ export async function initializeTest(): Promise<any> {
// Dispose any cached python settings (used only in test env).
PythonSettings.dispose();
}

export async function closeActiveWindows(): Promise<void> {
return new Promise<void>((resolve, reject) => vscode.commands.executeCommand('workbench.action.closeAllEditors')
// tslint:disable-next-line:no-unnecessary-callback-wrapper
.then(() => resolve(), reject));
return new Promise<void>((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 {
Expand Down

0 comments on commit ffe44c2

Please sign in to comment.