Skip to content

Flaky test: process_group_cleanup reads the launcher pidfile between create and write (ParseIntError Empty) #338

Description

@schickling-assistant

Problem

codex_app_server::tests::process_group_cleanup_reaps_a_native_launcher_descendant is flaky under CI load:

thread '...' panicked at src/codex_app_server.rs:5365:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: Empty }

The descendant writes its pid with printf "%s" "$$" > "$DESCENDANT_PIDFILE". The readiness loop waits on descendant_pidfile.is_file(), which becomes true when the shell creates the file — before any bytes are written. Reading at that moment yields an empty string and the parse unwrap panics.

Observed once on run 32759546875 (PR #335); identical code passed runs 32759495299 (#333) and #334's run, confirming a race rather than a regression.

Fix

Wait for content, not existence: poll read_to_string until it yields a parseable non-empty value instead of gating on is_file().

Posted on behalf of @schickling
field value
agent_identity unknown
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.3
agent_runtime OMP 18.0.3
tooling_profile dotfiles@f33cd9c-dirty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions