Skip to content

Make JSONRPC output-test coverage independent of scheduling #564

Description

Problem

The exact-base Linux coverage gate on #563 failed by 0.013 percentage points despite identical production code and identical line/function denominators. Comparing raw LCOV against main 8320c0f isolates all three missing covered lines to crates/pet-jsonrpc/src/output.rs:637-639, the assertion/yield waiting branch inside the test-only wait_for_len helper.

  • Base: 19,309 / 22,571 lines; PR: 19,306 / 22,571.
  • Both: 1,922 / 2,175 functions.
  • No other file has a line/function coverage-summary change.
  • Whether the helper enters its waiting branch depends on thread scheduling; output may already be ready on the first check.

Evidence: https://github.com/microsoft/python-environment-tools/actions/runs/36755876712/job/110025860667 and exact-base run https://github.com/microsoft/python-environment-tools/actions/runs/36754137116.

Scope

Make output test coordination and its waiting/ready coverage deterministic using bounded channels or explicit dependency-boundary observation. Cover both pending and already-ready behavior without sleeps or scheduler assumptions; inspect the adjacent analogous error-wait helper as part of the same test-fixture boundary. Preserve production output behavior, timeout semantics, and the coverage gate.

Do not loosen coverage budgets, exclude source, add lines merely to improve the percentage, or rerun until green. This is a separate main-based test-reliability fix so #533 remains focused.

Acceptance

  • Deterministic tests prove the relevant waiting and completion states.
  • All pet-jsonrpc tests and required formatting/Clippy pass.
  • Native exact-base coverage is inspected before merge.

Related: #533, #534, #528.

Activity

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

    debtCode quality issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions