Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone console tests fails in JDK 22-ea #3419

Closed
sormuras opened this issue Aug 7, 2023 · 3 comments · Fixed by #3423
Closed

Standalone console tests fails in JDK 22-ea #3419

sormuras opened this issue Aug 7, 2023 · 3 comments · Fixed by #3423

Comments

@sormuras
Copy link
Member

sormuras commented Aug 7, 2023

JLine as the default Console provider was integrated into JDK 22-ea+8. The notes says:

JDK 22 Early-Access Release Notes
This is a draft of the release notes that will accompany JDK 22. The contents are subject to change until release.

Build 8
JLine As The Default Console Provider (JDK-8308591)
core-libs/java.io
System.console() has changed in this release to return a Console with enhanced editing features that improve the experience of programs that use the Console API. In addition, System.console() now returns a Console object when the standard streams are redirected or connected to a virtual terminal. In prior releases, System.console() returned null for these cases. This change may impact code that uses the return from System.console() to test if the VM is connected to a terminal. If needed, running with -Djdk.console=java.base will restore older behavior where the console is only returned when it is connected to a terminal.

A new method Console.isTerminal() has been added to test if console is connected to a terminal.

This change makes the console-using standalone test fail on and only on JDK 22-ea: https://github.com/junit-team/junit5/actions/runs/5776317412/job/15655302994 - applying -Djdk.console=java.base as mentioned above, makes the test(s) green again.

See also: https://bugs.openjdk.org/browse/JDK-8313893

@sbrannen
Copy link
Member

sbrannen commented Aug 7, 2023

@sormuras, this seems to be a duplicate of #3415.

@sormuras sormuras changed the title https://bugs.openjdk.org/browse/JDK-8308591 Standalone console tests fails in JDK 22-ea Aug 7, 2023
@sormuras
Copy link
Member Author

sormuras commented Aug 7, 2023

No - this is the issue for which #3415 is a possible fix.

@sormuras
Copy link
Member Author

Also tracked via https://bugs.openjdk.org/browse/JDK-8313893

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants