Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
urvisavla committed Jun 9, 2023
1 parent 66e07ab commit a72f84b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ingest/ledgerbackend/captive_core_backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"encoding/hex"
"fmt"
"os"
"sync"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"sync"

"github.com/stellar/go/historyarchive"
"github.com/stellar/go/network"
Expand Down Expand Up @@ -652,7 +652,7 @@ func TestGetLatestLedgerSequenceRaceCondition(t *testing.T) {
metaChan := make(chan metaResult, toSeq)

for i := fromSeq; i <= toSeq; i++ {
meta := buildLedgerCloseMeta(testLedgerHeader{sequence: uint32(i)})
meta := buildLedgerCloseMeta(testLedgerHeader{sequence: i})
metaChan <- metaResult{
LedgerCloseMeta: &meta,
}
Expand All @@ -667,7 +667,7 @@ func TestGetLatestLedgerSequenceRaceCondition(t *testing.T) {
mockArchive.
On("GetRootHAS").
Return(historyarchive.HistoryArchiveState{
CurrentLedger: uint32(toSeq * 2),
CurrentLedger: toSeq * 2,
}, nil)

mockArchive.
Expand All @@ -683,7 +683,8 @@ func TestGetLatestLedgerSequenceRaceCondition(t *testing.T) {
}

ledgerRange := UnboundedRange(fromSeq)
captiveBackend.PrepareRange(ctx, ledgerRange)
err := captiveBackend.PrepareRange(ctx, ledgerRange)
assert.NoError(t, err)

var wg sync.WaitGroup
wg.Add(1)
Expand All @@ -695,13 +696,16 @@ func TestGetLatestLedgerSequenceRaceCondition(t *testing.T) {
case <-ctx.Done():
return
default:
captiveBackend.GetLatestLedgerSequence(ctx)
_, err = captiveBackend.GetLatestLedgerSequence(ctx)
assert.NoError(t, err)
}
}
}(ctx)

for i := fromSeq; i < toSeq; i++ {
captiveBackend.GetLedger(ctx, uint32(i))
_, err = captiveBackend.GetLedger(ctx, i)
assert.NoError(t, err)

}

cancel()
Expand Down

0 comments on commit a72f84b

Please sign in to comment.