Skip to content

Commit

Permalink
Merge pull request #3287 from oasisprotocol/ptrus/fix/consensus-test
Browse files Browse the repository at this point in the history
go/consensus/tests: Use same height when comparing GetTransations results
  • Loading branch information
ptrus authored Sep 18, 2020
2 parents d1348d9 + 5b8761e commit e2edc04
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 e2edc04

Please sign in to comment.