Skip to content

Commit 778dd3d

Browse files
committed
Uncomment test.
1 parent 050db87 commit 778dd3d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

utils/socket-utils/src/test/java/datadog/common/socket/TunnelingJdkSocketTest.java

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package datadog.common.socket;
22

3+
import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
4+
35
import java.io.IOException;
46
import java.net.InetSocketAddress;
57
import java.net.StandardProtocolFamily;
@@ -8,6 +10,7 @@
810
import java.nio.channels.SocketChannel;
911
import java.nio.file.Files;
1012
import java.nio.file.Path;
13+
import java.time.Duration;
1114
import java.util.concurrent.atomic.AtomicBoolean;
1215
import org.junit.jupiter.api.Test;
1316

@@ -19,16 +22,16 @@ public class TunnelingJdkSocketTest {
1922

2023
@Test
2124
public void testTimeout() throws Exception {
22-
// Path socketPath = getSocketPath();
23-
// UnixDomainSocketAddress socketAddress = UnixDomainSocketAddress.of(socketPath);
24-
// startServer(socketAddress);
25-
// TunnelingJdkSocket clientSocket = createClient(socketPath);
26-
//
27-
// assertTimeoutPreemptively(
28-
// Duration.ofMillis(testTimeout), () -> clientSocket.getInputStream().read());
29-
//
30-
// clientSocket.close();
31-
// isServerRunning.set(false);
25+
Path socketPath = getSocketPath();
26+
UnixDomainSocketAddress socketAddress = UnixDomainSocketAddress.of(socketPath);
27+
startServer(socketAddress);
28+
TunnelingJdkSocket clientSocket = createClient(socketPath);
29+
30+
assertTimeoutPreemptively(
31+
Duration.ofMillis(testTimeout), () -> clientSocket.getInputStream().read());
32+
33+
clientSocket.close();
34+
isServerRunning.set(false);
3235
}
3336

3437
private Path getSocketPath() throws IOException {

0 commit comments

Comments
 (0)