Skip to content

Commit aa91f91

Browse files
committed
Suppress exit code notification in terminal test
1 parent 921b9a9 commit aa91f91

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import { doesNotThrow, equal, ok, deepEqual, throws } from 'assert';
99
// TODO@Daniel flaky tests (https://github.com/microsoft/vscode/issues/92826)
1010
((env.uiKind === UIKind.Web) ? suite.skip : suite)('vscode API - terminal', () => {
1111
suiteSetup(async () => {
12+
const config = workspace.getConfiguration('terminal.integrated');
1213
// Disable conpty in integration tests because of https://github.com/microsoft/vscode/issues/76548
13-
await workspace.getConfiguration('terminal.integrated').update('windowsEnableConpty', false, ConfigurationTarget.Global);
14+
await config.update('windowsEnableConpty', false, ConfigurationTarget.Global);
15+
// Disable exit alerts as tests may trigger then and we're not testing the notifications
16+
await config.update('showExitAlert', false, ConfigurationTarget.Global);
1417
});
1518
suite('Terminal', () => {
1619
let disposables: Disposable[] = [];
@@ -562,7 +565,12 @@ import { doesNotThrow, equal, ok, deepEqual, throws } from 'assert';
562565
const pty: Pseudoterminal = {
563566
onDidWrite: writeEmitter.event,
564567
onDidClose: closeEmitter.event,
565-
open: () => closeEmitter.fire(22),
568+
open: () => {
569+
// Wait 500ms as any exits that occur within 500ms of terminal launch are
570+
// are counted as "exiting during launch" which triggers a notification even
571+
// when showExitAlerts is true
572+
setTimeout(() => closeEmitter.fire(22), 500);
573+
},
566574
close: () => { }
567575
};
568576
const terminal = window.createTerminal({ name: 'foo', pty });

0 commit comments

Comments
 (0)