Repository navigation
fix(test): stop Google batch timeout test leaking requests - #116161
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 10:09 PM ET / July 30, 2026, 02:09 UTC. ClawSweeper reviewWhat this changesThe PR changes the Google embedding-batch timeout test to capture its timeout rejection before cleanup, restore real timers after every test, and verify that no status-poll request starts after the absolute deadline. Merge readinessThis is a narrow, test-only repair that appears to correctly prevent the Google batch timeout test from leaving a promise running after mock cleanup. It has no identified patch defect, but the Priority: P3 Review scores
Verification
How this fits togetherThe Google extension batches embedding requests and polls Google batch status until completion or a deadline. This test uses mocked network calls and fake time to verify that the batch owner terminates at its own deadline without allowing cleanup to expose a still-running request to the real network. flowchart LR
A[Embedding batch test] --> B[Fake clock and mocked Google API]
B --> C[Google batch runner]
C --> D{Batch deadline reached?}
D -->|Yes| E[Observed timeout rejection]
E --> F[No status poll request]
F --> G[Restore timers and mocks]
Decision needed
Why: The PR is authored by a repository MEMBER and carries the protected Before merge
Agent review detailsSecurityNone. PR surfaceTests -6. Total -6 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the owner-level timeout assertion and explicit timer cleanup, then merge only after a maintainer confirms the refreshed branch still validates against current Do we have a high-confidence way to reproduce the issue? Yes, at source level: the supplied current-main path uses fake timers and mocked fetches, then allows a pending batch promise to outlive mock cleanup; the PR body reports the resulting real-request rejection and focused after-fix runs. Is this the best way to solve the issue? Yes. Observing the owner promise before cleanup and restoring timers centrally is narrower and more maintainable than reproducing the shared polling helper’s timer internals in this Google-owned test. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 82af1bf7d403. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
11ed36b to
7113130
Compare
7113130 to
959bf7b
Compare
|
Rank-up move reviewed: I am not rebasing again because current main drift is limited to the cron service and cron protocol files from #115779; it does not overlap this Google test-only patch or merge-critical infrastructure. The exact PR head has a green openclaw/ci-gate, and scripts/pr merge-run will re-verify drift before landing. |
|
Merged via squash.
|
* origin/main: fix(macos): stop canceled voice wake timers (openclaw#116189) fix(macos): coalesce location permission requests (openclaw#116183) fix(macos): guard remote tunnel restart ownership (openclaw#116172) fix(agents): throw CompactionError when summarization fails (openclaw#115500) fix(test): isolate ACP startup output stream (openclaw#116076) fix(agents): deny all tools when scheduled authority names a removed account (openclaw#115932) fix(test): stop collecting Vydra test helpers (openclaw#116139) fix(discord): preserve webhook deadline errors (openclaw#116155) fix(test): isolate Google embedding batch timeout (openclaw#116161) fix(cron): stop replaying old schedule slots after a cron job is edited (openclaw#115779) fix(plugins): report request timeouts for stalled response bodies (openclaw#116166)
What Problem This Solves
Resolves a problem where the Google embedding-batch timeout test failed after HTTP deadline timers were added, then left its batch promise running after mocks were restored. The orphaned request reached the real Google API with the test key and produced an unhandled rejection.
Why This Change Was Made
The Google-owned test now verifies the owner behavior at the absolute batch deadline instead of duplicating the shared poll-helper timer implementation. It observes the batch promise immediately and restores real timers after every test.
User Impact
No runtime behavior changes. The provider test suite no longer leaks a real network request or reports a false timeout failure.
Evidence
main: 1 failed test plus an unhandledProviderHttpErrorfrom the real Google API.node scripts/run-vitest.mjs extensions/google/embedding-batch.test.tspassed: 1 file, 20 tests../node_modules/.bin/oxfmt --check extensions/google/embedding-batch.test.tspassed.git diff --check origin/main...HEADpassed.AI-assisted: yes. I understand and verified the change.