chore: de-flake TestWorkspaceAgent_Metadata (round 2) (#7039)

This time, we keep the timing / "racey" tests, but avoid running
them in the harsher CI conditions.
This commit is contained in:
Ammar Bandukwala
2023-04-06 16:10:13 -05:00
committed by GitHub
parent e1149992d8
commit 24d8644c0b
5 changed files with 31 additions and 7 deletions

16
testutil/ci.go Normal file
View File

@ -0,0 +1,16 @@
package testutil
import (
"flag"
"os"
)
func InCI() bool {
_, ok := os.LookupEnv("CI")
return ok
}
func InRaceMode() bool {
fl := flag.Lookup("race")
return fl != nil && fl.Value.String() == "true"
}