RFR: JDK-8313804: JDWP support for -Djava.net.preferIPv6Addresses=system [v7]

Liam Miller-Cushon cushon at openjdk.org
Fri Sep 22 00:02:04 UTC 2023


On Thu, 21 Sep 2023 20:28:02 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add more test cases
>
> test/jdk/com/sun/jdi/JdwpNetProps.java line 89:
> 
>> 87:                     .preferIPv4Stack(false)
>> 88:                     .preferIPv6Addresses("true")
>> 89:                     .run(TestResult.AttachFailed);
> 
> If test system is IPv4-only, this testcase will success
> So it should be under "ipv6Address != null" section

Thanks, done

I had been testing on dual-stack on IPv6-only, which missed that. I confirmed I could repro the expected failure with IPv4-only.

> test/jdk/com/sun/jdi/JdwpNetProps.java line 133:
> 
>> 131:                     .run(TestResult.ListenFailed);
>> 132:             new ListenTest("localhost", ipv6Address)
>> 133:                     .run(TestResult.ListenFailed);
> 
> this is IPv6-only system and testcase tries to attach from IPv6 address. It should succeed.

Done

I was trying to test the IPv6-only cases using an `LD_PRELOAD` trick and a dual-stack machine, and this test case was incorrectly passing in that environment. I improved the way I was testing IPv6-only and was able to observe it passing.

> test/jdk/com/sun/jdi/JdwpNetProps.java line 136:
> 
>> 134:             new ListenTest("localhost", ipv6Address)
>> 135:                     .preferIPv6Addresses("system")
>> 136:                     .run(systemPrefersIPv6 ? TestResult.Success : TestResult.AttachFailed);
> 
> this is IPv6-only system, so systemPrefersIPv6 cannot be false

Thanks, I removed the conditional and added an assertion that systemPrefersIPv6 if we get here

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15796#discussion_r1333707121
PR Review Comment: https://git.openjdk.org/jdk/pull/15796#discussion_r1333707428
PR Review Comment: https://git.openjdk.org/jdk/pull/15796#discussion_r1333707485


More information about the serviceability-dev mailing list