-
Notifications
You must be signed in to change notification settings - Fork 530
[test-parallel] Daily Go Test Parallelizer: add t.Parallel() to 6 safe test files #53967
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ import ( | |
| // 2. Log file contains JSON blocks with token usage | ||
| // 3. extractLogMetrics correctly parses and accumulates token counts | ||
| func TestCopilotTokenExtractionFromLogs(t *testing.T) { | ||
| t.Parallel() | ||
| tempDir := t.TempDir() | ||
|
|
||
| // Create aw_info.json with copilot engine | ||
|
|
@@ -107,6 +108,7 @@ func TestCopilotTokenExtractionFromLogs(t *testing.T) { | |
|
|
||
| // TestCopilotTokenExtractionWithSingleResponse tests extraction with just one API response | ||
| func TestCopilotTokenExtractionWithSingleResponse(t *testing.T) { | ||
| t.Parallel() | ||
| tempDir := t.TempDir() | ||
|
|
||
| // Create aw_info.json with copilot engine | ||
|
|
@@ -142,6 +144,7 @@ func TestCopilotTokenExtractionWithSingleResponse(t *testing.T) { | |
|
|
||
| // TestCopilotTokenExtractionWithNoUsageData tests when logs don't contain usage data | ||
| func TestCopilotTokenExtractionWithNoUsageData(t *testing.T) { | ||
| t.Parallel() | ||
| tempDir := t.TempDir() | ||
|
|
||
| // Create aw_info.json with copilot engine | ||
|
|
@@ -171,6 +174,7 @@ func TestCopilotTokenExtractionWithNoUsageData(t *testing.T) { | |
| // TestCopilotTokenExtractionWithRealLogData tests token extraction with actual log data | ||
| // from workflow run 20696085597 (Smoke Copilot test) | ||
| func TestCopilotTokenExtractionWithRealLogData(t *testing.T) { | ||
| t.Parallel() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test now runs in parallel even though it depends on a fixed host path outside the test sandbox, so another concurrent test/job touching the same 💡 Why this is a real flake risk
A safer fix is to keep this specific test serial, or better, move the sample log under a testdata fixture so the test only reads repository-controlled input. func TestCopilotTokenExtractionWithRealLogData(t *testing.T) {
// no t.Parallel() until the hard-coded external path is removed
} |
||
| // This test validates real log data if available | ||
| realLogPath := "/tmp/run-20696085597/sandbox/agent/logs/session-dd1eedf4-2b6d-4373-942c-1447d5a6e00a.log" | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two top-level tests now run in parallel while both read live workflow source and compiled lock files from the repository root, which makes them coupled to any other test mutating those files and undermines the “safe to parallelize” claim in the PR.
💡 Why this should stay serial
The justification in the PR body says these files were only parallelized when they had no shared paths or cross-test ordering concerns, but both tests here resolve the same repo root and inspect the same workflow artifacts on disk. That is not isolated test input; it is shared process-visible state.
Even if this file’s two tests only read today, marking them parallel bakes in hidden coupling to the rest of the package test suite and makes future workflow-rewriting tests much easier to break. The conservative move is to leave repository-fixture readers serial unless the input is copied into
t.TempDir()first.