|
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 " \ |
@@ -76,28 +76,6 @@ CASSANDRA_INTEGRATION_TEST_F(MetricsTests, ErrorsConnectionTimeouts) { |
76 | 76 | EXPECT_GE(2u, metrics.errors.connection_timeouts); |
77 | 77 | } |
78 | 78 |
|
79 | | -/** |
80 | | - * This test ensures that the driver is reporting the proper timeouts for pending requests |
81 | | - * |
82 | | - * @since 2.0.0 |
83 | | - * @jira_ticket CPP-188 |
84 | | - */ |
85 | | -CASSANDRA_INTEGRATION_TEST_F(MetricsTests, ErrorsPendingRequestTimeouts) { |
86 | | - CHECK_FAILURE; |
87 | | - CHECK_VERSION(2.1.2); |
88 | | - |
89 | | - for (int n = 0; n < 1000; ++n) { |
90 | | - session_.execute_async(SELECT_ALL_SYSTEM_LOCAL_CQL); |
91 | | - } |
92 | | - |
93 | | - CassMetrics metrics = session_.metrics(); |
94 | | - for (int i = 0; i < 100 && metrics.errors.pending_request_timeouts == 0; ++i) { |
95 | | - metrics = session_.metrics(); |
96 | | - msleep(100); |
97 | | - } |
98 | | - EXPECT_GT(metrics.errors.pending_request_timeouts, 0u); |
99 | | -} |
100 | | - |
101 | 79 | /** |
102 | 80 | * This test ensures that the driver is reporting the proper timeouts for requests |
103 | 81 | * |
@@ -173,20 +151,21 @@ CASSANDRA_INTEGRATION_TEST_F(MetricsTests, SpeculativeExecutionRequests) { |
173 | 151 | CHECK_FAILURE; |
174 | 152 | CHECK_VERSION(2.2.0); |
175 | 153 |
|
176 | | - 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(); |
177 | 155 |
|
178 | 156 | session.execute(format_string(CASSANDRA_KEY_VALUE_QUALIFIED_TABLE_FORMAT, keyspace_name_.c_str(), |
179 | 157 | table_name_.c_str(), "int", "int")); |
180 | 158 | session.execute(format_string(CASSANDRA_KEY_VALUE_QUALIFIED_INSERT_FORMAT, keyspace_name_.c_str(), |
181 | | - table_name_.c_str(), "0", "1000")); |
| 159 | + table_name_.c_str(), "0", "200")); |
182 | 160 | session.execute( |
183 | 161 | format_string(SPECULATIVE_EXECUTION_CREATE_TIMEOUT_UDF_FORMAT, keyspace_name_.c_str())); |
184 | | - 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)); |
185 | 164 | statement.set_idempotent(true); |
186 | 165 | statement.set_request_timeout(30000); |
187 | 166 |
|
188 | 167 | CassSpeculativeExecutionMetrics metrics = session.speculative_execution_metrics(); |
189 | | - for (int i = 0; i < 600 && metrics.count < 1000u; ++i) { |
| 168 | + for (int i = 0; i < 600 && metrics.count < 10; ++i) { |
190 | 169 | session.execute_async(statement); |
191 | 170 | metrics = session.speculative_execution_metrics(); |
192 | 171 | msleep(100); |
|
0 commit comments