Browse Source

e2e: avoid non-determinism in app hash check (#6985)

pull/6991/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
c909f8a236
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      test/e2e/tests/app_test.go

+ 8
- 6
test/e2e/tests/app_test.go View File

@ -44,15 +44,17 @@ func TestApp_Hash(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.NotEmpty(t, info.Response.LastBlockAppHash, "expected app to return app hash") require.NotEmpty(t, info.Response.LastBlockAppHash, "expected app to return app hash")
block, err := client.Block(ctx, nil)
status, err := client.Status(ctx)
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, info.Response.LastBlockAppHash, block.Block.AppHash.Bytes(),
"app hash does not match last block's app hash")
if info.Response.LastBlockHeight == status.SyncInfo.LatestBlockHeight {
require.EqualValues(t, info.Response.LastBlockAppHash, status.SyncInfo.LatestAppHash,
"app hash does not match node status")
}
status, err := client.Status(ctx)
block, err := client.Block(ctx, &info.Response.LastBlockHeight)
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, info.Response.LastBlockAppHash, status.SyncInfo.LatestAppHash,
"app hash does not match node status")
require.EqualValues(t, info.Response.LastBlockAppHash, block.Block.AppHash.Bytes(),
"app hash does not match last block's app hash")
}) })
} }


Loading…
Cancel
Save