Skip to content

test(core): add COV-04 unit test for channel-close in run_scheduler_loop#1768

Merged
bug-ops merged 2 commits intomainfrom
test-add-unit-test-for-channel
Mar 14, 2026
Merged

test(core): add COV-04 unit test for channel-close in run_scheduler_loop#1768
bug-ops merged 2 commits intomainfrom
test-add-unit-test-for-channel

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 14, 2026

Summary

  • Add scheduler_loop_channel_close_returns_failed test (COV-04) that verifies run_scheduler_loop() returns GraphStatus::Failed when the channel is closed (recv() returns Ok(None))
  • Fix channel-close arm in run_scheduler_loop() to return Failed instead of Canceled: channel close is an error condition (unexpected loss of input), not a user-initiated cancel — Done actions from cancel_all() are now intentionally ignored in this arm
  • Add doc comment clarifying the Ok(None)Failed exit path

Closes #1614

Test plan

  • cargo nextest run -p zeph-core -E 'test(scheduler_loop_channel_close_returns_failed)' passes
  • cargo nextest run -p zeph-core -E 'test(plan_cancel_during_scheduler_loop_cancels_plan)' still returns Canceled (no regression)
  • cargo nextest run --workspace --features full --lib --bins — all 5544 tests pass

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
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate tests Test-related changes size/M Medium PR (51-200 lines) labels Mar 14, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 18:23
@github-actions github-actions bot added tests Test-related changes and removed tests Test-related changes labels Mar 14, 2026
@bug-ops bug-ops merged commit c579c4a into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the test-add-unit-test-for-channel branch March 14, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add unit test for channel-close → GraphStatus::Failed transition in run_scheduler_loop

1 participant