RFR: 8332535: Mark java/nio/channels/DatagramChannel/Loopback.java as intermittent [v2]

SendaoYan syan at openjdk.org
Tue Jun 25 15:53:12 UTC 2024


On Tue, 25 Jun 2024 14:48:50 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> SendaoYan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>> 
>>  - Merge branch 'openjdk:master' into jbs8332535
>>  - 8332535: Mark java/nio/channels/DatagramChannel/Loopback.java as intermittent
>>    
>>    Signed-off-by: sendaoYan <yansendao.ysd at alibaba-inc.com>
>
> test/jdk/java/nio/channels/DatagramChannel/Loopback.java line 164:
> 
>> 162:                             System.out.format("received %s from %s%n", dst, sender);
>> 163:                             senderPort = ((InetSocketAddress) sender).getPort();
>> 164:                             assertTrue(senderPort != localPort, "Unexpected message: localPort=" + localPort);
> 
> I wonder if we should add some entropy to the message content and discard any message that we receive whose payload doesn't match what we expect.

Do you mean like this:

-            ByteBuffer src = ByteBuffer.wrap("hello".getBytes("UTF-8"));
+            String str = "hello integer" + new Random().nextInt(10000);
+            ByteBuffer src = ByteBuffer.wrap(str.getBytes("UTF-8"));

And I don't known how to discard meaasge doesn't match what we expect.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19314#discussion_r1653092896


More information about the nio-dev mailing list