test(amber): add unit test coverage for EmptyReplayLogManagerImpl#4790
Merged
Yicong-Huang merged 3 commits intoMay 3, 2026
Merged
Conversation
Add EmptyReplayLogManagerImplSpec covering the no-op replay-log manager used when fault tolerance is disabled: initial step is INIT_STEP, setupWriter/markAsReplayDestination/terminate are no-ops, sendCommitted forwards to the handler, and the inherited withFaultTolerant advances the step counter (including on exception). Closes apache#4789 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ScalaTest unit coverage for EmptyReplayLogManagerImpl, the no-op replay-log manager used when fault tolerance is disabled, including verification of inherited ReplayLogManager.withFaultTolerant step bookkeeping behavior.
Changes:
- Introduces
EmptyReplayLogManagerImplSpecto validate initial cursor step and that no-op lifecycle methods don’t affect observable state. - Adds coverage that
sendCommittedforwards committed messages to the configured handler. - Adds coverage that
withFaultTolerantincrements the processing step both on success and when the body throws (rethrowing the exception).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4790 +/- ##
============================================
+ Coverage 43.19% 43.21% +0.01%
- Complexity 2035 2037 +2
============================================
Files 957 957
Lines 34077 34077
Branches 3753 3753
============================================
+ Hits 14721 14727 +6
+ Misses 18580 18576 -4
+ Partials 776 774 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Use real fixtures (an `EmptyRecordStorage` writer and an
`EmbeddedControlMessageIdentity("test")`) instead of `null` when
exercising `setupWriter` / `markAsReplayDestination`, so the test
reflects realistic call sites.
- Express step assertions relative to `ProcessingStepCursor.INIT_STEP`
(`+1`, `+2`) instead of hardcoded `0L` / `1L`, so the spec stays
correct if the initial-step constant ever changes.
- Use `{}` block syntax for empty `withFaultTolerant` bodies.
- Apply scalafmt.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Yicong-Huang
approved these changes
May 3, 2026
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?
Add
EmptyReplayLogManagerImplSpeccovering the no-op replay-log manager and the inheritedwithFaultTolerantbookkeeping:getStepstarts atINIT_STEPsetupWriter/markAsReplayDestination/terminateare no-ops (exercised with real fixtures —EmptyRecordStorage[ReplayLogRecord]().getWriter("x")andEmbeddedControlMessageIdentity("test")— instead ofnull)sendCommittedforwards the message to the configured handlerwithFaultTolerantadvances the step counter (INIT_STEP + 1, thenINIT_STEP + 2) after the body runswithFaultTolerantadvances the step counter and rethrows when the body throwsAny related issues, documentation, discussions?
Closes #4789
How was this PR tested?
sbt "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.logreplay.EmptyReplayLogManagerImplSpec"— 5/5 tests pass.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7)