On Sun, 15 Nov 2026 08:06:49 GMT, Alan Bateman <[email protected]> wrote:
>> The "blocked in write" tests in BlockingSocketOps and BlockingChannelOps are >> problematic as the underlying non-blocking socket may be polled as writable >> several times before the virtual thread writer blocks indefinitely. The >> tests were updated recently to additionally test the blocked thread's >> parkBlocker, which makes it harder to test when it wakes up several times. >> >> The tests are simplified to avoid special casing the writing case. The >> runAfterParkedAsync method in both tests now polls the thread until it parks >> and the parkBlocker is set. BlockingChannelOps tests the expected >> parkBlocker whereas BlockingSocketOps just tests for a non-null parkBlocker. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Alan Bateman has updated the pull request incrementally with one additional > commit since the last revision: > > Fixed typos in test comments Marked as reviewed by dfuchs (Reviewer). test/jdk/java/net/vthread/BlockingSocketOps.java line 140: > 138: // delayed read from s2 to EOF > 139: InputStream in = s2.getInputStream(); > 140: Thread unparker = runAfterParkedAsync(() -> Nit: I had the same idea than Volkan that you could use CompletableFuture<?> here instead of Thread since the only thing you do is calling join(). The CompletableFuture could be completed at the end of the Thread's Runnable, either successfully or exceptionally. ------------- PR Review: https://git.openjdk.org/jdk/pull/33907#pullrequestreview-5918877548 PR Review Comment: https://git.openjdk.org/jdk/pull/33907#discussion_r4584871137
