fix: isolate smoke test config home to stop cross-test interference [IDE-2108]#1354
Open
basti-snyk wants to merge 1 commit into
Open
fix: isolate smoke test config home to stop cross-test interference [IDE-2108]#1354basti-snyk wants to merge 1 commit into
basti-snyk wants to merge 1 commit into
Conversation
…IDE-2108] Test_SmokeScanPrecedence_OSSEnabled_CodeDisabled flaked on Ubuntu CI: the OSS scan never completed (ran to a 28s timeout), with config-file errors from a parallel test in the logs. Root cause: the smoke-test setup helpers mutated the process-global xdg.ConfigHome (read by storage.NewStorageWithCallbacks via xdg.ConfigFile) and restored it in t.Cleanup. When two smoke tests ran concurrently, each writing its own t.TempDir() to that global, one test's storage/folder-config resolved into another test's directory — the folder config file was missing and the scan stalled. Fix: drop the xdg.ConfigHome mutation and instead set an explicit per-test SettingConfigFile on the engine configuration. folderconfig.ConfigFileFromConfig returns that explicit path before ever consulting the xdg global, so each test is fully isolated without touching shared process state. Applied at all four setup sites (precedence_smoke_test.go x3, ldx_sync_smoke_test.go). Adds isolation-invariant regression tests proving ConfigFileFromConfig returns the explicit path for the primary, legacy, and user-global keys and never falls back to xdg.ConfigHome. Produced by an automated flake-fix loop.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
PR Reviewer Guide 🔍
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test_SmokeScanPrecedence_OSSEnabled_CodeDisabled(Ubuntu CI), where the OSS scan never completed (28s timeout) with config-file errors from a parallel test in the logs.xdg.ConfigHome(read bystorage.NewStorageWithCallbacksviaxdg.ConfigFile) and restored it int.Cleanup. When two smoke tests ran concurrently, each writing its ownt.TempDir()to that global, one test's storage/folder-config resolved into another test's directory — the folder config file was missing and the scan stalled.xdg.ConfigHomemutation and instead set an explicit per-testSettingConfigFileon the engine configuration.folderconfig.ConfigFileFromConfigreturns that explicit path before ever consulting thexdgglobal, so each test is fully isolated without touching shared process state. Applied at all four setup sites (precedence_smoke_test.gox3,ldx_sync_smoke_test.go).ConfigFileFromConfigreturns the explicit path for the primary, legacy, and user-global keys and never falls back toxdg.ConfigHome.Test plan
go build ./...,go vet,golangci-lint ./internal/folderconfig/...clean (0 issues)go test ./internal/folderconfig/... -racerace-clean over repeated runs; the kept isolation test proven RED ifSettingConfigFileresolution regressesxdg.ConfigHomeassignment remains anywhere in the repomake test(full unit suite) green at this commitThis fix was produced by an automated flake-fix loop.