This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2ff4569  Make driver timeouts configurable and increase them for 
CqlTester
2ff4569 is described below

commit 2ff456953fd91f36c9ef8e5c50e9e801c38e7dc7
Author: jacek-lewandowski <[email protected]>
AuthorDate: Fri Mar 12 10:12:08 2021 +0100

    Make driver timeouts configurable and increase them for CqlTester
    
    Patch by Jacek Lewandowski; reviewed by brandonwilliams for
    CASSANDRA-16514
---
 build.xml                                          |  4 ++++
 test/unit/org/apache/cassandra/cql3/CQLTester.java | 11 ++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index ee06a6d..cad0044 100644
--- a/build.xml
+++ b/build.xml
@@ -65,6 +65,8 @@
     <property name="test.microbench.src" value="${test.dir}/microbench"/>
     <property name="test.distributed.src" value="${test.dir}/distributed"/>
     <property name="test.compression_algo" value="LZ4"/>
+    <property name="test.driver.connection_timeout_ms" value="5000"/>
+    <property name="test.driver.read_timeout_ms" value="12000"/>
     <property name="test.distributed.listfile" value="ant-jvm-dtest-list"/>
     <property name="test.distributed.upgrade.listfile" 
value="ant-jvm-dtest-upgrade-list"/>
     <property name="test.distributed.upgrade.package" 
value="org.apache.cassandra.distributed.upgrade"/>
@@ -1496,6 +1498,8 @@
              more aggressively rather than waiting. See CASSANDRA-14922 for 
more details.
         -->
         <jvmarg value="-XX:SoftRefLRUPolicyMSPerMB=0" />
+        <jvmarg 
value="-Dcassandra.test.driver.connection_timeout_ms=${test.driver.connection_timeout_ms}"/>
+        <jvmarg 
value="-Dcassandra.test.driver.read_timeout_ms=${test.driver.read_timeout_ms}"/>
         <jvmarg 
value="-Dcassandra.memtable_row_overhead_computation_step=100"/>
         <jvmarg 
value="-Dcassandra.test.use_prepared=${cassandra.test.use_prepared}"/>
         <jvmarg value="-Dcassandra.test.offsetseed=@{poffset}"/>
diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java 
b/test/unit/org/apache/cassandra/cql3/CQLTester.java
index 96cd105..14f7a41 100644
--- a/test/unit/org/apache/cassandra/cql3/CQLTester.java
+++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java
@@ -88,6 +88,8 @@ import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.JMXServerUtils;
 
+import static 
com.datastax.driver.core.SocketOptions.DEFAULT_CONNECT_TIMEOUT_MILLIS;
+import static 
com.datastax.driver.core.SocketOptions.DEFAULT_READ_TIMEOUT_MILLIS;
 import static junit.framework.Assert.assertNotNull;
 
 /**
@@ -455,11 +457,18 @@ public abstract class CQLTester
             if (clusters.containsKey(version))
                 continue;
 
+            SocketOptions socketOptions = new SocketOptions()
+                                          
.setConnectTimeoutMillis(Integer.getInteger("cassandra.test.driver.connection_timeout_ms",
 DEFAULT_CONNECT_TIMEOUT_MILLIS)) // default is 5000
+                                          
.setReadTimeoutMillis(Integer.getInteger("cassandra.test.driver.read_timeout_ms",
 DEFAULT_READ_TIMEOUT_MILLIS)); // default is 12000
+
+            logger.info("Timeouts: {} / {}", 
socketOptions.getConnectTimeoutMillis(), socketOptions.getReadTimeoutMillis());
+
             Cluster.Builder builder = Cluster.builder()
                                              .withoutJMXReporting()
                                              .addContactPoints(nativeAddr)
                                              .withClusterName("Test Cluster")
-                                             .withPort(nativePort);
+                                             .withPort(nativePort)
+                                             .withSocketOptions(socketOptions);
 
             if (version.isBeta())
                 builder = builder.allowBetaProtocolVersion();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to