Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Nov 19, 2024
1 parent 7bb8248 commit 0566760
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/solana/logpoller/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ func TestEncodedLogCollector_BackfillForAddress(t *testing.T) {
_, _ = rand.Read(sigs[idx][:])
}

// GetLatestBlockhash might be called at start-up; make it take some time because the result isn't needed for this test
client.EXPECT().GetLatestBlockhash(mock.Anything, mock.Anything).Return(&rpc.GetLatestBlockhashResult{
RPCContext: rpc.RPCContext{
Context: rpc.Context{
Slot: slots[0],
},
},
Value: &rpc.LatestBlockhashResult{
LastValidBlockHeight: 42,
},
}, nil).After(2 * time.Second).Maybe()

client.EXPECT().
GetSignaturesForAddressWithOpts(mock.Anything, pubKey, mock.MatchedBy(func(opts *rpc.GetSignaturesForAddressOpts) bool {
return opts != nil && opts.Before.String() == solana.Signature{}.String()
Expand Down

0 comments on commit 0566760

Please sign in to comment.