Skip to content

Commit

Permalink
Fix CI test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix committed Feb 5, 2025
1 parent 1c6a730 commit 60d0951
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions disperser/common/v2/blobstore/dynamo_metadata_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,19 @@ func TestBlobMetadataStoreGetAttestationByAttestedAt(t *testing.T) {
func TestBlobMetadataStoreGetAttestationByAttestedAtPagination(t *testing.T) {
ctx := context.Background()

// Use a fixed "now" so all attestations will deterministically fall in just one
now := uint64(time.Now().UnixNano())
firstBatchTs := now - uint64(5*time.Minute.Nanoseconds())
// Adjust "now" so all attestations will deterministically fall in just one
// bucket.
timestamp := "2025-01-21T15:04:05Z"
parsedTime, err := time.Parse(time.RFC3339, timestamp)
require.NoError(t, err)
now := uint64(parsedTime.UnixNano())
startBucket, endBucket := blobstore.GetAttestedAtBucketIDRange(firstBatchTs-1, now)

Check failure on line 670 in disperser/common/v2/blobstore/dynamo_metadata_store_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: blobstore.GetAttestedAtBucketIDRange

Check failure on line 670 in disperser/common/v2/blobstore/dynamo_metadata_store_test.go

View workflow job for this annotation

GitHub Actions / Linter

undefined: blobstore.GetAttestedAtBucketIDRange

Check failure on line 670 in disperser/common/v2/blobstore/dynamo_metadata_store_test.go

View workflow job for this annotation

GitHub Actions / Linter

undefined: blobstore.GetAttestedAtBucketIDRange
if startBucket < endBucket {
now -= uint64(25 * time.Hour.Nanoseconds())
firstBatchTs = now - uint64(5*time.Minute.Nanoseconds())
}
startBucket, endBucket = blobstore.GetAttestedAtBucketIDRange(firstBatchTs-1, now)

Check failure on line 675 in disperser/common/v2/blobstore/dynamo_metadata_store_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: blobstore.GetAttestedAtBucketIDRange

Check failure on line 675 in disperser/common/v2/blobstore/dynamo_metadata_store_test.go

View workflow job for this annotation

GitHub Actions / Linter

undefined: blobstore.GetAttestedAtBucketIDRange (typecheck)

Check failure on line 675 in disperser/common/v2/blobstore/dynamo_metadata_store_test.go

View workflow job for this annotation

GitHub Actions / Linter

undefined: blobstore.GetAttestedAtBucketIDRange (typecheck)
require.Equal(t, startBucket, endBucket)

numBatches := 240
firstBatchTs := now - uint64(5*time.Minute.Nanoseconds())
nanoSecsPerBatch := uint64(time.Second.Nanoseconds()) // 1 batch per second

// Create attestations for testing
Expand Down

0 comments on commit 60d0951

Please sign in to comment.