Skip to content

Stabilize TestDetect by serializing Maven-dependent subtests - #50

Draft
JeffreyCA with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-testdetect-flakiness
Draft

Stabilize TestDetect by serializing Maven-dependent subtests#50
JeffreyCA with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-testdetect-flakiness

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown

TestDetect/Full and TestDetect/ExcludePatterns were running concurrently and both invoking real mvn against the shared local .m2 cache, causing intermittent artifact download temp-file races. This change removes that intra-test concurrency while preserving package-level parallelism.

  • Change: serialize TestDetect subtests

    • Removed subtest-level t.Parallel() from TestDetect in internal/appdetect/appdetect_test.go.
    • TestDetect itself remains parallelized relative to other tests/packages.
  • Impact

    • Prevents concurrent Maven processes from contending on shared .m2 state during cold-cache dependency resolution.
    • Scope is limited to test code in internal/appdetect; no changes to Maven implementation or resolver flags.
for _, tt := range tests {
	t.Run(tt.name, func(t *testing.T) {
		// t.Parallel() removed to avoid concurrent mvn access to shared ~/.m2
		projects, err := Detect(t.Context(), dir, tt.options...)
		require.NoError(t, err)
		// ...
	})
}

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix TestDetect flakiness from concurrent Maven access to shared .m2 Stabilize TestDetect by serializing Maven-dependent subtests Jun 26, 2026
Copilot AI requested a review from JeffreyCA June 26, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants