Skip to content

fix(tests): the process and session-exit tests finish under 5 seconds and hold under load #1748

Closed

Description

@dan-petty

Friction

Three process tests wait out real bounds, and one of them times out under load.

Evidence

  • Bounded waits: tests/test_process.py::test_a_timed_out_check_is_stopped_with_sigterm_first_and_reports_as_before[asyncio] (5.08s) and test_a_run_that_hangs_after_its_summary_line_is_stopped_at_its_bound_with_its_group[asyncio] (5.03s) wait out HUNG_RUN_TIMEOUT_SECONDS = 5.0, added by fix(ci): a test that hangs fails at a per-test timeout, so devops ci never stalls on a stuck child process #1669.
  • Timeout under load: tests/test_github_session.py::test_a_process_that_sent_a_request_exits_without_closing_its_session takes 5.6s on a quiet host. Three runs on 2026-10-20 at load 30-59 overran its 30s subprocess bound, and the reruns passed.
  • Other timeouts under load: tests/test_ci.py::test_a_signal_to_devops_ci_test_lets_pytest_tear_down_then_stops_its_group[SIGTERM] and test_a_second_signal_to_devops_ci_test_cannot_skip_the_sigkill[SIGTERM].

Remedy

  • The bounded-wait tests take a bound that still exceeds a child's start-up, rather than five seconds.
  • The session-exit test removes what makes a fresh child's exit slow, found by timing its phases, instead of raising its bound.

Acceptance criteria

  • Each of these tests takes under 5s on a quiet host.
  • Each passes 10 repeats at load 30.
  • uv run devops ci passes.

regression of #1669, shipped in v0.2.37

Proposed design

Problem statement

Three process tests exceed their timeout bounds of 5 seconds, and one session-exit test times out under load. These tests are slowing down CI and making the test suite unreliable.

Acceptance criteria

  • Criterion 1: Each of the problematic tests takes under 5s on a quiet host
    Verification: Run the specific tests mentioned in the issue (test_a_timed_out_check_is_stopped_with_sigterm_first_and_reports_as_before, test_a_run_that_hangs_after_its_summary_line_is_stopped_at_its_bound_with_its_group, and test_a_process_that_sent_a_request_exits_without_closing_its_session) individually on a quiet host and verify they complete in under 5 seconds.
  • Criterion 2: Each of the problematic tests passes 10 repeats at load 30
    Verification: Run each of the specified tests 10 times in sequence with load 30 to ensure they consistently pass without timing out.
  • Criterion 3: uv run devops ci passes
    Verification: Execute 'uv run devops ci' and verify that it completes successfully without any test failures related to the fixed tests.

Key questions

  • What is the HUNG_RUN_TIMEOUT_SECONDS value defined in tests/test_process.py?: HUNG_RUN_TIMEOUT_SECONDS = 5.0 [sources: tests/test_process.py:27]

Open questions

  • Which specific tests are timing out under load? (missing verified source)
  • What is the remedy proposed for these tests? (missing verified source)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    on Oct 20, 2026
  2. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/test. The candidate is focused on fixing test behavior and performance, specifically related to process and session exit tests.
    • Priority: P1-High. The tests are failing under load and causing CI instability, which impacts the development workflow.
    • Value: High. Improving test stability and performance directly benefits developers by reducing CI failures and faster feedback loops.
    • Effort: Medium. Requires modifying existing tests to adjust timeouts and identify causes of slowness, but doesn't involve major architectural changes.
  3. added this to the v0.2.38 milestone on Oct 20, 2026
  4. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1759, merged into release/v0.2.38 as f270f68.

    Resolves #1748

    Fail-to-pass: not applicable: performance optimization reducing test execution times under the 5-second ceiling and avoiding subprocess teardown timeouts under load

    7 file(s) changed.

    How it was verified

    Check runs at b71d614:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Rule Pack Tests: pass
    • Static Analysis: pass
    • Fail-to-Pass Check: pass
    • Fail-to-Pass Self-Check: pass
    • Tests & Coverage: pass
    • Changed-Test Independence: pass
    • Analyze (python): pass
    • Analyze (actions): pass
    • Service Image: skipping
    • Dependency Freshness: skipping
    • DevContainer Image: skipping

    Acceptance Criteria of docs/agent/tasks/task-1748-process-and-session-exit-bounds.md:

    No Acceptance Criteria section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/test

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions