Repository navigation
test(msteams): cover occupied webhook port - #120158
Conversation
Punchcard-Session: silver-willow-harbor-px
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 1:42 AM ET / 05:42 UTC. ClawSweeper reviewWhat this changesAdds a real occupied-port regression test for Microsoft Teams webhook startup, checking rejection, ingress cleanup, and absence of HTTP keep-alive handoff. Merge readinessKeep open. This maintainer-owned test-only PR restores valid boundary coverage that the merged refactor intentionally removed only because its prior Express mock contract was invalid; the new test exercises the real listener failure path without changing runtime behavior. Priority: P3 Review scores
Verification
How this fits togetherThe Microsoft Teams plugin starts a webhook HTTP listener while bringing a channel account online. The monitor owns listener startup and cleanup, while the gateway records a failed startup as an account error. flowchart LR
A[Teams configuration] --> B[Channel monitor]
B --> C[Webhook listener]
C --> D{Port available?}
D -->|Yes| E[Keep server alive]
D -->|No| F[Stop ingress and reject]
F --> G[Gateway records account error]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +36. Total +36 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the focused real-listener regression test once the exact head has completed the normal maintainer review and required checks. Do we have a high-confidence way to reproduce the issue? Not applicable as a user-reported issue; source inspection establishes the test's occupied-port path, and the PR supplies focused runtime evidence for it. Is this the best way to solve the issue? Yes. A real TCP blocker reaches the existing listener owner, unlike the removed mock contract; changing production status behavior would exceed this test-only repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a0deb8edae1a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…cope * origin/main: fix(qa): bound Matrix scenario preparation separately (#119996) test(msteams): cover occupied webhook port (#120158) fix(agents): clear btw attribution reservations fix(agents): reserve execution attribution atomically fix(agents): reject attribution collisions before capture fix(agents): reject CLI attribution collisions fix(agents): reject private attribution recovery by run id fix(agents): restore runtime check cleanliness fix(agents): refresh rebound run admission time refactor(agents): propagate exact attribution across runtimes fix(release): provide prerelease plugin companions to package QA (#120107) test(macos): stabilize gateway session negotiation tests (#120141) refactor(test): replace logic-bearing vi.mock factories with boundary fakes, batch 2 (#120117) # Conflicts: # src/agents/command/attempt-execution.ts
Punchcard-Session: silver-willow-harbor-px
Related: #120145
Related: #120117
What Problem This Solves
Restores real boundary coverage for Microsoft Teams webhook startup when the configured port is already occupied. PR #120117 correctly removed a test that proved an invented Express mock contract, but the working Express 5.2.1 startup path no longer had a regression test.
Why This Change Was Made
This AI-assisted test binds a real Node HTTP server to an ephemeral port using the same unspecified-host mode as production, starts the real Microsoft Teams monitor on that assigned port, and verifies the existing startup owner rejects with
EADDRINUSE, starts then stops ingress exactly once, and never enters the HTTP keep-alive phase. The blocking server is always closed infinally.No production, config, SDK, dependency, or public-contract code changes.
User Impact
No runtime behavior changes. The test now protects the existing operator-visible startup failure path from regressing back to a silent or hanging listener failure.
Evidence
EADDRINUSE.lib/application.jswraps the callback once, registers it on the server's startuperrorevent, then delegates toserver.listen; the installed Express types declare the callback as(error?: Error) => void.monitor.lifecycle.test.tssuite: 16/16 passed.git diff --check: passed.Production LOC: +0/-0. Test LOC: +37/-1.