Repository navigation
test(gateway): isolate scheduled service timers - #119218
Conversation
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
eea0920 to
9ec1771
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 9:06 AM ET / 13:06 UTC. ClawSweeper reviewWhat this changesAdds fake timers to two Gateway scheduler-warning tests so their background recovery timers cannot affect later assertions. Regression provenancePossible regression — probable (failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep open. This is a focused, source-backed test-isolation repair for a real shared-worker timer leak; no blocking finding was identified. Priority: P3 Review scores
Verification
How this fits togetherGateway startup activates heartbeat, cron, and delivery-recovery services after sidecars are ready. The affected tests invoke that activation path to check warnings, while later cases advance the same scheduler timers. flowchart LR
A[Gateway startup] --> B[Scheduled services]
B --> C[Recovery timeout and retry interval]
C --> D[Warning-only tests]
D --> E[Shared test worker]
E --> F[Later timer assertions]
G[Fake timers] --> D
Before merge
Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Merge the two test-local fake-timer calls, preserving the existing suite-level real-timer teardown and leaving Gateway runtime behavior unchanged. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the non-isolated Gateway shard runs two real-timer activation tests before a later case advances the same 1,250 ms recovery path. Is this the best way to solve the issue? Yes. Fake timers at the two tests that create and discard scheduler handles match the established suite pattern and are narrower than changing production lifecycle behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b4f01afa861b. 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.
|
* origin/main: (208 commits) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) ...
* origin/main: (23 commits) chore(tui): add Gateway boundary PTY coverage (#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) ...
* origin/main: chore(tui): add Gateway boundary PTY coverage (#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121)
…time * origin/main: (177 commits) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) ...
* origin/main: (23 commits) chore(tui): add Gateway boundary PTY coverage (openclaw#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (openclaw#119218) test(qa): cover Canvas agent and node controls (openclaw#119047) fix(cli): avoid repeated migration scans during local agent turns (openclaw#119051) fix(gateway): keep agents list on prepared model facts (openclaw#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (openclaw#119121) fix(qqbot): keep channel API calls on the active account [AI] (openclaw#118575) fix(agents): recover from invalid compaction summaries (openclaw#119137) fix(gateway): expose OAuth-backed tools to CLI agents (openclaw#119166) fix(plugins): preserve metadata reloads during models status (openclaw#119183) fix(test): bound direct gateway server runs (openclaw#119184) test(tui): prove command surfaces through PTY (openclaw#119165) fix(testbox): restore claims across path aliases (openclaw#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (openclaw#119164) fix(testbox): remove changed-gate sync residue (openclaw#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (openclaw#118998) ...
What Problem This Solves
Resolves a release-validation failure where the full Gateway server test shard could wait about 62 seconds and then fail because warning-only tests leaked scheduled recovery timers into a later timer assertion.
Why This Change Was Made
The two warning-only cases now use fake timers, matching the rest of the timer-sensitive suite. This keeps their background scheduler handles test-local without changing Gateway runtime behavior.
User Impact
No product runtime behavior changes. Maintainers get deterministic release and CI proof for the Gateway server shard under load.
Evidence
origin/mainTestbox run failedserver-runtime-services > activates heartbeat, cron, and delivery recovery after sidecars are readyafter 62 seconds becauseschedulePendingSessionDeliverieswas called 3 times instead of 1: https://github.com/openclaw/openclaw/actions/runs/30907007898vitest.gateway-server.config.tslane passed all four processes, 2670/2670 tests, on Testbox.src/gateway/server-runtime-services.test.ts, 28/28 tests.