Skip to content

fix: wait for ready log before reporting project readiness - #555

Draft
awjdean wants to merge 2 commits into
F1bonacc1:mainfrom
awjdean:fix/ready-log-line-readiness
Draft

awjdean wants to merge 2 commits into
F1bonacc1:mainfrom
awjdean:fix/ready-log-line-readiness

Conversation

@awjdean

@awjdean awjdean commented Oct 2, 2026 •

Copy link
Copy Markdown

project is-ready can exit successfully while a running process has not yet printed its ready_log_line. With this change, a process with a ready_log_line counts as ready only once that line appears, so the project stays not ready until then. The same applies to --detach-on-success.

Fixes #557

Implementation

NewProcessState now sets HasHealthProbe when ready_log_line is configured, as it already does for readiness and liveness probes.

No new check is needed. The existing readiness checks already require a process with HasHealthProbe to be healthy, and they report a process that is still waiting for its line with the existing health is Unknown reason. Processes with neither a probe nor a ready_log_line behave as before.

Tests and documentation

  • TestProcessStateLogReadiness builds a process state from a config with ready_log_line. It checks that the state is not ready before the ready line is observed, and ready afterward.
  • TestSystem_TestReadyLineProjectReadiness starts a real process. It checks that the project is not ready before the process prints the ready line, and ready afterward.
  • www/docs/launcher.md now says that a process with a ready_log_line is not ready until the line is printed. It names project is-ready and --detach-on-success as examples.

Validation

Initial fix

Recorded earlier, on Linux with Go 1.26.8:

  • The unit regression test failed without the fix.
  • go test ./src/types -count=1, make build, make testrace (full suite), and make lint passed.
  • A reproduction with a built binary confirmed that project is-ready fails before the ready line appears and succeeds afterward.

Latest changes

Run on macOS with Go 1.26.8, in a temporary detached worktree that contained exactly the staged changes:

  • make build passed.
  • golangci-lint run --show-stats -c .golangci.yaml passed with zero issues. This used version 2.11.3, the version pinned in the Makefile.
  • The focused readiness and health tests passed in both packages with the race detector:
go test -race ./src/types ./src/app -run 'TestProcessState|TestSystem_TestReadyLine|TestUpdateProcessReadyLogLine|TestSetProcHealth'

The full race-enabled suite was not rerun for these changes.

Nix package build (optional)

Built from commit 3d09b371a68dac0764cc3bd34398a70e75d99514 in a native aarch64-linux Docker container, with Nix 2.35.2 and Go 1.26.1 (the version pinned by the flake):

nix --extra-experimental-features "nix-command flakes" build \
  --no-link --print-out-paths -L .#packages.aarch64-linux.process-compose
  • The build, package test (checkPhase), install, and fixup phases all passed (exit status 0). This includes the tests in src/app and src/types.
  • This ARM64 run does not verify the x86_64-linux target that the Nix workflow builds. A first attempt at x86_64-linux under emulation failed before compilation with unable to load seccomp BPF program: Invalid argument.

Guard the transition from actual ready-log output to project readiness,
and document when callers can consider the project ready.

Refs F1bonacc1#557
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

project is-ready reports success before ready_log_line is emitted

1 participant