Skip to content

Commit

Permalink
go/consensus/tests: Use same height when comparing GetTransations res…
Browse files Browse the repository at this point in the history
…ults
  • Loading branch information
ptrus committed Sep 18, 2020
1 parent d1348d9 commit d89fa05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .changelog/3287.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
go/consensus/tests: Use explicit latest height when comparing query results

Fixes flakiness in the test that occurred when a different height was used
for the `GetTransactions` and `GetTransactionsWithResults` queries.
4 changes: 2 additions & 2 deletions go/consensus/tests/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ func ConsensusImplementationTests(t *testing.T, backend consensus.ClientBackend)
require.EqualValues(blk.Hash, status.LatestHash, "latest block hashes should match")
require.EqualValues(blk.StateRoot, status.LatestStateRoot, "latest state roots should match")

txs, err := backend.GetTransactions(ctx, consensus.HeightLatest)
txs, err := backend.GetTransactions(ctx, status.LatestHeight)
require.NoError(err, "GetTransactions")

txsWithResults, err := backend.GetTransactionsWithResults(ctx, consensus.HeightLatest)
txsWithResults, err := backend.GetTransactionsWithResults(ctx, status.LatestHeight)
require.NoError(err, "GetTransactionsWithResults")
require.Len(
txsWithResults.Transactions,
Expand Down

0 comments on commit d89fa05

Please sign in to comment.