Symptom
test/cli/daemon.test.ts › bitsocial daemon KUBO_RPC_URL env var › daemon uses KUBO_RPC_URL env var to configure kubo bind address failed on macOS CI:
TypeError: fetch failed -> connect ECONNREFUSED 127.0.0.1:<kuboPort>
❯ test/cli/daemon.test.ts:757:25
Ubuntu passed in the same run; the suite passes locally. Seen on the CI run for PR #132 (a pkc-js 0.0.82 -> 0.0.83 bump whose lockfile diff touches nothing but pkc-js itself), so this is not caused by that upgrade.
Root cause
Identical to issue #95. startPkcDaemon resolves as soon as the daemon prints its Communities in data path banner, which does not guarantee kubo's HTTP API is currently listening. Since pkc-js 0.0.46, pkc-js rewrites kubo's Routing config and POSTs /shutdown on first connect, so the daemon restarts kubo around init — a brief window where the kubo API port refuses connections.
The test verifies kubo with a single, un-retried fetch that can land in that window:
const res = await fetch(`${daemon.kuboApiUrl}/bitswap/stat`, { method: "POST" });
expect(res.status).toBe(200);
The #95 fix only patched the two tests in the kills kubo on its own shutdown describe. This is the last remaining bare one-shot kubo check in the suite — everything else polls waitForKuboReady.
Fix
Use the existing retry helper:
const kuboReady = await waitForKuboReady(daemon.kuboApiUrl, 45000);
expect(kuboReady).toBe(true);
Fixed on PR #132.
Symptom
test/cli/daemon.test.ts›bitsocial daemon KUBO_RPC_URL env var›daemon uses KUBO_RPC_URL env var to configure kubo bind addressfailed on macOS CI:Ubuntu passed in the same run; the suite passes locally. Seen on the CI run for PR #132 (a pkc-js 0.0.82 -> 0.0.83 bump whose lockfile diff touches nothing but pkc-js itself), so this is not caused by that upgrade.
Root cause
Identical to issue #95.
startPkcDaemonresolves as soon as the daemon prints itsCommunities in data pathbanner, which does not guarantee kubo's HTTP API is currently listening. Since pkc-js 0.0.46, pkc-js rewrites kubo's Routing config and POSTs/shutdownon first connect, so the daemon restarts kubo around init — a brief window where the kubo API port refuses connections.The test verifies kubo with a single, un-retried fetch that can land in that window:
The #95 fix only patched the two tests in the
kills kubo on its own shutdowndescribe. This is the last remaining bare one-shot kubo check in the suite — everything else pollswaitForKuboReady.Fix
Use the existing retry helper:
Fixed on PR #132.