Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLVSCODE-972 try fix flaky autobinding test #675

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions test/suite/autobinding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ suite('Auto Binding Test Suite', () => {
.getConfiguration(SONARLINT_CATEGORY, folder.uri)
.update(BINDING_SETTINGS, undefined, VSCode.ConfigurationTarget.WorkspaceFolder);
}));
deleteSettingsFiles();
});

test('Should show binding suggestion notification', async () => {
Expand Down Expand Up @@ -439,7 +438,7 @@ suite('Auto Binding Test Suite', () => {
});
});

async function deleteSettingsFiles() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the temporary settings files need to be deleted not to pollute the state for upcoming test suites. At the same time, binding needs to be cleaned up after each test.

Possibly there used to be a race condition between the two actions. This change aims to mitigate this.

async function cleanBindings() {
const workspaceFolders = VSCode.workspace.workspaceFolders;
if (workspaceFolders) {
for (const folder of workspaceFolders) {
Expand All @@ -452,9 +451,3 @@ async function deleteSettingsFiles() {
}
}
}

async function cleanBindings() {
return VSCode.workspace
.getConfiguration(SONARLINT_CATEGORY, VSCode.workspace.workspaceFolders[0].uri)
.update(BINDING_SETTINGS, undefined, VSCode.ConfigurationTarget.WorkspaceFolder);
}
Loading