Skip to content

Commit 0016a60

Browse files
authored
Fix transient test failure (#2512)
1 parent c96db5a commit 0016a60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/controller/datadoggenericresource/synthetics_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ func Test_updateStatusFromSyntheticsTest(t *testing.T) {
113113
assert.Equal(t, tt.expectedStatus.Creator, status.Creator)
114114
assert.Equal(t, tt.expectedStatus.SyncStatus, status.SyncStatus)
115115
assert.Equal(t, tt.expectedStatus.CurrentHash, status.CurrentHash)
116-
// Compare time with a tolerance of 1 ms (time.Now() is called in the function)
117-
assert.True(t, status.Created.Time.Sub(tt.expectedStatus.Created.Time) < time.Millisecond)
118-
assert.True(t, status.LastForceSyncTime.Time.Sub(tt.expectedStatus.LastForceSyncTime.Time) < time.Millisecond)
116+
// Compare time with a tolerance of 1 second (time.Now() is called in the function)
117+
assert.True(t, status.Created.Time.Sub(tt.expectedStatus.Created.Time).Abs() < time.Second)
118+
assert.True(t, status.LastForceSyncTime.Time.Sub(tt.expectedStatus.LastForceSyncTime.Time).Abs() < time.Second)
119119
})
120120
}
121121
}

0 commit comments

Comments
 (0)