JDK-8313893 : JUnit's GHA fails with "stty: /dev/tty: No such device or address"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: linux_ubuntu
  • CPU: generic
  • Submitted: 2023-08-07
  • Updated: 2023-09-25
  • Resolved: 2023-09-25
Related Reports
Relates :  
Description
JUnit's GHA tests failed with JDK22-ea. Looks like a regression caused by the fix to JDK-8308591. Here is an example of the error (https://github.com/junit-team/junit5/actions/runs/5776317412/job/15655302994)

```
    - junit-platform-suite (group ID: org.junit.platform, artifact ID: junit-platform-suite-engine, version: 1.11.0-SNAPSHOT, location: jar:file:/home/runner/work/junit5/junit5/platform-tooling-support-tests/build/normalized-repo/org/junit/platform/junit-platform-console-standalone/1.11.0-SNAPSHOT/junit-platform-console-standalone-1.11.0-SNAPSHOT.jar!/org/junit/platform/suite/engine/SuiteTestEngine.class) ==> expected line #1 doesn't match actual line #1
    	expected: `.+ org.junit.platform.launcher.core.ServiceLoaderRegistry load`
    	  actual: `stty: /dev/tty: No such device or address`
        at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at app//org.junit.jupiter.api.AssertLinesMatch$LinesMatcher.fail(AssertLinesMatch.java:203)
        at app//org.junit.jupiter.api.AssertLinesMatch$LinesMatcher.assertLinesMatchWithFastForward(AssertLinesMatch.java:178)
        at app//org.junit.jupiter.api.AssertLinesMatch$LinesMatcher.assertLinesMatch(AssertLinesMatch.java:112)
        at app//org.junit.jupiter.api.AssertLinesMatch.assertLinesMatch(AssertLinesMatch.java:80)
        at app//org.junit.jupiter.api.AssertLinesMatch.assertLinesMatch(AssertLinesMatch.java:46)
        at app//org.junit.jupiter.api.Assertions.assertLinesMatch(Assertions.java:1613)
        at app//platform.tooling.support.tests.StandaloneTests.execute(StandaloneTests.java:358)
```


Comments
Fix has been implemented in JUnit.
25-09-2023

Picocli seems to be modifying the issue within themselves: https://github.com/remkop/picocli/pull/2084 Using the new `isTerminal()` method is precisely for remedying such situations.
11-08-2023

Thanks [~cstein], that seems to be it
10-08-2023

As JUnit's console application uses Picocli, this issue seems to describe the source of `stty: /dev/tty: No such device or address` message. https://github.com/remkop/picocli/issues/1104
10-08-2023