Skip to content

Commit

Permalink
Lint fix, and fixed flakey test
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Moore <[email protected]>
  • Loading branch information
jimmyaxod committed Dec 5, 2024
1 parent 2c0c5f0 commit 9b5722a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/migrator/migrator_s3_assisted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/migrator/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 9b5722a

Please sign in to comment.