← Back to PRs

#12575: test: stabilize warning-filter by asserting process warning event

by shojikumaru open 2026-02-09 10:27 View on GitHub →
docs app: web-ui stale
## What Stabilize warning-filter tests by asserting via the Node `process` `warning` event rather than spying on `process.stderr.write`. ## Why Spying on stderr output is brittle across Node/Vitest behavior; the `warning` event is the semantic signal we actually care about. ## How - Collect warnings via `process.on("warning", handler)` - Assert known suppressed warnings produce 0 warnings - Assert an unknown warning produces >= 1 warning - Cleanup handler in `finally` ## Verification - `pnpm test -- --run src/infra/warning-filter.test.ts` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Changes span two areas: - **Tests**: `src/infra/warning-filter.test.ts` now asserts behavior via Node’s `process.on('warning')` event instead of spying on `process.stderr.write`, making the test less sensitive to Node/Vitest output behavior. - **Control UI gateway connection flow**: Adds a connection “gate” overlay and richer reconnect behavior. `GatewayBrowserClient` now supports backoff with jitter, a `reconnectNow()` API, enable/disable reconnects, and an `onReconnectScheduled` callback. `connectGateway()` records close diagnostics (without logging arbitrary close reasons), categorizes certain 1008 policy closes as `PAIRING_REQUIRED`, and introduces page lifecycle listeners (visibility/network) to drive reconnection. Main issues to address before merge are around UI lifecycle cleanup and state handling for the new reconnect/connection gate logic (see inline comments). <h3>Confidence Score: 3/5</h3> - This PR is close to mergeable, but UI lifecycle/state issues could cause incorrect behavior in real usage. - The warning-filter test change is straightforward and improves stability. The larger UI reconnection work introduces new global event listeners and state transitions that appear to lack teardown and may reset retry state unexpectedly, which can lead to duplicated reconnect triggers and confusing retry UX over time. - ui/src/ui/app-gateway.ts, ui/src/ui/gateway.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs