Copilot commented on code in PR #4687:
URL: https://github.com/apache/texera/pull/4687#discussion_r3177833369


##########
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:
   This test currently only asserts the exception message contains the key, 
which doesn’t fully pin the documented contract that `CheckpointState.load` 
throws `RuntimeException("no state saved for key = $key")` on a missing key. 
Consider asserting the full message (or at least the expected prefix plus the 
key) so a future change to a different error message doesn’t still satisfy 
`contains("unknown")` and silently weaken the contract being tested.
   



-- 
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]

Reply via email to