This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 3bb6fa3  [FLINK-25771][cassandra][tests] Remove keyspace drop
3bb6fa3 is described below

commit 3bb6fa31fbeed5319c9526105ffe26c3ae525ed7
Author: Etienne Chauchot <echauc...@apache.org>
AuthorDate: Tue Mar 15 11:01:10 2022 +0100

    [FLINK-25771][cassandra][tests] Remove keyspace drop
    
    Since each test uses a separate table we no longer need to re-create the 
keyspace for each run, reducing the load on the cluster.
---
 .../cassandra/CassandraConnectorITCase.java           | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git 
a/flink-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java
 
b/flink-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java
index 924c684..de14e86 100644
--- 
a/flink-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java
+++ 
b/flink-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java
@@ -62,7 +62,6 @@ import com.datastax.driver.mapping.annotations.Table;
 import net.bytebuddy.ByteBuddy;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
-import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Before;
@@ -165,9 +164,6 @@ public class CassandraConnectorITCase
             "CREATE KEYSPACE "
                     + KEYSPACE
                     + " WITH replication= {'class':'SimpleStrategy', 
'replication_factor':1};";
-    private static final String DROP_KEYSPACE_QUERY = "DROP KEYSPACE IF EXISTS 
" + KEYSPACE + " ;";
-    private static final String DROP_TABLE_QUERY =
-            "DROP TABLE IF EXISTS " + KEYSPACE + "." + TABLE_NAME_VARIABLE + " 
;";
     private static final String CREATE_TABLE_QUERY =
             "CREATE TABLE "
                     + KEYSPACE
@@ -386,10 +382,7 @@ public class CassandraConnectorITCase
                 }
             }
         }
-        session.execute(DROP_KEYSPACE_QUERY);
         session.execute(CREATE_KEYSPACE_QUERY);
-        session.execute(
-                CREATE_TABLE_QUERY.replace(TABLE_NAME_VARIABLE, 
TABLE_NAME_PREFIX + "initial"));
     }
 
     @Before
@@ -398,14 +391,6 @@ public class CassandraConnectorITCase
         session.execute(injectTableName(CREATE_TABLE_QUERY));
     }
 
-    @After
-    public void dropTables() {
-        // need to drop tables in case of retrials. Need to drop all the tables
-        // that are created in test because this method is executed with every 
test
-        session.execute(DROP_KEYSPACE_QUERY);
-        session.execute(CREATE_KEYSPACE_QUERY);
-    }
-
     @AfterClass
     public static void closeCassandra() {
         if (session != null) {
@@ -722,9 +707,7 @@ public class CassandraConnectorITCase
     private static int retrialsCount = 0;
 
     @Test
-    public void testRetrialAndDropTables() {
-        // should not fail with table exists upon retrial
-        // as @After method that truncate the keyspace is called upon retrials.
+    public void testRetrial() {
         annotatePojoWithTable(KEYSPACE, TABLE_NAME_PREFIX + tableID);
         if (retrialsCount < 2) {
             retrialsCount++;

Reply via email to