Skip to content

Commit fb659eb

Browse files
Volkan YaziciMichael-Mc-Mahon
Volkan Yazici
authored andcommittedFeb 28, 2025
8350915: [JMH] test SocketChannelConnectionSetup failed for 2 threads config
Reviewed-by: michaelm
1 parent 3a7d986 commit fb659eb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed
 

‎test/micro/org/openjdk/bench/java/net/SocketChannelConnectionSetup.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,8 @@
2323
package org.openjdk.bench.java.net;
2424

2525
import java.io.IOException;
26-
import java.net.InetAddress;
27-
import java.net.InetSocketAddress;
2826
import java.net.StandardProtocolFamily;
2927
import java.net.UnixDomainSocketAddress;
30-
import java.nio.channels.ClosedChannelException;
3128
import java.nio.channels.ServerSocketChannel;
3229
import java.nio.channels.SocketChannel;
3330
import java.nio.file.*;
@@ -80,7 +77,6 @@ else if (family.equals("unix"))
8077

8178

8279
private ServerSocketChannel getInetServerSocketChannel() throws IOException {
83-
InetAddress iaddr = InetAddress.getLoopbackAddress();
8480
return ServerSocketChannel.open().bind(null);
8581
}
8682

@@ -97,11 +93,11 @@ public void beforeRun() throws IOException {
9793
}
9894

9995
@TearDown(Level.Trial)
100-
public void afterRun() throws IOException, InterruptedException {
96+
public void afterRun() throws IOException {
10197
ssc.close();
10298
if (family.equals("unix")) {
103-
Files.delete(socket);
104-
Files.delete(Path.of(tempDir));
99+
Files.deleteIfExists(socket);
100+
Files.deleteIfExists(Path.of(tempDir));
105101
}
106102
}
107103

0 commit comments

Comments
 (0)
Please sign in to comment.