Skip to content

Commit 647a48f

Browse files
author
Michael Penick
committed
Fix speculative execution metrics test
1 parent aefd2b8 commit 647a48f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/src/integration/tests/test_metrics.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "integration.hpp"
1818

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"
2020
#define SPECULATIVE_EXECUTION_CREATE_TIMEOUT_UDF_FORMAT \
2121
"CREATE OR REPLACE FUNCTION %s.timeout(arg int) " \
2222
"RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java " \
@@ -151,20 +151,21 @@ CASSANDRA_INTEGRATION_TEST_F(MetricsTests, SpeculativeExecutionRequests) {
151151
CHECK_FAILURE;
152152
CHECK_VERSION(2.2.0);
153153

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();
155155

156156
session.execute(format_string(CASSANDRA_KEY_VALUE_QUALIFIED_TABLE_FORMAT, keyspace_name_.c_str(),
157157
table_name_.c_str(), "int", "int"));
158158
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"));
160160
session.execute(
161161
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));
163164
statement.set_idempotent(true);
164165
statement.set_request_timeout(30000);
165166

166167
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) {
168169
session.execute_async(statement);
169170
metrics = session.speculative_execution_metrics();
170171
msleep(100);

0 commit comments

Comments
 (0)