test(runtimed): add coverage for kernel restart/death execution cleanup#1656
Merged
test(runtimed): add coverage for kernel restart/death execution cleanup#1656
Conversation
Add unit tests for KernelState::kernel_died() (return values, idempotency, empty queue) and integration tests for handle_queue_command(KernelDied) verifying that RuntimeStateDoc marks in-flight executions as failed. Introduces a MockKernel implementing KernelConnection for testing queue logic without ZeroMQ, as envisioned by the trait's design doc.
…_propagation Fixes a race condition in the integration test where client2 was asserting the presence of 3 cells immediately after joining, without waiting for Automerge sync to propagate from client1. In CI's slower environment, this caused an assertion failure (expected 3, got 0). The fix adds a polling loop (similar to the one already present later in the same test) to wait for sync convergence before asserting cell count. This is not related to the new kernel_state/runtime_agent tests in this PR, but rather a pre-existing flaky test that happened to fail in this CI run. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Adds automated test coverage for the kernel restart and kernel death execution cleanup paths fixed in #1655. The Codex review noted that these code paths lacked targeted tests — the manual verification scenarios were the only coverage.
MockKernelimplementingKernelConnectionfor testing queue/state logic without ZeroMQ (as envisioned by the trait's doc comment)KernelStateunit tests:kernel_died()return values, idempotency, and empty queue edge case;reset()state clearinghandle_queue_command(KernelDied)integration tests verifying RuntimeStateDoc marks in-flight and queued executions aserrorwithsuccess: falseVerification
cargo test -p runtimed -- kernel_state::tests runtime_agent::tests)runtimedintegration testsPR submitted by @rgbkrk's agent, Quill