Repository navigation
Description
CI failed on the v0.7.0 release commit because a host unit test failed at random: refresh::tests::the_host_leaves_a_current_build_as_it_is in crates/fctl-host/src/refresh.rs. That run skipped its deploy, so app.fctl.sh got 0.7.0 only from the next push to main. The same test passed on the next commit, at the same version.
How it works now
Run 39169569130, cargo xtask check:
thread 'refresh::tests::the_host_leaves_a_current_build_as_it_is' panicked at crates/fctl-host/src/refresh.rs:437:9:
assertion `left == right` failed
left: ["image inspect --format {{.Id}} ghcr.io/hyperstructure/sandbox:latest", "pull ghcr.io/hyperstructure/sandbox:0.7.0"]
right: ["image inspect ghcr.io/hyperstructure/sandbox:0.7.0", "image inspect ghcr.io/hyperstructure/sandbox:0.7.0", "image tag …", …]
The test puts the published image on a fake host and expects refresh to inspect it and pull a newer build over it. In this run, refresh acted as if the image wasn't there at all: it checked the fallback (:latest) and pulled. The calls the fake recorded don't include the first image inspect …:0.7.0, so the fake CLI never ran for it.
Most likely cause:
FakeCli::empty(crates/fctl-host/src/driver/fake.rs) writes a shell script into a temporary directory for each test and runs it as the CLI.- Tests run in parallel threads that start processes. A child forked while another test has its script open for writing keeps that file open until the child
execs. Running the script in that window fails withETXTBSY("Text file busy"). ContainerDriver::image(crates/fctl-host/src/driver/container.rs) turns every error except a timeout intoOk(None), "no such image", so the failed spawn reads as a missing image.
That fits the recorded calls, but I haven't seen the ETXTBSY itself, because image drops the error. Logging it in the test would confirm the cause.
What should happen
- Tests that use
FakeClinever fail because its script is being written while it runs (test: fix flaky tests that run a script right after writing it #106). Options:- write the script once per test binary, before any test starts a process;
- run it through
/bin/shinstead of executing the file; - retry a spawn that fails with
ETXTBSY.
-
ContainerDriver::imagetreats a CLI that couldn't be started as an error, not as "no such image". This applies to real hosts too: there, such a failure leads to a pull that fails as well. - CI passes repeatedly on
main: runcargo test -p fctl-hostin a loop to check (test: fix flaky tests that run a script right after writing it #106).
Compatibility
The first item touches tests only. The second changes the host, but not the protocol, and ships with the next host release.
Activity
fctl-sh commentedon Oct 19, 2026
#106 (merged as 337a1b4) fixes the test side and confirms the cause.
ETXTBSYis real. With the driver printing its spawn errors (a throwaway change), a failing run showed/tmp/.tmpwoGJFM/cli: Text file busy (os error 26). The same race faileddriver::container::tests::the_docker_vm_is_measured_in_a_short_lived_containeron 65dcbe1 (run).shwrite their scripts (write_scriptincrates/fctl-host/src/driver/fake.rs), so the test binary never has them open for writing. That takes none of the options above. fctl-agent's stand-ins for Claude Code, which could fail the same way, use the same helper.mainafter the merge (run).Left: the second item.
ContainerDriver::imagestill reads a CLI that couldn't start as "no such image", and so dohas_imageandvm_disk_free_mbin the same file. That changes the host, so it ships with a host release.Session: https://app.fctl.sh/s/ses_01M5AFQJTX6FENQJJZWRD5AP5K
fix(web): find a place on the page as browsers do, whatever its name