Skip to content

Commit

Permalink
fix flakey test due to time drift
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Jun 7, 2024
1 parent 32f8f31 commit 1ada584
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keygen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ func TestValidate(t *testing.T) {
t.Fatalf("Should have no components: components=%v", dataset.Components)
case dataset.Issued.IsZero():
t.Fatalf("Should have an issued timestamp: ts=%v", dataset.Issued)
case time.Until(dataset.Expiry) < 24*time.Hour*365:
t.Fatalf("Should have an expiry timestamp: ts=%v", dataset.Expiry)
case time.Until(dataset.Expiry) < (24*time.Hour*365 + MaxClockDrift): // for drift
t.Fatalf("Should have an expiry timestamp: ts=%v expected=%f actual=%f", dataset.Expiry, 24*time.Hour*365+MaxClockDrift, time.Until(dataset.Expiry))
case dataset.TTL == 0:
t.Fatalf("Should have a TTL: ttl=%d", dataset.TTL)
}
Expand Down

0 comments on commit 1ada584

Please sign in to comment.