Yicong-Huang commented on code in PR #4687:
URL: https://github.com/apache/texera/pull/4687#discussion_r3177837569
##########
amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/CheckpointSpec.scala:
##########
@@ -85,6 +85,15 @@ class CheckpointSpec extends AnyFlatSpecLike with
BeforeAndAfterAll {
chkpt.save(DP_STATE_KEY, dp)
}
+ "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"))
Review Comment:
Tightened in 07c2eadc61: replaced
`assert(ex.getMessage.contains("unknown"))` with `assert(ex.getMessage == "no
state saved for key = unknown")`. The exact contract `RuntimeException("no
state saved for key = $key")` is now pinned, and a future drift to a different
message (e.g. "unknown checkpoint") would no longer satisfy the assertion.
--
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]