Skip to content

Apache Lucene open-source search software

tests: set a socket timeout on replicator tests (#14457)

Robert Muirdda4042b8bac
diff --git a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/Connection.java b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/Connection.java
index 2dbcff3b3b5..79df4b9c994 100644
--- a/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/Connection.java
+++ b/lucene/replicator/src/test/org/apache/lucene/replicator/nrt/Connection.java
@@ -41,6 +41,7 @@ class Connection implements Closeable {
public Connection(int tcpPort) throws IOException {
this.destTCPPort = tcpPort;
this.s = new Socket(InetAddress.getLoopbackAddress(), tcpPort);
+ this.s.setSoTimeout(30000);
this.sockIn = s.getInputStream();
this.in = new InputStreamDataInput(sockIn);
this.bos = new BufferedOutputStream(s.getOutputStream());