From d2f3f7555b96e63e07738ab51931e1d038edee26 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 21 Jul 2022 16:32:25 -0700 Subject: [PATCH] Allow continuing on when term kill all doesn't succeed Fixes #155817 --- test/automation/src/terminal.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/automation/src/terminal.ts b/test/automation/src/terminal.ts index 67f012bf483..d088f849520 100644 --- a/test/automation/src/terminal.ts +++ b/test/automation/src/terminal.ts @@ -93,7 +93,14 @@ export class Terminal { await this._waitForTerminal(expectedLocation === 'editor' || commandId === TerminalCommandId.CreateNewEditor ? 'editor' : 'panel'); break; case TerminalCommandId.KillAll: - await this.code.waitForElements(Selector.Xterm, true, e => e.length === 0); + // HACK: Attempt to kill all terminals to clean things up, this is known to be flaky + // but the reason why isn't known. This is typically called in the after each hook, + // Since it's not actually required that all terminals are killed just continue on + // after 2 seconds. + await Promise.race([ + this.code.waitForElements(Selector.Xterm, true, e => e.length === 0), + new Promise(r => setTimeout(r, 2000)) + ]); break; } }