chore: skip timing-sensistive AgentMetadata test in the standard suite (#7237)

* chore: skip timing-sensistive AgentMetadata test in the standard suite

* Add test-timing target

* fix windows?

* Works on my Windows desktop?

* Use tag system

* fixup! Use tag system
This commit is contained in:
Ammar Bandukwala
2023-05-02 10:41:41 +00:00
committed by GitHub
parent 398d08a0cf
commit 465fe8658d
4 changed files with 138 additions and 69 deletions
+8
View File
@@ -0,0 +1,8 @@
//go:build timing
package testutil
var _ = func() any {
timing = true
return nil
}()
+20
View File
@@ -0,0 +1,20 @@
package testutil
import (
"testing"
)
// We can't run timing-sensitive tests in CI because of the
// great variance in runner performance. Instead of not testing timing at all,
// we relegate it to humans manually running certain tests with the "-timing"
// flag from time to time.
//
// Eventually, we should run all timing tests in a self-hosted runner.
var timing bool
func SkipIfNotTiming(t *testing.T) {
if !timing {
t.Skip("skipping timing-sensitive test")
}
}