Yicong-Huang opened a new pull request, #4687:
URL: https://github.com/apache/texera/pull/4687
### What changes were proposed in this PR?
Add a single negative-case unit test to `CheckpointSpec` for
`CheckpointState.load`.
```scala
"CheckpointState" should "fail loudly on an unknown key" in {
val chkpt = new CheckpointState()
assert(!chkpt.has("unknown"))
val ex = intercept[RuntimeException] {
chkpt.load[Any]("unknown")
}
assert(ex.getMessage.contains("unknown"))
}
```
The contract — `load` throws `RuntimeException("no state saved for key =
$key")` on a missing key — has always been there but was untested. Replay
rehydration in `Controller.loadFromCheckpoint` and
`WorkflowWorker.loadFromCheckpoint` rely on this loud failure (rather than
silent `null`) so the calling actor knows to fail fast. Pinning the contract
with a test keeps that behavior from being refactored away accidentally.
This change is the small leftover from a longer attempt at restoring
`ControllerSpec` coverage. The bigger gap — `ControllerProcessor` save → load
round-trip throws Kryo `NullPointerException` on
`StatisticsManager.inputStatistics` — is tracked separately in #4686.
### Any related issues, documentation, discussions?
Related: #4686 (ControllerProcessor round-trip NPE).
### How was this PR tested?
```
sbt 'WorkflowExecutionService / Test / testOnly
org.apache.texera.amber.engine.faulttolerance.CheckpointSpec'
```
3 tests pass (the two existing serializability tests plus the new negative
test).
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.7, 1M context)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]