Repository navigation
test(synology-chat): remove redundant loopback send waits - #157804
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 9:55 PM ET / September 25, 2026, 01:55 UTC. ClawSweeper reviewWhat this changesThe branch bypasses the Synology send-slot delay in HTTP loopback tests, removes two shallow mocked-send checks, and strengthens recipient and user-lookup assertions. Merge readiness✅ Ready for maintainer review Current main lacks this focused test improvement. The patch removes repeated loopback waits while retaining stronger coverage for send pacing, wire payloads, cache reuse, and malformed users. Priority: P3 Review scores
Verification
How this fits togetherThe Synology Chat plugin turns outbound OpenClaw messages into webhook requests to a NAS. These tests exercise that path through a local HTTP server, while a separate fake-timer test checks send pacing. flowchart LR
A[Outbound messages] --> B[Synology adapters]
B --> C[HTTP client]
C --> D[Send slot]
D --> E[Local webhook server]
E --> F[Wire assertions]
G[Fake timer test] --> D
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -7. Total -7 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the faster HTTP loopback coverage alongside the precise fake-timer pacing test and the explicit malformed-user and cache assertions. Do we have a high-confidence way to reproduce the issue? Not applicable to a product bug. The original repeated send-slot wait is evident in source, and the PR body reports focused before/after measurements. Is this the best way to solve the issue? Yes. The selective sleep mock removes the loopback delay while the surviving fake-timer test enforces pacing and the loopback suite still checks HTTP behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1e8d1b3a1ad4. 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 auto-merge.
|
What Problem This Solves
Synology's real-HTTP loopback tests repeatedly wait for the client’s 500 ms send slot even though the mocked sibling already proves the exact 499/500 ms boundary. The malformed-user test could also pass without exercising rejection of a malformed matching entry.
User Impact
No production behavior changes. The same nine loopback cases retain real requests, retry backoff, deadlines, receipts and cleanup. Two shallow send assertions are removed in favor of their stronger wire-level keepers.
Why This Change Was Made
The loopback file replaces only the SDK
sleepexport used by the send slot;sleepWithAbortand native request timers remain real. The direct-client chunking call now covers numeric recipients, while adapter calls retain string recipients. The malformed-user fixture puts a matching invalid entry first at a fresh endpoint, and the existing cache test explicitly checks A→B→A lookup with only two requests.Evidence
client.ts, with identical statement/function/branch maps and denominators. All originally covered locations remain: 179/195 statements and 36/39 functions; branches increase from 85/115 to 86/115 through malformed-entry rejection. Instrumented timings are not benchmark timings.The initial measurement-controller version check used the wrong working directory and stopped before tests; the corrected invocation used the repository-pinned pnpm 12.4.2 without downloading or upgrading it. An intermediate coverage comparison exposed an accidental cache-hit loss; the explicit cache-reuse keeper corrected it before final proof.
Review setup on the proof host was unavailable; the completed managed review used an exact-byte, review-only mirror with the same source context and isolation controls. No product code ran in that mirror.