test(core): add COV-04 unit test for channel-close in run_scheduler_loop#1768
Merged
test(core): add COV-04 unit test for channel-close in run_scheduler_loop#1768
Conversation
Add a #[tokio::test] that verifies run_scheduler_loop() returns GraphStatus::Failed when the channel is closed (recv() returns Ok(None)). Fix the channel-close arm in run_scheduler_loop() to return Failed instead of Canceled: channel close is an error condition (unexpected loss of the input source), not a user-initiated cancel. Done actions from cancel_all() are now intentionally ignored in this arm so the fallback always exits with Failed. Closes #1614
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
scheduler_loop_channel_close_returns_failedtest (COV-04) that verifiesrun_scheduler_loop()returnsGraphStatus::Failedwhen the channel is closed (recv()returnsOk(None))run_scheduler_loop()to returnFailedinstead ofCanceled: channel close is an error condition (unexpected loss of input), not a user-initiated cancel —Doneactions fromcancel_all()are now intentionally ignored in this armOk(None)→Failedexit pathCloses #1614
Test plan
cargo nextest run -p zeph-core -E 'test(scheduler_loop_channel_close_returns_failed)'passescargo nextest run -p zeph-core -E 'test(plan_cancel_during_scheduler_loop_cancels_plan)'still returnsCanceled(no regression)cargo nextest run --workspace --features full --lib --bins— all 5544 tests pass