From 9b5722ae2dafdaf12ead807770e4abc4f38ef07c Mon Sep 17 00:00:00 2001 From: Jimmy Moore Date: Thu, 5 Dec 2024 11:07:44 +0000 Subject: [PATCH] Lint fix, and fixed flakey test Signed-off-by: Jimmy Moore --- pkg/storage/migrator/migrator_s3_assisted_test.go | 4 ++-- pkg/storage/migrator/sync_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/storage/migrator/migrator_s3_assisted_test.go b/pkg/storage/migrator/migrator_s3_assisted_test.go index 33a6388..8f36455 100644 --- a/pkg/storage/migrator/migrator_s3_assisted_test.go +++ b/pkg/storage/migrator/migrator_s3_assisted_test.go @@ -128,7 +128,7 @@ func TestMigratorS3Assisted(t *testing.T) { assert.Equal(t, len(buffer), n) // Wait for the sync to do some bits. - time.Sleep(1 * time.Second) + time.Sleep(2 * time.Second) orderer := blocks.NewAnyBlockOrder(numBlocks, nil) orderer.AddAll() @@ -266,7 +266,7 @@ func TestMigratorS3AssistedChangeSource(t *testing.T) { assert.Equal(t, len(buffer), n) // Wait for the sync to do some bits. - time.Sleep(1 * time.Second) + time.Sleep(2 * time.Second) orderer := blocks.NewAnyBlockOrder(numBlocks, nil) orderer.AddAll() diff --git a/pkg/storage/migrator/sync_test.go b/pkg/storage/migrator/sync_test.go index c942005..82935ce 100644 --- a/pkg/storage/migrator/sync_test.go +++ b/pkg/storage/migrator/sync_test.go @@ -202,7 +202,7 @@ func TestSyncSimpleCancel(t *testing.T) { // Error out here... APART FROM BLOCK 0 and block 8 destStorage := sources.NewMemoryStorage(size) destHooks := modules.NewHooks(destStorage) - destHooks.PreWrite = func(data []byte, offset int64) (bool, int, error) { + destHooks.PreWrite = func(_ []byte, offset int64) (bool, int, error) { if offset == 0 || offset == (8*int64(blockSize)) { return false, 0, nil } @@ -227,8 +227,8 @@ func TestSyncSimpleCancel(t *testing.T) { }, BlockSize: blockSize, ProgressRateLimit: 0, - ProgressHandler: func(mp *MigrationProgress) {}, - ErrorHandler: func(b *storage.BlockInfo, err error) {}, + ProgressHandler: func(_ *MigrationProgress) {}, + ErrorHandler: func(_ *storage.BlockInfo, _ error) {}, } syncer := NewSyncer(context.TODO(), syncConfig) @@ -240,7 +240,7 @@ func TestSyncSimpleCancel(t *testing.T) { assert.Equal(t, 2, len(bstatus)) keys := make([]uint, 0) - for k, _ := range bstatus { + for k := range bstatus { keys = append(keys, k) } slices.Sort(keys)