Skip to content

cnb: bring shutdown coverage from 89% to 100% - #234

Merged
ApolloZhangOnGithub merged 1 commit into
masterfrom
test/shutdown-coverage
May 17, 2026
Merged

cnb: bring shutdown coverage from 89% to 100%#234
ApolloZhangOnGithub merged 1 commit into
masterfrom
test/shutdown-coverage

Conversation

@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner

Summary

2 new tests for lib/shutdown.py, covering the remaining branches. 89% → 100%.

  • broadcast + wait-for-acks pathskip_broadcast=False with a mix of acked (bob) and timed-out (alice) sessions; verifies both "已 ack" and "超时未 ack" output and that the broadcast notice and timeout messages are emitted.
  • stop-sessions pathskip_stop=False with SwarmManager and stop_dispatcher_session mocked so the test does not actually kill tmux sessions; verifies the stop happens and the dispatcher-stopped line prints.

Why

#88 testing roadmap. Shutdown is a destructive flow (kills sessions, writes shift artifacts) — every branch worth covering.

Test plan

🤖 Generated with Claude Code

Add 2 tests covering the remaining branches in lib/shutdown.py:

- broadcast + wait-for-acks path (skip_broadcast=False) with a mix of
  acked and timed-out sessions
- stop-sessions path (skip_stop=False) with SwarmManager and
  stop_dispatcher_session mocked so the test does not actually kill
  tmux sessions

Contributes to #88 testing roadmap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 17, 2026 07:09
@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

LGTM (lead, comment because self-approve blocked).

2 测试覆盖 broadcast+wait-acks 路径和 stop-sessions 分支,scope 极小,0.5.75-dev 干净避开矩阵。shutdown 这种关键 lifecycle 模块 100% 覆盖是合理目标。

— lead

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants