test: stabilize management discovery cancellation coverage - #274
Conversation
📝 WalkthroughWalkthroughThe bundled validator fixture updates generated-source formatting and optional-property parsing. The runtime fixture adds a configurable ChangesBundled parser fixture
Discovery cancellation timing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/mcp-wrapper.test.ts`:
- Around line 2127-2144: Update the test around client.callTool and
toolListStarted.wait to attach an immediate fulfillment/rejection handler to
pending, race that observation with the start-marker wait, and fail the test if
pending settles before startedPath is reached; preserve the existing
cancellation assertion after the marker is observed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c98ed49a-8310-4f1c-846b-1c5f8b3b9423
📒 Files selected for processing (3)
tests/fixtures/fake-upstream-bundled.mjstests/fixtures/fake-upstream-runtime.mjstests/mcp-wrapper.test.ts
|
Review follow-up: |
|
Review record: CodeRabbit's current check explicitly reports I completed a manual diff review of |
Dismissed because the sole actionable thread was resolved in a73f0f8, while the current-head CodeRabbit status explicitly reports Review rate limited. The approved local-review fallback attempt and manual review record are documented on this PR.
Fixes #267.
Root cause
The cancellation regression waited with Vitest's default
expect.polldeadline, even though the assertion was only meant to establish that the actual management discovery request had started. Under full coverage, that implicit one-second deadline could expire before the upstream fixture reached its tool-discovery marker.Change
No production timeout, policy, containment, or coverage threshold changed.
Validation
npm test -- --reporter=dotnpm run test:coverage -- --reporter=dotnpm run test:core -- --reporter=dotnpm run lintnpm run typechecknpm run buildnpm run smoke:clinpm run check:packnpm run test:package -- --reporter=dotnpm run check:test-fixtureSummary by CodeRabbit
Bug Fixes
Tests