Skip to content

Commit 286ea05

Browse files
authored
Merge pull request #523 from e2b-dev/fix-flaky-test-range-big
Fix flaky TestRangeBig
2 parents 23df12f + f389ce7 commit 286ea05

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

roaring64/bsi64_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ func TestRangeBig(t *testing.T) {
165165

166166
bsi := NewDefaultBSI()
167167

168-
// Populate large timestamp values
168+
// Use a fixed base time so values are deterministic and strictly ordered.
169+
base := time.Date(3026, 1, 1, 0, 0, 0, 0, time.UTC)
169170
for i := 0; i <= 100; i++ {
170-
t := time.Now()
171-
newTime := t.AddDate(1000, 0, 0) // Add 1000 years
172-
secs := newTime.UnixMilli() / 1000
173-
nano := int32(newTime.Nanosecond())
171+
ts := base.Add(time.Duration(i) * time.Second)
172+
secs := ts.UnixMilli() / 1000
173+
nano := int32(ts.Nanosecond())
174174
bigTime := secondsAndNanosToBigInt(secs, nano)
175175
bsi.SetBigValue(uint64(i), bigTime)
176176
}

0 commit comments

Comments
 (0)