Skip to content

Commit 6f115e7

Browse files
committed
Fix timeout issues
1 parent 4ee99e0 commit 6f115e7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

integration-tests/src/test/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousPagingIT.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import java.time.Duration;
4444
import java.util.Collections;
4545
import java.util.Iterator;
46+
import java.util.Objects;
4647
import java.util.concurrent.CancellationException;
4748
import java.util.concurrent.CompletableFuture;
4849
import java.util.concurrent.CompletionStage;
@@ -183,7 +184,10 @@ public void simple_statement_paging_should_be_resilient_to_schema_change() {
183184
.getDefaultProfile()
184185
.withInt(DseDriverOption.CONTINUOUS_PAGING_MAX_ENQUEUED_PAGES, 1)
185186
.withInt(DseDriverOption.CONTINUOUS_PAGING_PAGE_SIZE, 1)
186-
.withInt(DefaultDriverOption.REQUEST_TIMEOUT, 120000000);
187+
.withDuration(
188+
DseDriverOption.CONTINUOUS_PAGING_TIMEOUT_FIRST_PAGE, Duration.ofSeconds(30))
189+
.withDuration(
190+
DseDriverOption.CONTINUOUS_PAGING_TIMEOUT_OTHER_PAGES, Duration.ofSeconds(30));
187191
ContinuousResultSet result = session.executeContinuously(simple.setExecutionProfile(profile));
188192
Iterator<Row> it = result.iterator();
189193
// First row should have a non-null values.
@@ -193,11 +197,7 @@ public void simple_statement_paging_should_be_resilient_to_schema_change() {
193197
// Make schema change to add b, its metadata should NOT be present in subsequent rows.
194198
CqlSession schemaChangeSession =
195199
SessionUtils.newSession(
196-
ccmRule,
197-
session.getKeyspace().orElseThrow(IllegalStateException::new),
198-
SessionUtils.configLoaderBuilder()
199-
.withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30))
200-
.build());
200+
ccmRule, session.getKeyspace().orElseThrow(IllegalStateException::new));
201201
SimpleStatement statement =
202202
SimpleStatement.newInstance("ALTER TABLE test_prepare add b int")
203203
.setExecutionProfile(sessionRule.slowProfile());
@@ -251,7 +251,11 @@ public void prepared_statement_paging_should_be_resilient_to_schema_change() {
251251
.getConfig()
252252
.getDefaultProfile()
253253
.withInt(DseDriverOption.CONTINUOUS_PAGING_MAX_ENQUEUED_PAGES, 1)
254-
.withInt(DseDriverOption.CONTINUOUS_PAGING_PAGE_SIZE, 1);
254+
.withInt(DseDriverOption.CONTINUOUS_PAGING_PAGE_SIZE, 1)
255+
.withDuration(
256+
DseDriverOption.CONTINUOUS_PAGING_TIMEOUT_FIRST_PAGE, Duration.ofSeconds(30))
257+
.withDuration(
258+
DseDriverOption.CONTINUOUS_PAGING_TIMEOUT_OTHER_PAGES, Duration.ofSeconds(30));
255259
ContinuousResultSet result =
256260
session.executeContinuously(prepared.bind("foo").setExecutionProfile(profile));
257261
Iterator<Row> it = result.iterator();
@@ -262,11 +266,7 @@ public void prepared_statement_paging_should_be_resilient_to_schema_change() {
262266
// Make schema change to drop v, its metadata should be present, values will be null.
263267
CqlSession schemaChangeSession =
264268
SessionUtils.newSession(
265-
ccmRule,
266-
session.getKeyspace().orElseThrow(IllegalStateException::new),
267-
SessionUtils.configLoaderBuilder()
268-
.withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30))
269-
.build());
269+
ccmRule, session.getKeyspace().orElseThrow(IllegalStateException::new));
270270
schemaChangeSession.execute("ALTER TABLE test_prep DROP v;");
271271
while (it.hasNext()) {
272272
// Each row should have a value for k, v should still be present, but null since column was
@@ -276,7 +276,7 @@ public void prepared_statement_paging_should_be_resilient_to_schema_change() {
276276
if (ccmRule
277277
.getDseVersion()
278278
.orElseThrow(IllegalStateException::new)
279-
.compareTo(Version.parse("6.0.0"))
279+
.compareTo(Objects.requireNonNull(Version.parse("6.0.0")))
280280
>= 0) {
281281
// DSE 6 only, v should be null here since dropped.
282282
// Not reliable for 5.1 since we may have gotten page queued before schema changed.

0 commit comments

Comments
 (0)