Skip to content

fix(client): UFFS_NO_AUTOSTART kill-switch so tests never spawn uffsd - #612

Merged
githubrobbi merged 1 commit into
mainfrom
fix/cli-test-no-autostart
Aug 23, 2026
Merged

fix(client): UFFS_NO_AUTOSTART kill-switch so tests never spawn uffsd#612
githubrobbi merged 1 commit into
mainfrom
fix/cli-test-no-autostart

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

Closes the ORIGINAL failure tracked by #610 (the merge-queue run of #609); the second failure appended to that issue — the lifecycle idle-timer flake — was already fixed by #611.

What happened: other_single_dash_token_is_a_pattern_not_help runs uffs -x and asserts the failure stderr contains lowercase daemon. In CI the workspace test build places a real uffsd next to the test binary, so find_daemon_exe found it, the search auto-spawned an actual daemon on the runner, await_ready polled for its full 120 s deadline, and the run failed with Daemon did not become ready in time — capital D, invisible to the case-sensitive match. The usual pass path is the fast, lowercase Failed to connect to UFFS daemon error, which is why this only bites when the spawn happens to succeed. A spawned daemon is also a leaked process per CI run.

Fix: spawn_daemon (single chokepoint used by both the async and sync autostart paths, both platform dispatchers) refuses when UFFS_NO_AUTOSTART is set, returning a stable DaemonStartFailed message that keeps the lowercase-daemon match surface and names the remedy. The cli_integration harness sets the switch for every invocation, so daemonless failures are immediate and deterministic — no spawn, no readiness poll, no leaked uffsd. The switch is also genuinely useful for operators who manage uffsd themselves.

Pure-function unit tests (repo idiom, no env mutation) cover the parse (1/true disable; unset/empty/0 keep autostart) and the message surface. daemon_spawn.rs crossed the 800-LOC ceiling with the new tests, so its three test clusters moved to daemon_spawn_tests.rs via the nested #[path] idiom.

Verified: 225 uffs-client tests green, native + xwin clippy clean. Test-only behavior change unless the env var is set; no version bump.

Root cause of issue #610's original failure: the cli_integration test
for '-x is a pattern, not help' expects a fast daemonless connect
error, but in CI the workspace build puts uffsd next to the test
binary, so the search auto-spawned a real daemon, polled readiness for
the full 120 s deadline, and failed with 'Daemon did not become ready
in time' — which the test's case-sensitive lowercase 'daemon' match
does not contain. Spawning real daemons from tests is also a leaked
process per run.

spawn_daemon (both platform dispatchers) now refuses when
UFFS_NO_AUTOSTART is set, with a stable lowercase-daemon message; the
integration harness sets it, making every daemonless failure immediate
and deterministic. Pure-function unit tests cover the parse and the
message surface; daemon_spawn's test clusters move to a companion file
to stay under the file-size policy.
@githubrobbi
githubrobbi enabled auto-merge August 23, 2026 00:47
@githubrobbi
githubrobbi added this pull request to the merge queue Aug 23, 2026
Merged via the queue into main with commit e954c33 Aug 23, 2026
21 checks passed
@githubrobbi
githubrobbi deleted the fix/cli-test-no-autostart branch August 23, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant