Skip to content

Commit

Permalink
[FLINK-25147] add keyspace drop because the docker image is reused an…
Browse files Browse the repository at this point in the history
…d modified by the tests.
  • Loading branch information
echauchot authored and tillrohrmann committed Dec 29, 2021
1 parent bd11bbc commit cb73172
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ protected Cluster buildCluster(Cluster.Builder builder) {
private static final String TABLE_NAME_VARIABLE = "$TABLE";
private static final String CREATE_KEYSPACE_QUERY =
"CREATE KEYSPACE flink WITH replication= {'class':'SimpleStrategy', 'replication_factor':1};";
private static final String DROP_KEYSPACE_QUERY =
"DROP KEYSPACE IF EXISTS flink ;";
private static final String CREATE_TABLE_QUERY =
"CREATE TABLE flink."
+ TABLE_NAME_VARIABLE
Expand Down Expand Up @@ -163,9 +165,11 @@ public static CassandraContainer createCassandraContainer() {

@BeforeClass
public static void startAndInitializeCassandra() {
// CASSANDRA_CONTAINER#start() already contains retrials
CASSANDRA_CONTAINER.start();
cluster = CASSANDRA_CONTAINER.getCluster();
session = cluster.connect();
session.execute(DROP_KEYSPACE_QUERY);
session.execute(CREATE_KEYSPACE_QUERY);
session.execute(
CREATE_TABLE_QUERY.replace(TABLE_NAME_VARIABLE, TABLE_NAME_PREFIX + "initial"));
Expand Down

0 comments on commit cb73172

Please sign in to comment.