Skip to content

e2e::run drops the truncation flags: a program's standard error is cut at 1 MiB without notice #22

Closed

Description

@speak-agent

Observation

e2e::run keeps at most 1 MiB of a program's standard error and does not say when it kept less. The limit comes from os::process::bounds (err_limit = 1 << 20, out_limit = 256 << 20). e2e::run builds a default bounds, sets only hard, and copies status, timed_out, out, err and duration into e2e::outcome. The out_truncated, err_truncated and held_open flags that os::process::run reports are dropped (lib/src/e2e.cpp, run).

A case that searches the output therefore cannot tell "the line is absent" from "the line was cut off".

Where it showed

In mcpp's C++ e2e tests (mcpp-community/mcpp#930), a case built a project cold with MCPP_VERBOSE=1 and looked for the link line in the build's standard error. A cold build writes more than 1 MiB there; the link line came after the cut, and the case failed with "no link line" on the Linux shards. It passed wherever the build was warm. The kept output ended at the limit, and nothing in the outcome or the failure message pointed to it.

Proposal

  1. e2e::outcome carries out_truncated, err_truncated and held_open as os::process::run reports them.
  2. e2e::command states its own limits (for example std::size_t out_limit, err_limit), with the present values as defaults, and run passes them to bounds.
  3. The outcome matchers (succeeded, failed, the contains family over out/err) say in their failure message that an output was truncated, and at what size. A negative match on a truncated output (not contains) is the case most worth naming, because it can pass wrongly.

Items 1 and 3 change no passing case. Item 2 keeps the present limits by default.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions