Skip to content

Commit

Permalink
Fixed duplicate timestamps causing pagination test failure (#157)
Browse files Browse the repository at this point in the history
* Fixed duplicate timestamps causing pagination test failure

---------

Co-authored-by: Ahmed Hossam <[email protected]>
  • Loading branch information
ahmed-hossam28 and Ahmed Hossam authored Sep 21, 2024
1 parent b497611 commit 2b3279f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,9 @@ func TestPagedQueryUsingIndex(t *testing.T) {
n := 10003
for i := 0; i < n; i++ {
doc := d.NewDocument()
doc.Set("timestamp", time.Now())

// Ensure unique timestamps by adding a small time offset (in nanoseconds)
doc.Set("timestamp", time.Now().Add(time.Duration(i)*time.Nanosecond))

if len(docs) == 1024 {
err := db.Insert("test", docs...)
Expand Down

0 comments on commit 2b3279f

Please sign in to comment.