Skip to content

test(remote): two tests on main can fail on a correct code — they read a merged stream - #886

Open
fujibee wants to merge 1 commit into
mainfrom
fix/curl-tests-read-merged-stream
Open

test(remote): two tests on main can fail on a correct code — they read a merged stream#886
fujibee wants to merge 1 commit into
mainfrom
fix/curl-tests-read-merged-stream

Conversation

@fujibee

@fujibee fujibee commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Describes head 628e58dc1b528115e089bddf7ef7340427e7a4a2.

A flake in a required check, on main right now. Two tests can fail on a correct result, so this blocks landing for every branch, not only the one that hit it.

What happens

tests/test_remote_curl_config_paths.bats and tests/test_remote_header_sink.bats compare bats's $output against "200" or "000". $output is stdout and stderr merged, and the helper's stderr is not reliably empty. On a loaded macOS runner:

remote.sh: line 318: .../agmsg-header-pipe.JVbrl7/header: Interrupted system call
000

The fifo open was interrupted and bash reported it. The http code was right; the comparison was against a two-line string.

Observed, not reasoned about — two cases in one CI run, at a head that was green on the author's machine:

not ok 351 an untranslated POSIX path reaching native curl is the reported 000 (#850)
not ok 352 a Windows path reaching a POSIX curl is equally a 000 (#850)

Same OS, same code, different load.

Scope

The window is the fifo open, so every case that drives the non-marker arm is exposed — including four in the header-sink file that have not failed yet. Fixing only the two that were seen would leave the same defect waiting in the other file.

Derived rather than assumed: grep -c 'output" = "' over the four #850 test files, then checked which of them separate the streams. The two stderr files (test_remote_curl_stderr*.bats) already do, and their remaining unseparated run sites assert $status only — nothing there compares a merged stream.

The change

Both harnesses send the helper's stderr to a file; the http code is alone on stdout. Same cases, same assertions, no production change.

tests/test_remote_curl_config_paths.bats + tests/test_remote_header_sink.bats
  14 ok / 0 not ok

Boundary

This makes an exact comparison mean what it says. It does not stop the interruption itself — the fifo open can still be interrupted, and if that ever matters to behaviour rather than to a test's string comparison, it is a separate question. Related: the header copier is not reaped on an early exit (#864).

Declared reviewers: 1

…tream

Two tests on main can fail on a correct code. They compare bats's $output
against "200" or "000", and $output is stdout AND stderr merged.

The helper's stderr is not reliably empty. On a loaded macOS runner:

  remote.sh: line 318: .../agmsg-header-pipe.JVbrl7/header: Interrupted system call
  000

The fifo open was interrupted and bash reported it, so an exact comparison
against a two-line string failed while the code itself was right.

Observed, not hypothesised: two cases went red in one CI run at a head that was
green locally.

  not ok 351 an untranslated POSIX path reaching native curl is the reported 000
  not ok 352 a Windows path reaching a POSIX curl is equally a 000

Same OS, same code, different load. The window is the fifo open, so every case
that drives the non-marker arm is exposed -- four more of them in the header
sink file, which has not failed yet and can.

Both harnesses now send the helper's stderr to a file, leaving the http code
alone on stdout. Nothing else changes: same cases, same assertions.

14 ok / 0 not ok across the two files.

This is a flake in a required check, so it is a landing blocker for every
branch and not only for the one that noticed it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant