RFR: 8340830: Console.readLine() and Console.printf() are mutually blocking [v5]
Jaikiran Pai
jpai at openjdk.org
Wed Feb 4 01:13:44 UTC 2026
On Tue, 3 Feb 2026 17:37:34 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> test/jdk/java/io/Console/readWriteBlocking.exp line 27:
>>
>>> 25: eval spawn $argv
>>> 26:
>>> 27: expect {
>>
>> More of a question than a review, given what this regression test is for - detecting a deadlock in `Console` API implementation, is the use of `expect` tool necessary for this test? Or could the test just ensure that the launched `java` application completes normally after the two threads read/write using the `Console` instance?
>
> Yes, it is necessary. Without running it through `expect`, `System.console()` returns null for java.base, as the jtreg environment is not an interactive terminal environment.
Thank you Naoto, I wasn't aware of that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29493#discussion_r2761708642
More information about the core-libs-dev
mailing list