Skip to content

Commit c94e39c

Browse files
committed
Fix Parallelizable Tests for DSE 6.8
- Add checklogerror output to CcmBridge - Move DefaultReactiveGraphResultSetIT to serial ITs - Adjust SASI tests for 6.8.0
1 parent 22296c6 commit c94e39c

File tree

4 files changed

+41
-7
lines changed

4 files changed

+41
-7
lines changed

integration-tests/src/test/java/com/datastax/dse/driver/api/core/graph/reactive/DefaultReactiveGraphResultSetIT.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.datastax.oss.driver.api.testinfra.DseRequirement;
2727
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
2828
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
29-
import com.datastax.oss.driver.categories.ParallelizableTests;
3029
import com.tngtech.java.junit.dataprovider.DataProvider;
3130
import com.tngtech.java.junit.dataprovider.DataProviderRunner;
3231
import io.reactivex.Flowable;
@@ -36,14 +35,12 @@
3635
import org.junit.BeforeClass;
3736
import org.junit.ClassRule;
3837
import org.junit.Test;
39-
import org.junit.experimental.categories.Category;
4038
import org.junit.rules.RuleChain;
4139
import org.junit.rules.TestRule;
4240
import org.junit.runner.RunWith;
4341

4442
@DseRequirement(min = "6.8.0", description = "Graph paging requires DSE 6.8+")
4543
@RunWith(DataProviderRunner.class)
46-
@Category(ParallelizableTests.class)
4744
public class DefaultReactiveGraphResultSetIT {
4845

4946
private static CustomCcmRule ccmRule = CustomCcmRule.builder().withDseWorkloads("graph").build();

integration-tests/src/test/java/com/datastax/oss/driver/mapper/InventoryITBase.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList;
2525
import java.util.List;
2626
import java.util.Objects;
27+
import java.util.Optional;
2728
import java.util.UUID;
2829

2930
/** Factors common code for mapper tests that rely on a simple inventory model. */
@@ -66,7 +67,7 @@ protected static List<String> createStatements(CcmRule ccmRule) {
6667
"CREATE TABLE product_sale(id uuid, day text, ts uuid, customer_id int, price "
6768
+ "double, count int, PRIMARY KEY ((id, day), customer_id, ts))");
6869

69-
if (supportsSASI(ccmRule)) {
70+
if (supportsSASI(ccmRule) && !isSasiBroken(ccmRule)) {
7071
builder.add(
7172
"CREATE CUSTOM INDEX product_description ON product(description) "
7273
+ "USING 'org.apache.cassandra.index.sasi.SASIIndex' "
@@ -85,6 +86,13 @@ protected static List<String> createStatements(CcmRule ccmRule) {
8586
}
8687

8788
private static final Version MINIMUM_SASI_VERSION = Version.parse("3.4.0");
89+
private static final Version BROKEN_SASI_VERSION = Version.parse("6.8.0");
90+
91+
protected static boolean isSasiBroken(CcmRule ccmRule) {
92+
Optional<Version> dseVersion = ccmRule.getDseVersion();
93+
// creating SASI indexes is broken in DSE 6.8.0
94+
return dseVersion.isPresent() && dseVersion.get().compareTo(BROKEN_SASI_VERSION) == 0;
95+
}
8896

8997
protected static boolean supportsSASI(CcmRule ccmRule) {
9098
return ccmRule.getCassandraVersion().compareTo(MINIMUM_SASI_VERSION) >= 0;

integration-tests/src/test/java/com/datastax/oss/driver/mapper/SelectCustomWhereClauseIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.datastax.oss.driver.mapper;
1717

1818
import static com.datastax.oss.driver.assertions.Assertions.assertThat;
19+
import static org.junit.Assume.assumeFalse;
1920

2021
import com.datastax.oss.driver.api.core.CqlIdentifier;
2122
import com.datastax.oss.driver.api.core.CqlSession;
@@ -58,6 +59,10 @@ public class SelectCustomWhereClauseIT extends InventoryITBase {
5859

5960
@BeforeClass
6061
public static void setup() {
62+
// SASI index creation is broken in DSE 6.8.0
63+
// All tests in this class require SASI, so ensure it's working
64+
assumeFalse(InventoryITBase.isSasiBroken(CCM_RULE));
65+
6166
CqlSession session = SESSION_RULE.session();
6267

6368
for (String query : createStatements(CCM_RULE)) {

test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/CcmBridge.java

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,13 @@ public void reloadCore(int node, String keyspace, String table, boolean reindex)
262262

263263
public void start() {
264264
if (started.compareAndSet(false, true)) {
265-
execute("start", jvmArgs, "--wait-for-binary-proto");
265+
try {
266+
execute("start", jvmArgs, "--wait-for-binary-proto");
267+
} catch (RuntimeException re) {
268+
// if something went wrong starting CCM, see if we can also dump the error
269+
executeCheckLogError();
270+
throw re;
271+
}
266272
}
267273
}
268274

@@ -315,13 +321,31 @@ synchronized void executeUnsanitized(String... args) {
315321
}
316322

317323
private void execute(CommandLine cli) {
318-
logger.debug("Executing: " + cli);
324+
execute(cli, false);
325+
}
326+
327+
private void executeCheckLogError() {
328+
String command = "ccm checklogerror --config-dir=" + configDirectory.toFile().getAbsolutePath();
329+
// force all logs to be error logs
330+
execute(CommandLine.parse(command), true);
331+
}
332+
333+
private void execute(CommandLine cli, boolean forceErrorLogging) {
334+
if (forceErrorLogging) {
335+
logger.error("Executing: " + cli);
336+
} else {
337+
logger.debug("Executing: " + cli);
338+
}
319339
ExecuteWatchdog watchDog = new ExecuteWatchdog(TimeUnit.MINUTES.toMillis(10));
320340
try (LogOutputStream outStream =
321341
new LogOutputStream() {
322342
@Override
323343
protected void processLine(String line, int logLevel) {
324-
logger.debug("ccmout> {}", line);
344+
if (forceErrorLogging) {
345+
logger.error("ccmout> {}", line);
346+
} else {
347+
logger.debug("ccmout> {}", line);
348+
}
325349
}
326350
};
327351
LogOutputStream errStream =

0 commit comments

Comments
 (0)