chore(coderd): remove timing check (#7144)

This commit is contained in:
Ammar Bandukwala
2023-04-17 17:40:02 +00:00
committed by GitHub
parent b3b26a62f2
commit 80bf042528
2 changed files with 0 additions and 19 deletions
-12
View File
@@ -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{