Skip to content

Commit

Permalink
satellite/metabase: reduce queries for iterator boundaries tests
Browse files Browse the repository at this point in the history
This is longest metabase at the moment and would nice to speed
up is a bit to improve overal tests execution time.

Change-Id: I86da8e0e593d20024b3ec778cbeab34a4613151f
  • Loading branch information
mniewrzal authored and Storj Robot committed Aug 22, 2022
1 parent 6b27c64 commit 71c1d0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions satellite/metabase/iterator_test.go
Expand Up @@ -610,7 +610,7 @@ func TestIterateObjectsWithStatus(t *testing.T) {

queries := []metabase.ObjectKey{""}
for a := 0; a <= 0xFF; a++ {
if 4 < a && a < 251 {
if 3 < a && a < 252 {
continue
}
queries = append(queries, metabase.ObjectKey([]byte{byte(a)}))
Expand All @@ -624,9 +624,10 @@ func TestIterateObjectsWithStatus(t *testing.T) {

createObjectsWithKeys(ctx, t, db, projectID, bucketName, queries[1:])

var collector metabasetest.IterateCollector
for _, cursor := range queries {
for _, prefix := range queries {
var collector metabasetest.IterateCollector
collector = collector[:0]
err := db.IterateObjectsAllVersionsWithStatus(ctx, metabase.IterateObjectsWithStatus{
ProjectID: projectID,
BucketName: bucketName,
Expand All @@ -637,10 +638,10 @@ func TestIterateObjectsWithStatus(t *testing.T) {
Prefix: prefix,
Status: metabase.Committed,
IncludeCustomMetadata: true,
IncludeSystemMetadata: true,
}, collector.Add)
require.NoError(t, err)

collector = collector[:0]
err = db.IterateObjectsAllVersionsWithStatus(ctx, metabase.IterateObjectsWithStatus{
ProjectID: projectID,
BucketName: bucketName,
Expand All @@ -652,7 +653,6 @@ func TestIterateObjectsWithStatus(t *testing.T) {
Recursive: true,
Status: metabase.Committed,
IncludeCustomMetadata: true,
IncludeSystemMetadata: true,
}, collector.Add)
require.NoError(t, err)
}
Expand Down

1 comment on commit 71c1d0f

@storjrobot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Storj Community Forum (official). There might be relevant details there:

https://forum.storj.io/t/release-preparation-v1-63/19558/1

Please sign in to comment.