Fix flaky SnapServerTest.assertAccountLimitRangeResponse#10189
Merged
daniellehrner merged 4 commits intobesu-eth:mainfrom Apr 7, 2026
Merged
Fix flaky SnapServerTest.assertAccountLimitRangeResponse#10189daniellehrner merged 4 commits intobesu-eth:mainfrom
daniellehrner merged 4 commits intobesu-eth:mainfrom
Conversation
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Makes SnapServer’s per-request time limit configurable (for tests) to eliminate flakiness in SnapServerTest.assertAccountLimitRangeResponse, especially on slower/loaded machines.
Changes:
- Add a
maxMillisPerRequestfield and thread it through snap response size/time limiting logic. - Introduce a
@VisibleForTestingSnapServer constructor to override the default time limit. - Update
SnapServerTestto effectively disable the time limit by passingLong.MAX_VALUE.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java | Uses the new testing constructor to avoid time-based truncation in the flaky test. |
| ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServer.java | Makes the max per-request time configurable and replaces the previous hard-coded 4s limit usage. |
ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java
Show resolved
Hide resolved
ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/snap/SnapServerTest.java
Outdated
Show resolved
Hide resolved
garyschulte
approved these changes
Apr 6, 2026
Contributor
garyschulte
left a comment
There was a problem hiding this comment.
This LGTM. Copilot did find a pre-existing duplicate SnapServer.start() call that we can clean up in this PR, but changes LGTM.
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR description
SnapServerTestassertAccountLimitRangeResponseis flaky (especially in ARCHIVE mode) because ResponseSizePredicate has a hard-coded 4 second time limit that could fire before the byte-size limit on slow/loaded machines, returning fewer accounts than expected. To fix that this PR makes the time limit configurable via a new@VisibleForTestingconstructor onSnapServer, so the test can effectively disable it by setting it toLong.MAX_VALUE.Fixed Issue(s)
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests