Skip to content

Commit 5f7ffe2

Browse files
committed
Harden StandaloneTests against spurious tty error output
On GitHub Actions runners an uncritical error message is sometimes printed when launching a process on Windows: stty: /dev/tty: No such device or address This can safely be ignored.
1 parent 539f6a5 commit 5f7ffe2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,13 @@ void execute() throws IOException {
358358
var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out.txt"));
359359
var expectedErrLines = Files.readAllLines(workspace.resolve("expected-err.txt"));
360360
assertLinesMatch(expectedOutLines, result.getOutputLines("out"));
361-
assertLinesMatch(expectedErrLines, result.getOutputLines("err"));
361+
List<String> actualErrLines = result.getOutputLines("err");
362+
if (actualErrLines.getFirst().contains("stty: /dev/tty: No such device or address")) {
363+
// Happens intermittently on GitHub Actions on Windows
364+
actualErrLines = new ArrayList<>(actualErrLines);
365+
actualErrLines.removeFirst();
366+
}
367+
assertLinesMatch(expectedErrLines, actualErrLines);
362368

363369
var jupiterVersion = Helper.version("junit-jupiter-engine");
364370
var vintageVersion = Helper.version("junit-vintage-engine");

0 commit comments

Comments
 (0)