From 0b7bc6d73cfdaec83ef36020db6cae90a4042115 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 14 Jan 2022 08:56:11 -0800 Subject: [PATCH] Re-enable auto replies tests with retries on Windows only Fixes #139076 --- test/smoke/src/areas/terminal/terminal-input.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/smoke/src/areas/terminal/terminal-input.test.ts b/test/smoke/src/areas/terminal/terminal-input.test.ts index 26fdd66f10a..8cfbfa10ea0 100644 --- a/test/smoke/src/areas/terminal/terminal-input.test.ts +++ b/test/smoke/src/areas/terminal/terminal-input.test.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { Application, Terminal, SettingsEditor } from '../../../../automation'; -import { itSkipOnFail } from '../../utils'; export function setup() { describe('Terminal Input', () => { @@ -18,14 +17,21 @@ export function setup() { settingsEditor = app.workbench.settingsEditor; }); - describe('Auto replies', () => { + describe('Auto replies', function () { + + // HACK: Retry this suite only on Windows because conpty can rarely lead to unexpected behavior which would + // cause flakiness. If this does happen, the feature is expected to fail. + if (process.platform === 'win32') { + this.retries(3); + } + async function writeTextForAutoReply(text: string): Promise { // Put the matching word in quotes to avoid powershell coloring the first word and // on a new line to avoid cursor move/line switching sequences await terminal.runCommandInTerminal(`"\r${text}`, true); } - itSkipOnFail('should automatically reply to default "Terminate batch job (Y/N)"', async () => { // TODO@daniel https://github.com/microsoft/vscode/issues/139076 + it('should automatically reply to default "Terminate batch job (Y/N)"', async () => { await terminal.createTerminal(); await writeTextForAutoReply('Terminate batch job (Y/N)?'); await terminal.waitForTerminalText(buffer => buffer.some(line => line.match(/\?.*Y/)));