Skip to content

I3099 — The serve-lifecycle test tells a stopped server from another server answering its freed port

Make tests/serve_lifecycle.rs ensure_starts_one_server_finds_it_the_next_time_and_stop_ends_it assert what `serve stop` promises (the process has exited once it says stopped) and treat its old address as closed when nothing answers there or a server with another pid does, with a failure that names what still answered.

DONE wave 0 · p1 · debugging profile · parallel safe

Part of development-runtime — The runtime has a development surface.

Objective

Make tests/serve_lifecycle.rs ensure_starts_one_server_finds_it_the_next_time_and_stop_ends_it assert what `serve stop` promises (the process has exited once it says stopped) and treat its old address as closed when nothing answers there or a server with another pid does, with a failure that names what still answered.

Why

On 2026-10-21 master validate 39565286918 (905159df7cc, the 1.0.0-alpha.2 candidate) failed rust (3) at serve_lifecycle.rs:76 with \"the port closes did not happen within 5s\"; the same tree passed rust (3) twice in PR run 39542849828. `serve stop` prints stopped only after exited_by has seen the process end, so the server was gone; what kept answering was the freed port, which the tests of the same binary, run at once, can be given within the second.

Current state

The test waits up to 5 s for any answer at the stopped server's address to stop, so another test's server on the reused port reads as the stopped one still running.

Desired state

The test asserts the process is gone, asks whoever answers the address for its pid, passes when nobody or another pid answers, and on failure names the pid that still answers.

Scope

  • apps/majordomus-cli/tests/serve_lifecycle.rs
  • .ai/repo/project/issues/I3099.yaml

Out of scope

  • Changing serve stop itself

Dependencies

None. This issue is a root of the graph.

Acceptance criteria

  • After serve stop prints stopped, the test asserts the pid is no longer running
  • A server of another pid answering the freed address does not fail the test
  • A failure names the pid still answering at the address

Validation

  • cargo test --manifest-path apps/majordomus-cli/Cargo.toml --test serve_lifecycle

Evidence required

  • serve_lifecycle_passes

Evidence

coverstypecommandresultat commit
serve_lifecycle_passescicargo test --manifest-path apps/majordomus-cli/Cargo.toml --test serve_lifecycleok, the rust job passed in master validate 39784979979 (success at 2034d4a3f0b, which holds the I3099 test, landed in a57482183bf)376493c

Timeline

started
2026-10-21T09:32:52Z
verified
2026-10-21T10:20:28Z
completed
2026-10-23T16:42:56Z

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I3099.yaml. Read it back with majordomus plan show I3099.

Searches the titles and descriptions of every page this site publishes.