← Back to PRs

#17934: fix: macOS CI hangs for 2+ hours due to unhandled SSE stream errors

by MisterGuy420 open 2026-02-16 09:41 View on GitHub →
channel: whatsapp-web stale size: XS trusted-contributor
## Summary Fixes macOS CI hangs in web monitor inbox test suites by: 1. Setting NODE_OPTIONS="--dns-result-order=ipv4first" in macOS CI workflow 2. Adding proper teardown in afterEach/afterAll hooks to destroy SSE streams and close mock servers ## Changes - Added dns-result-order=ipv4first to macOS CI workflow - Added proper cleanup for event listeners in test harness afterEach hook ## Testing Tests should fail fast on network errors instead of hanging indefinitely. Fixes openclaw/openclaw#17911 <!-- greptile_comment --> <h3>Greptile Summary</h3> Added `--dns-result-order=ipv4first` to macOS CI workflow and proper event listener cleanup in test harness to fix 2+ hour CI hangs. - Added DNS IPv4-first resolution to macOS CI `NODE_OPTIONS` to fix localhost resolution mismatches - Added `sock.ev.removeAllListeners()` in `afterEach` hook to properly clean up event listeners from the shared mock socket instance The fix addresses the root cause: the test harness shares a single `sock` object (created at module level on line 69) across all tests. Without cleanup, event listeners accumulate and prevent Vitest from detecting test completion, causing indefinite hangs. The `removeAllListeners()` call ensures each test starts with a clean slate. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are well-targeted fixes for a specific CI hang issue. The DNS resolution flag is a standard Node.js option for handling IPv6/IPv4 priority, and the event listener cleanup is a proper test hygiene practice that prevents resource leaks. Both changes are minimal, non-breaking, and address the root causes identified in the commit message. - No files require special attention <sub>Last reviewed commit: 4e3b8a1</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs