[RFR] 8224645: Test java/nio/channels/DatagramChannel/BasicMulticastTests.java fails with NoSuchElementException
Chris Hegarty
chris.hegarty at oracle.com
Wed May 29 08:19:02 UTC 2019
> On 29 May 2019, at 08:40, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> On 29/05/2019 08:28, Daniel Fuchs wrote:
>>
>> Would you prefer to throw AssertionError instead? It's also
>> a possibility. Chris thought it might be "too strong".
> It might be odd to have a test system configured without multicast enabled but it's not wrong. So I think the test should pass.
Right, that was my thought too.
It is useful to be able to scan a collection of jtr files and
differentiate between a test that did nothing ( and passed silently )
from a test that actually did do something. Using SkippedException will
make this task a little easier - which could then be used to identify
possibly misconfigured systems.
The test already has a test library dependency, so the addition of
SkippedException does not introduce any new significant burden
for standalone testing.
>> :
>>
>> Right - printing interfaces before testing them would be useful.
>> But printing all interfaces if no multicast was found is useful
>> too - it might help figure out why the test was not run.
>>
> I think it would be useful for tests such as this one to print the network interface configuration at the start. That might be something for a supporting method in jdk.test.lib.NetworkConfiguration (if there isn't anything already).
This already exists.
NetworkConfiguration.printSystemConfiguration(PrintStream)
I think there needs to be a balance between readability and
diagnosability. It's often the case that much debugging statements are
added to a test when investigating a failure. It's good to have some
breadcrumbs to follow when things go wrong, but it should not complicate
the code too much.
It might be useful to just unconditionally printSystemConfiguration, at
the start of the test, and then the nic in use for each iteration. I
don't think anything more is needed.
-Chris.
More information about the net-dev
mailing list