Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(consensus): fix flaky TestEmitNewValidBlockEventOnCommitWithoutBlock #772

Merged

Conversation

lklimek
Copy link
Collaborator

@lklimek lklimek commented Apr 3, 2024

Issue being fixed or feature implemented

TestEmitNewValidBlockEventOnCommitWithoutBlock is flaky.

In the tested scenario, Tenderdash changes round step to Precommit, and then quickly advances to ApplyCommit step.

{"level":"debug","module":"consensus","module":"consensus","message":"updating state data step to Precommit on EnterPrecommitAction"}
{"level":"debug","module":"consensus","module":"consensus","commit_round":1,"new_height":1,"height":1,"round":1,"step":6,"message":"entering commit step"}
{"level":"debug","module":"consensus","module":"consensus","commit":"8E4B2F2E5D2E168704B334B47F2FE394F1674E181A79E79FDA50AC03AC08618D","proposal":"","message":"commit is for a block we do not know about; set ProposalBlock=nil"}
{"level":"debug","module":"consensus","module":"consensus","message":"updating state data step to ApplyCommit on EnterCommitAction"}

This makes the test flaky, as time between these steps is too small to reliably check assertions in the test.

What was done?

Accept both steps as part of the test.

How Has This Been Tested?

go test -count 1000 ./internal/consensus/ -run TestEmitNewValidBlockEventOnCommitWithoutBlock -test.v 

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Copy link
Member

@shumkov shumkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lklimek lklimek merged commit 53ec39b into v0.14-dev Apr 4, 2024
15 checks passed
@lklimek lklimek deleted the test/flaky-TestEmitNewValidBlockEventOnCommitWithoutBlock branch April 4, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants