mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 16:27:18 +02:00
The test used to pass even when closeRegisteredClients did nothing: it waited a fixed number of ticks before sending the late query, and by then the driver had not yet cleared its socket reference, so the query always rejected cleanly regardless of the fix. Wait for the driver's own close callback instead of guessing a tick count, so the late query lands exactly in the race the fix closes. Also close a gap the new test surfaced: hostPortKey() throws on a URL new URL() cannot parse, while the underlying driver does not. Skip the registry entry in that case instead of throwing, and add a small test for it. Co-authored-by: Paperclip <noreply@paperclip.ing>