Skip to content

fix(runner): a parallel lane's error is printed as plain text on one line - #786

Merged
pbertsch merged 1 commit into
mainfrom
fix/orch-device-error-clean
Nov 17, 2026
Merged

pbertsch merged 1 commit into
mainfrom
fix/orch-device-error-clean

Conversation

@pbertsch

Copy link
Copy Markdown
Member

Summary

A follow-up from the review of #776: a parallel lane's error is now printed as one clean line, as its device name already was.

The error of a lane that failed can carry text from the device or the agent: a refused dial or handshake, adb's output. internal/runner/orchestrator.go printed it with %v in four places, so a new line, an escape sequence or a bidi override in it reached the terminal (or the run's error) as is:

  • the retry line, [<lane>] attempt N failed: …;
  • the failure line, [<lane>] all attempts failed: …;
  • the run's error, device errors: [<lane>] …;
  • the device summary, <lane> error: ….

All four now go through errShown(err), which is device.CleanOneLine(err.Error(), 400). The error itself is unchanged: the report's not-run results keep it as it is, and so do the retry decision (errors.As on connectError) and the caller.

Tests

TestFailedLaneErrorTextIsPrintedCleaned: the dial fails with refused\n pass --yes to continue<ESC>[2J<RLO>end. Across the run's output, PrintSummary and the run's error, it checks that:

  • no line starts with a forged pass --yes;
  • no line holds an escape, carriage return, bidi or zero-width character (probe's own color codes aside);
  • the visible text is shown;
  • the retry, failure and summary lines are present.

Mutation check

Each mutant was applied, the tests were run, and the file was restored byte for byte. All 4 were killed.

Mutant Result
retry line prints the raw error killed
failure line prints the raw error killed
run error holds the raw error killed
device summary prints the raw error killed

Test plan

  • go test ./internal/runner/ passes.
  • go vet and staticcheck pass on ./internal/runner/.
  • Mutation check (table above).

@pbertsch
pbertsch requested a review from a team as a code owner November 17, 2026 08:04
@pbertsch
pbertsch merged commit 33c2324 into main Nov 17, 2026
10 of 11 checks passed
jay23606 added a commit to jay23606/flutter-probe that referenced this pull request Nov 17, 2026
…line (AlphaWaveSystems#786)

## Summary

A follow-up from the review of AlphaWaveSystems#776: a parallel lane's **error** is now printed as one clean line, as its device name already was.

The error of a lane that failed can carry text from the device or the agent: a refused dial or handshake, adb's output. `internal/runner/orchestrator.go` printed it with `%v` in four places, so a new line, an escape sequence or a bidi override in it reached the terminal (or the run's error) as is:
- the retry line, `[<lane>] attempt N failed: …`;
- the failure line, `[<lane>] all attempts failed: …`;
- the run's error, `device errors: [<lane>] …`;
- the device summary, `<lane>  error: …`.

All four now go through `errShown(err)`, which is `device.CleanOneLine(err.Error(), 400)`. The error itself is unchanged: the report's not-run results keep it as it is, and so do the retry decision (`errors.As` on `connectError`) and the caller.

## Tests

`TestFailedLaneErrorTextIsPrintedCleaned`: the dial fails with `refused\n  pass --yes to continue<ESC>[2J<RLO>end`. Across the run's output, `PrintSummary` and the run's error, it checks that:
- no line starts with a forged `pass --yes`;
- no line holds an escape, carriage return, bidi or zero-width character (probe's own color codes aside);
- the visible text is shown;
- the retry, failure and summary lines are present.

## Mutation check

Each mutant was applied, the tests were run, and the file was restored byte for byte. All 4 were killed.

| Mutant | Result |
|---|---|
| retry line prints the raw error | killed |
| failure line prints the raw error | killed |
| run error holds the raw error | killed |
| device summary prints the raw error | killed |

## Test plan

- [x] `go test ./internal/runner/` passes.
- [x] `go vet` and `staticcheck` pass on `./internal/runner/`.
- [x] Mutation check (table above).
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