|
16 | 16 |
|
17 | 17 | #include "integration.hpp" |
18 | 18 |
|
19 | | -#define SPECULATIVE_EXECUTION_SELECT_FORMAT "SELECT timeout(value) FROM %s WHERE key=%d" |
| 19 | +#define SPECULATIVE_EXECUTION_SELECT_FORMAT "SELECT timeout(value) FROM %s.%s WHERE key=%d" |
20 | 20 | #define SPECULATIVE_EXECUTION_CREATE_TIMEOUT_UDF_FORMAT \ |
21 | 21 | "CREATE OR REPLACE FUNCTION %s.timeout(arg int) " \ |
22 | 22 | "RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java " \ |
@@ -151,20 +151,21 @@ CASSANDRA_INTEGRATION_TEST_F(MetricsTests, SpeculativeExecutionRequests) { |
151 | 151 | CHECK_FAILURE; |
152 | 152 | CHECK_VERSION(2.2.0); |
153 | 153 |
|
154 | | - Session session = default_cluster().with_constant_speculative_execution_policy(100, 20).connect(); |
| 154 | + Session session = default_cluster().with_constant_speculative_execution_policy(100, 10).connect(); |
155 | 155 |
|
156 | 156 | session.execute(format_string(CASSANDRA_KEY_VALUE_QUALIFIED_TABLE_FORMAT, keyspace_name_.c_str(), |
157 | 157 | table_name_.c_str(), "int", "int")); |
158 | 158 | session.execute(format_string(CASSANDRA_KEY_VALUE_QUALIFIED_INSERT_FORMAT, keyspace_name_.c_str(), |
159 | | - table_name_.c_str(), "0", "1000")); |
| 159 | + table_name_.c_str(), "0", "200")); |
160 | 160 | session.execute( |
161 | 161 | format_string(SPECULATIVE_EXECUTION_CREATE_TIMEOUT_UDF_FORMAT, keyspace_name_.c_str())); |
162 | | - Statement statement(format_string(SPECULATIVE_EXECUTION_SELECT_FORMAT, table_name_.c_str(), 0)); |
| 162 | + Statement statement(format_string(SPECULATIVE_EXECUTION_SELECT_FORMAT, keyspace_name_.c_str(), |
| 163 | + table_name_.c_str(), 0)); |
163 | 164 | statement.set_idempotent(true); |
164 | 165 | statement.set_request_timeout(30000); |
165 | 166 |
|
166 | 167 | CassSpeculativeExecutionMetrics metrics = session.speculative_execution_metrics(); |
167 | | - for (int i = 0; i < 600 && metrics.count < 1000u; ++i) { |
| 168 | + for (int i = 0; i < 600 && metrics.count < 10; ++i) { |
168 | 169 | session.execute_async(statement); |
169 | 170 | metrics = session.speculative_execution_metrics(); |
170 | 171 | msleep(100); |
|
0 commit comments