diff --git a/coderd/workspaceagents_test.go b/coderd/workspaceagents_test.go index 090267cf99..c2dd39cd32 100644 --- a/coderd/workspaceagents_test.go +++ b/coderd/workspaceagents_test.go @@ -1271,18 +1271,6 @@ func TestWorkspaceAgent_Metadata(t *testing.T) { check := func(want codersdk.WorkspaceAgentMetadataResult, got codersdk.WorkspaceAgentMetadata) { require.Equal(t, want.Value, got.Result.Value) require.Equal(t, want.Error, got.Result.Error) - - if testutil.InCI() && (runtime.GOOS == "windows" || testutil.InRaceMode()) { - // Avoid testing timings when flake chance is high. - return - } - require.WithinDuration(t, got.Result.CollectedAt, want.CollectedAt, time.Second) - ageImpliedNow := got.Result.CollectedAt.Add(time.Duration(got.Result.Age) * time.Second) - // We use a long WithinDuration to tolerate slow CI, but we're still making sure - // that Age is within the ballpark. - require.WithinDuration( - t, time.Now(), ageImpliedNow, time.Second*10, - ) } wantMetadata1 := codersdk.WorkspaceAgentMetadataResult{ diff --git a/testutil/ci.go b/testutil/ci.go index 51166d4a8a..ffc0bb1f2e 100644 --- a/testutil/ci.go +++ b/testutil/ci.go @@ -1,7 +1,6 @@ package testutil import ( - "flag" "os" ) @@ -9,9 +8,3 @@ func InCI() bool { _, ok := os.LookupEnv("CI") return ok } - -func InRaceMode() bool { - fl := flag.Lookup("race") - //nolint:forcetypeassert - return fl != nil && fl.Value.(flag.Getter).Get().(bool) -}