test: cover Election.clear pending consensus reset - #407
Conversation
|
This is pretty interesting, and I'm honestly impressed that you identified this gap and opened the issue/PR yourself. I'm happy to merge it. That said, this isn't exactly how I usually approach testing. So I do see the value in this test and I'm happy to have it. Just keep in mind that I don't generally aim for exhaustive unit coverage. I prefer adding focused tests when the risk or likelihood of regression justifies them. |
|
Thank you for your contribution! 🎉 This PR is eligible for an contribution-tweak reward as a token of our appreciation. If you'd like to receive it, please add your address to the description of this PR. 🙏 |
|
Thank you for your contribution! 🎉 This PR is eligible for an contribution-tweak reward as a token of our appreciation and will be sent to |
|
The contribution-tweak reward was sent to |
Summary
Election.clear()resetting pending consensus stateclear()Closes #406
Verification
Passed locally with Temurin OpenJDK 25.0.4.1 and Gradle 9.7.1:
./gradlew test --tests 'cash.atto.node.election.ElectionTest.should clear pending consensus state' --rerun-tasks --offline --no-daemon --console=plain --stacktrace --no-scan— 1 test, 0 failures./gradlew test --tests 'cash.atto.node.election.ElectionTest' --rerun-tasks --offline --no-daemon --console=plain --stacktrace --no-scan— 13 tests, 0 failuresA full
./gradlew test --rerun-tasks --offline --no-daemon --console=plain --stacktrace --no-scan --fail-fastrun was also attempted. It stopped in the first Cucumber bootstrap suite because Testcontainers could not find a Docker environment (/var/run/docker.sockwas unavailable): 3 bootstrap feature failures and 1 skipped test. The remaining full suite was therefore not executed locally.The focused test had previously been sensitivity-checked against a controlled copy differing only by removal of
pendingConsensus.clear(); that focused run failed because transaction B did not publishElectionStarted. This is regression-test sensitivity evidence, not a production-defect or correctness claim.Scope
atto://abn2pmx6dc2e43vi5zaatuhor4j6qioztqcdr2vgxivxtcw3vbgwsrztx5rtc