RFR: 8334297: (so) java/nio/channels/SocketChannel/OpenLeak.java should not depend on SecurityManager [v5]

Alan Bateman alanb at openjdk.org
Tue Jun 18 11:43:14 UTC 2024


On Tue, 18 Jun 2024 11:10:05 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> test/jdk/java/nio/channels/SocketChannel/OpenLeak.java line 109:
>> 
>>> 107:         cases.add(new Object[]{sa, UnresolvedAddressException.class});
>>> 108:         cases.add(new Object[]{isa, ConnectException.class});
>>> 109:         return cases;
>> 
>> A somewhat subjective comment but I don't think I would add the SocketAddress to the list of test cases when its value is null. So if there isn't a suitable port then it would just reduce the set of test cases.
>
> The reason I do that is to record the testcase for ConnectException as aborted (Assumptions.abort will be called, and it will appear in the summary). But maybe that's not useful? There are only two test cases anyway: one for unresolved address and one for connection refused.

Using assume to test the runtime or some configuration before running a test is fine. It's just a bit unusual here that the method source produces a test case that can't be used. I don't object to the current version, just a bit unusual to see this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19723#discussion_r1644322791


More information about the nio-dev mailing list