Buck crash when reading Go test output with invalid characters
Created by: linzhp
Go test output can contains invalid characters because of, for example, invalid user inputs. The native "go test" output handles them nicely, but Buck would crash.
Steps to reproduce:
$ git clone git@github.com:linzhp/buck_go_examples.git
$ cd buck_go_examples
$ go test ./testOutput
--- FAIL: TestUnprintableChars (0.00s)
testOutput_test.go:13: ����JFIF is not printable
FAIL
FAIL buck_go_examples/testOutput 0.006s
$ buck test testOutput:
Action graph will be rebuilt because files have been added or removed.
FAILURE //testOutput:all_tests main: Input length = 1
Building: finished in 0.1 sec (100%) 2/2 jobs, 0 updated
Total time: 0.2 sec
Testing: finished in 0.0 sec (0 PASS/1 FAIL)
RESULTS FOR //testOutput:all_tests
FAIL <100ms 0 Passed 0 Skipped 1 Failed //testOutput:all_tests
FAILURE //testOutput:all_tests main: Input length = 1
java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at com.facebook.buck.features.go.GoTest.parseTestResults(GoTest.java:168)
at com.facebook.buck.features.go.GoTest.lambda$interpretTestResults$0(GoTest.java:251)
at com.facebook.buck.cli.TestRunning$4.call(TestRunning.java:547)
at com.facebook.buck.cli.TestRunning$4.call(TestRunning.java:540)
at com.facebook.buck.cli.TestRunning.lambda$runStepsAndYieldResult$1(TestRunning.java:824)
at com.facebook.buck.util.concurrent.WeightedListeningExecutorService.lambda$submitWithSemaphore$0(WeightedListeningExecutorService.java:74)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:206)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:195)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:115)
at com.google.common.util.concurrent.MoreExecutors$5$1.run(MoreExecutors.java:999)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
TESTS FAILED: 1 FAILURE
Failed target: //testOutput:all_tests
FAIL //testOutput:all_tests
@mkaczanowski