Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
shiqizng committed Jun 27, 2022
1 parent a465041 commit eb2ac87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions processor/blockprocessor/initialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func TestRunMigration(t *testing.T) {
AlgodToken: "AAAAA",
}

ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
// migrate 3 rounds
err = InitializeLedgerSimple(ctx, logrus.New(), 3, &opts)
err = InitializeLedgerSimple(ctx, cancel, logrus.New(), 3, &opts)
assert.NoError(t, err)
log, _ := test2.NewNullLogger()
l, err := util.MakeLedger(log, false, &genesis, opts.IndexerDatadir)
Expand All @@ -76,7 +76,8 @@ func TestRunMigration(t *testing.T) {
l.Close()

// migration continues from last round
err = InitializeLedgerSimple(ctx, logrus.New(), 6, &opts)
ctx, cancel = context.WithCancel(context.Background())
err = InitializeLedgerSimple(ctx, cancel, logrus.New(), 6, &opts)
assert.NoError(t, err)

l, err = util.MakeLedger(log, false, &genesis, opts.IndexerDatadir)
Expand Down

0 comments on commit eb2ac87

Please sign in to comment.