fix(client): UFFS_NO_AUTOSTART kill-switch so tests never spawn uffsd - #612
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_helprunsuffs -xand asserts the failure stderr contains lowercasedaemon. In CI the workspace test build places a realuffsdnext to the test binary, sofind_daemon_exefound it, the search auto-spawned an actual daemon on the runner,await_readypolled for its full 120 s deadline, and the run failed withDaemon did not become ready in time— capital D, invisible to the case-sensitive match. The usual pass path is the fast, lowercaseFailed to connect to UFFS daemonerror, 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 whenUFFS_NO_AUTOSTARTis set, returning a stableDaemonStartFailedmessage 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 leakeduffsd. The switch is also genuinely useful for operators who manageuffsdthemselves.Pure-function unit tests (repo idiom, no env mutation) cover the parse (
1/truedisable; unset/empty/0keep autostart) and the message surface.daemon_spawn.rscrossed the 800-LOC ceiling with the new tests, so its three test clusters moved todaemon_spawn_tests.rsvia 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.