-
Notifications
You must be signed in to change notification settings - Fork 1.4k
tests_macos_gitlab_arm64 flakiness: extend go build isolation beyond pkgconfigusage
#43773
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
Merged
dd-mergequeue
merged 3 commits into
main
from
regis.desgroppes/fix-pkgconfigusage-timeout
Dec 3, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Unless explicitly stated otherwise all files in this repository are licensed | ||
| // under the Apache License Version 2.0. | ||
| // This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| // Copyright 2016-present Datadog, Inc. | ||
|
|
||
| // Package testutil provides utilities for testing. | ||
| package testutil | ||
|
|
||
| import ( | ||
| "os" | ||
| "os/exec" | ||
| ) | ||
|
|
||
| // IsolatedGoBuildCmd creates a "go build" command with isolated build environment. | ||
| // This may help reduce timeouts and flakiness when running tests with high parallelism. | ||
| // | ||
| // cacheDir is the directory to use for GOCACHE. | ||
| // output is the path for the output binary. | ||
| // args are additional arguments to pass to "go build" (e.g., "-tags", "foo", "source.go"). | ||
| // | ||
| // See: https://github.com/golang/go/issues/59657 | ||
| func IsolatedGoBuildCmd(cacheDir string, output string, args ...string) *exec.Cmd { | ||
| cmd := exec.Command("go", append([]string{"build", "-o", output}, args...)...) | ||
| cmd.Env = os.Environ() | ||
| for key, value := range IsolatedGoBuildEnv(cacheDir) { | ||
| cmd.Env = append(cmd.Env, key+"="+value) | ||
| } | ||
| return cmd | ||
| } | ||
|
|
||
| // IsolatedGoBuildEnv returns environment variables for isolated Go build operations. | ||
| // This may help reduce timeouts and flakiness when running tests with high parallelism. | ||
| // | ||
| // cacheDir is the directory to use for GOCACHE. | ||
| // | ||
| // See: https://github.com/golang/go/issues/59657 | ||
| func IsolatedGoBuildEnv(cacheDir string) map[string]string { | ||
| return map[string]string{ | ||
| "GOCACHE": cacheDir, // avoid concurrent cache access | ||
| "GOPRIVATE": "*", // avoid VCS queries | ||
| "GOPROXY": "off", // avoid network access | ||
| } | ||
| } |
Oops, something went wrong.
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.
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.
I do suspect that you're correct that
mod=vendoris unnecessary here, especially after seeing the linked issue on golang, as this seems to be caused by a deadlock rather than network accesses. Agreed that we should wait until after we merge and validate before removing it, at which time we should also remove the two lines below which assignStdoutandStderr, they were only used to debug these failures.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.
💯