You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/03/31 12:27:53 UTC

[GitHub] [cassandra] adelapena commented on a change in pull request #945: CASSANDRA-16546 Fix flaky testRecoverOverflowedExpirationWithSSTableS…

adelapena commented on a change in pull request #945:
URL: https://github.com/apache/cassandra/pull/945#discussion_r604850593



##########
File path: test/unit/org/apache/cassandra/cql3/validation/operations/TTLTest.java
##########
@@ -422,18 +422,29 @@ public void testRecoverOverflowedExpirationWithScrub(boolean simple, boolean clu
                 else
                     tool = ToolRunner.invokeClass(StandaloneScrubber.class, KEYSPACE, cfs.name);
 
+                tool.assertOnCleanExit();
                 Assertions.assertThat(tool.getStdout()).contains("Pre-scrub sstables snapshotted into");
                 if (reinsertOverflowedTTL)
                     Assertions.assertThat(tool.getStdout()).contains("Fixed 2 rows with overflowed local deletion time.");
                 else
                     Assertions.assertThat(tool.getStdout()).contains("Unable to recover 2 rows that were skipped.");
-                tool.assertOnCleanExit();
             }
             finally
             {
                 System.clearProperty(org.apache.cassandra.tools.Util.ALLOW_TOOL_REINIT_FOR_TEST);
             }
         }
+
+        try
+        {
+            dropTable("DROP TABLE %s");
+        }
+        catch(Throwable e)
+        {
+            // StandaloneScrubber.class should be ran as a tool with a stable env. In a test env there are things moving
+            // under it's feet such as the async CQLTester.afterTest() operations. We try to sync cleanup of tables here

Review comment:
       ```suggestion
               // under its feet such as the async CQLTester.afterTest() operations. We try to sync cleanup of tables here
   ```

##########
File path: test/unit/org/apache/cassandra/cql3/validation/operations/TTLTest.java
##########
@@ -422,18 +422,29 @@ public void testRecoverOverflowedExpirationWithScrub(boolean simple, boolean clu
                 else
                     tool = ToolRunner.invokeClass(StandaloneScrubber.class, KEYSPACE, cfs.name);
 
+                tool.assertOnCleanExit();

Review comment:
       Good idea

##########
File path: test/unit/org/apache/cassandra/cql3/validation/operations/TTLTest.java
##########
@@ -422,18 +422,29 @@ public void testRecoverOverflowedExpirationWithScrub(boolean simple, boolean clu
                 else
                     tool = ToolRunner.invokeClass(StandaloneScrubber.class, KEYSPACE, cfs.name);
 
+                tool.assertOnCleanExit();
                 Assertions.assertThat(tool.getStdout()).contains("Pre-scrub sstables snapshotted into");
                 if (reinsertOverflowedTTL)
                     Assertions.assertThat(tool.getStdout()).contains("Fixed 2 rows with overflowed local deletion time.");
                 else
                     Assertions.assertThat(tool.getStdout()).contains("Unable to recover 2 rows that were skipped.");
-                tool.assertOnCleanExit();
             }
             finally
             {
                 System.clearProperty(org.apache.cassandra.tools.Util.ALLOW_TOOL_REINIT_FOR_TEST);
             }
         }
+
+        try
+        {
+            dropTable("DROP TABLE %s");
+        }
+        catch(Throwable e)

Review comment:
       Super nit:
   ```suggestion
           catch (Throwable e)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org