fix(test): flaky TestStore_InsertCleansUpOldUptimeEntriesProperly (#418)

This commit is contained in:
tesibelda 2023-02-02 04:59:31 +01:00 committed by GitHub
parent 277e805dbb
commit 6e4b88dc6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ func TestNewStore(t *testing.T) {
func TestStore_InsertCleansUpOldUptimeEntriesProperly(t *testing.T) {
store, _ := NewStore("sqlite", t.TempDir()+"/TestStore_InsertCleansUpOldUptimeEntriesProperly.db", false)
defer store.Close()
now := time.Now().Round(time.Minute)
now := time.Now().Truncate(time.Hour)
now = time.Date(now.Year(), now.Month(), now.Day(), now.Hour(), 0, 0, 0, now.Location())
store.Insert(&testEndpoint, &core.Result{Timestamp: now.Add(-5 * time.Hour), Success: true})