Skip to content

Commit 9afc295

Browse files
authored
Work around E2E test failure (#13347)
1 parent f7e2caf commit 9afc295

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Extension/test/scenarios/MultirootDeadlockTest/tests/inlayhints.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import { suite } from 'mocha';
1212
import * as vscode from 'vscode';
1313
import * as api from 'vscode-cpptools';
1414
import * as apit from 'vscode-cpptools/out/testApi';
15+
import { sleep } from '../../../../src/Utility/Async/sleep';
1516
import { timeout } from '../../../../src/Utility/Async/timeout';
1617
import * as testHelpers from '../../../common/testHelpers';
1718

18-
suite("[Inlay hints test]", function(): void {
19+
suite("[Inlay hints test]", function (): void {
1920
// Settings
2021
const inlayHintSettings: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration('C_Cpp.inlayHints');
2122
const autoDeclarationTypesEnabled: string = "autoDeclarationTypes.enabled";
@@ -41,7 +42,7 @@ suite("[Inlay hints test]", function(): void {
4142
const fileUri: vscode.Uri = vscode.Uri.file(filePath);
4243
const disposables: vscode.Disposable[] = [];
4344

44-
suiteSetup(async function(): Promise<void> {
45+
suiteSetup(async function (): Promise<void> {
4546
await testHelpers.activateCppExtension();
4647

4748
const cpptools = await apit.getCppToolsTestApi(api.Version.latest) ?? assert.fail("Could not get cpptools test api");
@@ -74,7 +75,7 @@ suite("[Inlay hints test]", function(): void {
7475
await useDefaultSettings();
7576
});
7677

77-
suiteTeardown(async function(): Promise<void> {
78+
suiteTeardown(async function (): Promise<void> {
7879
await restoreOriginalSettings();
7980
disposables.forEach(d => d.dispose());
8081
});
@@ -298,6 +299,9 @@ suite("[Inlay hints test]", function(): void {
298299
await inlayHintSettings.update(inlayHintSetting, valueNew, vscode.ConfigurationTarget.Global);
299300
const valueAfterChange: any = inlayHintSettings.inspect(inlayHintSetting)!.globalValue;
300301
assert.strictEqual(valueAfterChange, valueNew, `Unable to change setting: ${inlayHintSetting}`);
302+
// TODO: We need a way to synchronize with native process having completely processed the setting change
303+
// and any changes in behavior being fully applied.
304+
await sleep(5000);
301305
}
302306
}
303307

0 commit comments

Comments
 (0)