-
Notifications
You must be signed in to change notification settings - Fork 886
chore: skip timing-sensistive AgentMetadata test in the standard suite #7237
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
Conversation
agent/agent_test.go
Outdated
t.Parallel() | ||
script := "echo -n hello" | ||
if runtime.GOOS == "windows" { | ||
script = "powershell " + script |
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.
This doesn't seem to be working, CI failing with missing hello. Does it need quoting?
testutil/timing.go
Outdated
// | ||
// Eventually, we should run all timing tests in a self-hosted runner. | ||
|
||
var timingFlag = flag.Bool("timing", false, "run timing-sensitive tests") |
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 think we won't be able to do go test ./... -timing
unless all test packages import testutil, a shortcoming of using flags in tests. I think the only way around it would be to use build tags instead but maybe this won't be an issue.
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.
Hmm, I explored build tags but decided against it because it could lead to file bloat.
Let me know what you think about ba6f151.
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.
Hmm, I explored build tags but decided against it because it could lead to file bloat.
I was thinking it could be contained to the testutil
package using the checking function you already implemented, so only 1 more file should be necessary. The build tag would then decide if the test becomes enabled or not.
Example:
//go:build timing
package testutil
var _ = func() any {
timing = true
return nil
}()
(Or use init
, but the above avoids using that reserved name, tags/duped func in both files is another option.)
This would allow running the entire test suite with go test ./... -tags=timing
. Or limiting to timing tests via go test ./... -tags=timing -run='_Timing$'
.
Let me know what you think about ba6f151.
I think that looks alright since it requires an intent to run, otherwise generating go_tests.json would be too slow.
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.
Nice idea, let's go that way. See new code.
0e1d093
to
38340aa
Compare
b58e61a
to
fb0ca0c
Compare
162226e
to
cfc1564
Compare
26a1653
to
b001437
Compare
0e29349
to
c95ff85
Compare
c95ff85
to
ca21e39
Compare
ca21e39
to
05127e6
Compare
agent/agent_test.go
Outdated
for start := time.Now(); time.Since(start) < testutil.WaitMedium; time.Sleep(testutil.IntervalMedium) { | ||
md := client.getMetadata() | ||
if len(md) != 2 { | ||
panic("unexpected number of metadata entries") |
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.
Let's replace this with a require btw.
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
No description provided.