Repository navigation
fix(runner): a parallel lane's error is printed as plain text on one line - #786
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.goprinted it with%vin 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:[<lane>] attempt N failed: …;[<lane>] all attempts failed: …;device errors: [<lane>] …;<lane> error: ….All four now go through
errShown(err), which isdevice.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.AsonconnectError) and the caller.Tests
TestFailedLaneErrorTextIsPrintedCleaned: the dial fails withrefused\n pass --yes to continue<ESC>[2J<RLO>end. Across the run's output,PrintSummaryand the run's error, it checks that:pass --yes;Mutation check
Each mutant was applied, the tests were run, and the file was restored byte for byte. All 4 were killed.
Test plan
go test ./internal/runner/passes.go vetandstaticcheckpass on./internal/runner/.