43
43
import java .time .Duration ;
44
44
import java .util .Collections ;
45
45
import java .util .Iterator ;
46
+ import java .util .Objects ;
46
47
import java .util .concurrent .CancellationException ;
47
48
import java .util .concurrent .CompletableFuture ;
48
49
import java .util .concurrent .CompletionStage ;
@@ -183,7 +184,10 @@ public void simple_statement_paging_should_be_resilient_to_schema_change() {
183
184
.getDefaultProfile ()
184
185
.withInt (DseDriverOption .CONTINUOUS_PAGING_MAX_ENQUEUED_PAGES , 1 )
185
186
.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 ));
187
191
ContinuousResultSet result = session .executeContinuously (simple .setExecutionProfile (profile ));
188
192
Iterator <Row > it = result .iterator ();
189
193
// First row should have a non-null values.
@@ -193,11 +197,7 @@ public void simple_statement_paging_should_be_resilient_to_schema_change() {
193
197
// Make schema change to add b, its metadata should NOT be present in subsequent rows.
194
198
CqlSession schemaChangeSession =
195
199
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 ));
201
201
SimpleStatement statement =
202
202
SimpleStatement .newInstance ("ALTER TABLE test_prepare add b int" )
203
203
.setExecutionProfile (sessionRule .slowProfile ());
@@ -251,7 +251,11 @@ public void prepared_statement_paging_should_be_resilient_to_schema_change() {
251
251
.getConfig ()
252
252
.getDefaultProfile ()
253
253
.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 ));
255
259
ContinuousResultSet result =
256
260
session .executeContinuously (prepared .bind ("foo" ).setExecutionProfile (profile ));
257
261
Iterator <Row > it = result .iterator ();
@@ -262,11 +266,7 @@ public void prepared_statement_paging_should_be_resilient_to_schema_change() {
262
266
// Make schema change to drop v, its metadata should be present, values will be null.
263
267
CqlSession schemaChangeSession =
264
268
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 ));
270
270
schemaChangeSession .execute ("ALTER TABLE test_prep DROP v;" );
271
271
while (it .hasNext ()) {
272
272
// 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() {
276
276
if (ccmRule
277
277
.getDseVersion ()
278
278
.orElseThrow (IllegalStateException ::new )
279
- .compareTo (Version .parse ("6.0.0" ))
279
+ .compareTo (Objects . requireNonNull ( Version .parse ("6.0.0" ) ))
280
280
>= 0 ) {
281
281
// DSE 6 only, v should be null here since dropped.
282
282
// Not reliable for 5.1 since we may have gotten page queued before schema changed.
0 commit comments