[PR #1885] [MERGED] fix(test): wait for Hopper reconnect listener readiness #4876

Closed
opened 2026-10-31 00:56:18 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1885
Author: @N0zoM1z0
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/hopper-reconnect-readiness


📝 Commits (1)

  • 4839cc3 fix(test): wait for the Hopper reconnect listener to become ready

📊 Changes

1 file changed (+17 additions, -6 deletions)

View changed files

📝 tests/fixtures/hopperBridgeReconnectProbe.py (+17 -6)

📄 Description

Summary

The Hopper reconnect boundary test sometimes connects between socket bind() and listen(), failing CI with ConnectionRefusedError. Wait for the listener only on the initial connection; reconnect failures still propagate immediately. This fixes the observed #1857 shard failure. No separate issue is needed for this reproduced test-harness race.

Problem and expected behavior

Socket-path existence proves bind(), not listener readiness. The fixture must tolerate that startup interval without weakening authentication, reconnect, lost-reply, expiry or cleanup assertions.

Change and scope

Only hopperBridgeReconnectProbe.py changes. The first connection retries ConnectionRefusedError for at most two seconds, closing failed sockets. Other connection errors and every subsequent reconnect remain immediate failures.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test-harness initial socket connection.
  • CLI/MCP contracts, provider bridge, Evidence/provenance and package metadata: none.
  • Process/cleanup: failed connection sockets are closed; existing listener and execution-thread cleanup assertions stay intact.
  • Platform: Linux Unix-socket fixture; production bridge code is unchanged.

Evidence and regression coverage

  • Injecting a 150 ms delay between bind and listen deterministically fails the base fixture at its first connection.
  • Fixed fixture passes against both the delayed copy and shipped bridge, preserving all four modes and their exact request sequences, listener removal and thread release.
  • Proof gap: native Hopper dispatch is recorded by the fixture; this does not establish real Hopper GUI behavior.

Validation performed

  • Bounded Python base/fixed failure-injection probes — expected failure before fix; all four modes passed after fix.
  • npm run test:focused -- tests/boundary/providers/hopper/hopperBridgeReconnect.test.ts — passed.
  • Normal pre-commit/pre-push checks — passed.

Compatibility, safety, and release

No public API, package or release metadata changes. This is Linux test-harness verification with simulated native dispatch; no real GUI or other-provider claims.

Review checklist

  • Concrete reproduced CI failure, focused Conventional Commit outcome.
  • Startup tolerance is bounded; meaningful reconnect and cleanup failures stay visible.
  • Final diff checked; no target, credentials, generated output or unrelated cleanup committed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1885 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/hopper-reconnect-readiness` --- ### 📝 Commits (1) - [`4839cc3`](https://github.com/morluto/rea/commit/4839cc3c15c517e0e1200ad5bf3e97e3e83743c1) fix(test): wait for the Hopper reconnect listener to become ready ### 📊 Changes **1 file changed** (+17 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `tests/fixtures/hopperBridgeReconnectProbe.py` (+17 -6) </details> ### 📄 Description ## Summary The Hopper reconnect boundary test sometimes connects between socket `bind()` and `listen()`, failing CI with `ConnectionRefusedError`. Wait for the listener only on the initial connection; reconnect failures still propagate immediately. This fixes the observed [#1857 shard failure](https://github.com/morluto/rea/actions/runs/38150999785/job/114504725524). No separate issue is needed for this reproduced test-harness race. ## Problem and expected behavior Socket-path existence proves `bind()`, not listener readiness. The fixture must tolerate that startup interval without weakening authentication, reconnect, lost-reply, expiry or cleanup assertions. ## Change and scope Only `hopperBridgeReconnectProbe.py` changes. The first connection retries `ConnectionRefusedError` for at most two seconds, closing failed sockets. Other connection errors and every subsequent reconnect remain immediate failures. ## Contract and boundary impact - Semantic owner and earliest changed stage: test-harness initial socket connection. - CLI/MCP contracts, provider bridge, Evidence/provenance and package metadata: none. - Process/cleanup: failed connection sockets are closed; existing listener and execution-thread cleanup assertions stay intact. - Platform: Linux Unix-socket fixture; production bridge code is unchanged. ## Evidence and regression coverage - Injecting a 150 ms delay between bind and listen deterministically fails the base fixture at its first connection. - Fixed fixture passes against both the delayed copy and shipped bridge, preserving all four modes and their exact request sequences, listener removal and thread release. - Proof gap: native Hopper dispatch is recorded by the fixture; this does not establish real Hopper GUI behavior. ## Validation performed - Bounded Python base/fixed failure-injection probes — expected failure before fix; all four modes passed after fix. - `npm run test:focused -- tests/boundary/providers/hopper/hopperBridgeReconnect.test.ts` — passed. - Normal pre-commit/pre-push checks — passed. ## Compatibility, safety, and release No public API, package or release metadata changes. This is Linux test-harness verification with simulated native dispatch; no real GUI or other-provider claims. ## Review checklist - [x] Concrete reproduced CI failure, focused Conventional Commit outcome. - [x] Startup tolerance is bounded; meaningful reconnect and cleanup failures stay visible. - [x] Final diff checked; no target, credentials, generated output or unrelated cleanup committed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:56:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4876
No description provided.