Skip to content

Commit 2f89a22

Browse files
Merge master into feature/cwltail
2 parents ca25202 + a77ec12 commit 2f89a22

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/core/src/test/testUtil.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,30 +490,30 @@ export async function closeAllEditors(): Promise<void> {
490490
/amazonwebservices\.[a-z\-]+-vscode\./,
491491
/nullExtensionDescription./, // Sometimes exists instead of the prior line, see https://github.com/aws/aws-toolkit-vscode/issues/4658
492492
]
493-
const editors: vscode.TextEditor[] = []
493+
const editorsToClose: vscode.TextEditor[] = []
494494

495495
const noVisibleEditor: boolean | undefined = await waitUntil(
496496
async () => {
497497
// Race: documents could appear after the call to closeAllEditors(), so retry.
498498
await vscode.commands.executeCommand(closeAllCmd)
499-
editors.length = 0
500-
editors.push(
499+
editorsToClose.length = 0
500+
editorsToClose.push(
501501
...vscode.window.visibleTextEditors.filter(
502502
(editor) => !ignorePatterns.some((p) => p.test(editor.document.fileName))
503503
)
504504
)
505505

506-
return editors.length === 0
506+
return editorsToClose.length === 0
507507
},
508508
{
509-
timeout: 5000, // Arbitrary values. Should succeed except when VS Code is lagging heavily.
509+
timeout: 1000, // Arbitrary values. Should succeed except when VS Code is lagging heavily.
510510
interval: 250,
511511
truthy: true,
512512
}
513513
)
514514

515-
if (!noVisibleEditor) {
516-
const editorNames = editors.map((editor) => `\t${editor.document.fileName}`)
515+
if (!noVisibleEditor && editorsToClose.length > 0) {
516+
const editorNames = editorsToClose.map((editor) => `\t${editor.document.fileName}`)
517517
throw new Error(`Editors were still open after closeAllEditors():\n${editorNames.join('\n')}`)
518518
}
519519
}

0 commit comments

Comments
 (0)