From beb7f2a0488cf57eaf23f354a6e65fd9dedf4371 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 9 Sep 2022 13:27:15 +0300 Subject: [PATCH] [#1634] node: Change default epoch in tests Do not treat objects with expiration as expired by default. Signed-off-by: Pavel Karpy --- pkg/local_object_storage/engine/engine_test.go | 3 +-- pkg/local_object_storage/metabase/db_test.go | 3 +-- pkg/local_object_storage/metabase/version_test.go | 3 +-- pkg/local_object_storage/shard/control_test.go | 3 +-- pkg/local_object_storage/shard/shard_test.go | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/local_object_storage/engine/engine_test.go b/pkg/local_object_storage/engine/engine_test.go index 94fbc4457..6a07f810d 100644 --- a/pkg/local_object_storage/engine/engine_test.go +++ b/pkg/local_object_storage/engine/engine_test.go @@ -2,7 +2,6 @@ package engine import ( "fmt" - "math" "os" "path/filepath" "testing" @@ -31,7 +30,7 @@ import ( type epochState struct{} func (s epochState) CurrentEpoch() uint64 { - return math.MaxUint64 + return 0 } func BenchmarkExists(b *testing.B) { diff --git a/pkg/local_object_storage/metabase/db_test.go b/pkg/local_object_storage/metabase/db_test.go index 5ce74d5f2..0a43e66d4 100644 --- a/pkg/local_object_storage/metabase/db_test.go +++ b/pkg/local_object_storage/metabase/db_test.go @@ -1,7 +1,6 @@ package meta_test import ( - "math" "os" "strconv" "testing" @@ -29,7 +28,7 @@ func (s epochState) CurrentEpoch() uint64 { return s.e } - return math.MaxUint64 + return 0 } // saves "big" object in DB. diff --git a/pkg/local_object_storage/metabase/version_test.go b/pkg/local_object_storage/metabase/version_test.go index b35a1102c..70ded67a4 100644 --- a/pkg/local_object_storage/metabase/version_test.go +++ b/pkg/local_object_storage/metabase/version_test.go @@ -4,7 +4,6 @@ import ( "encoding/binary" "errors" "fmt" - "math" "path/filepath" "testing" @@ -15,7 +14,7 @@ import ( type epochStateImpl struct{} func (s epochStateImpl) CurrentEpoch() uint64 { - return math.MaxUint64 + return 0 } func TestVersion(t *testing.T) { diff --git a/pkg/local_object_storage/shard/control_test.go b/pkg/local_object_storage/shard/control_test.go index cfb26716f..5df24c068 100644 --- a/pkg/local_object_storage/shard/control_test.go +++ b/pkg/local_object_storage/shard/control_test.go @@ -1,7 +1,6 @@ package shard import ( - "math" "os" "path/filepath" "testing" @@ -28,7 +27,7 @@ import ( type epochState struct{} func (s epochState) CurrentEpoch() uint64 { - return math.MaxUint64 + return 0 } func TestShardOpen(t *testing.T) { diff --git a/pkg/local_object_storage/shard/shard_test.go b/pkg/local_object_storage/shard/shard_test.go index 45c299738..483e099fa 100644 --- a/pkg/local_object_storage/shard/shard_test.go +++ b/pkg/local_object_storage/shard/shard_test.go @@ -2,7 +2,6 @@ package shard_test import ( "crypto/sha256" - "math" "math/rand" "path/filepath" "testing" @@ -30,7 +29,7 @@ import ( type epochState struct{} func (s epochState) CurrentEpoch() uint64 { - return math.MaxUint64 + return 0 } func newShard(t testing.TB, enableWriteCache bool) *shard.Shard {