Repository navigation
perf(amber): exit TrivialControlSpec receiveWhile early - #4506
Merged
Merged
Conversation
testControl used probe.receiveWhile(5.minutes, 10.seconds) with a catch-all `case other => skip`. The partial function always matched, so the loop only ever exited via the 10s idle timeout — every test sat idle for ~10s after collecting all expected returns. With 8 tests in the spec, that was ~80s of pure waiting. Replace receiveWhile with a manual loop that exits as soon as flag == expectedValues.length. Local timing: 1m 11s → 1s. Closes apache#4505
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
### What changes were proposed in this PR? `TrivialControlSpec.testControl` used `probe.receiveWhile(5.minutes, 10.seconds)` with a catch-all `case other => skip`. Because the partial function always matched, `receiveWhile` could only exit via the 10s idle timeout — so every test sat idle for ~10s after collecting all expected returns. With 8 tests, that was ~80s of pure waiting. Replace `receiveWhile` with a manual loop that exits as soon as `flag == expectedValues.length`. Behavior preserved: same per-message handling, same per-call 10s timeout (now via `receiveOne`), still throws `AssertionError` on timeout or wrong return values. ### Any related issues, documentation, discussions? Closes apache#4505 ### How was this PR tested? Existing 8 tests in `TrivialControlSpec` all pass locally. Measured locally on the same worktree with a fresh sbt session: | | `Run completed in` | |---|---| | before | 1 minute, 11 seconds | | after | 1 second, 16 milliseconds | ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.7)
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.
What changes were proposed in this PR?
TrivialControlSpec.testControlusedprobe.receiveWhile(5.minutes, 10.seconds)with a catch-allcase other => skip. Because the partial function always matched,receiveWhilecould only exit via the 10s idle timeout — so every test sat idle for ~10s after collecting all expected returns. With 8 tests, that was ~80s of pure waiting.Replace
receiveWhilewith a manual loop that exits as soon asflag == expectedValues.length. Behavior preserved: same per-message handling, same per-call 10s timeout (now viareceiveOne), still throwsAssertionErroron timeout or wrong return values.Any related issues, documentation, discussions?
Closes #4505
How was this PR tested?
Existing 8 tests in
TrivialControlSpecall pass locally. Measured locally on the same worktree with a fresh sbt session:Run completed inWas this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.7)