Skip to content

Commit

Permalink
Use a CustomCcmRule in HeapCompressionIT
Browse files Browse the repository at this point in the history
We have a check that CcmRule is used only in parallelizable test
(actually it would work in isolated tests as well, but it's just as easy
to change this test).
  • Loading branch information
olim7t committed Jun 1, 2018
1 parent 53f5cc7 commit a0a0ff9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Expand Up @@ -22,7 +22,7 @@
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import com.datastax.oss.driver.categories.IsolatedTests;
Expand All @@ -39,7 +39,7 @@ public class HeapCompressionIT {
System.setProperty("io.netty.noUnsafe", "true");
}

@ClassRule public static CcmRule ccmRule = CcmRule.getInstance();
@ClassRule public static CustomCcmRule ccmRule = CustomCcmRule.builder().build();

@ClassRule
public static SessionRule<CqlSession> schemaSessionRule =
Expand Down
Expand Up @@ -16,6 +16,7 @@
package com.datastax.oss.driver.api.testinfra.session;

import com.datastax.oss.driver.api.core.CqlIdentifier;
import com.datastax.oss.driver.api.core.NoNodeAvailableException;
import com.datastax.oss.driver.api.core.config.DriverConfigProfile;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.core.cql.Statement;
Expand Down Expand Up @@ -116,7 +117,13 @@ protected void before() {
@Override
protected void after() {
if (keyspace != null) {
SessionUtils.dropKeyspace(session, keyspace, slowProfile);
try {
SessionUtils.dropKeyspace(session, keyspace, slowProfile);
} catch (NoNodeAvailableException e) {
// Rule ordering is not deterministic, so the cassandraResource might have shut down
// already. Dropping the keyspace is not critical since we're throwing the cluster away, so
// just ignore.
}
}
session.close();
}
Expand Down

0 comments on commit a0a0ff9

Please sign in to comment.