[ 
https://issues.apache.org/jira/browse/BEAM-8025?focusedWorklogId=429430&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-429430
 ]

ASF GitHub Bot logged work on BEAM-8025:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/May/20 10:16
            Start Date: 01/May/20 10:16
    Worklog Time Spent: 10m 
      Work Description: mxm commented on a change in pull request #11578:
URL: https://github.com/apache/beam/pull/11578#discussion_r418487133



##########
File path: 
sdks/java/io/cassandra/src/test/java/org/apache/beam/sdk/io/cassandra/CassandraIOTest.java
##########
@@ -153,18 +153,22 @@ public static void beforeClass() throws Exception {
 
   private static Cluster buildCluster(CassandraEmbeddedServerBuilder builder) {
     int tried = 0;

Review comment:
       ```suggestion
       Exception exception = null;
       int tried = 0;
   ```

##########
File path: 
sdks/java/io/cassandra/src/test/java/org/apache/beam/sdk/io/cassandra/CassandraIOTest.java
##########
@@ -153,18 +153,22 @@ public static void beforeClass() throws Exception {
 
   private static Cluster buildCluster(CassandraEmbeddedServerBuilder builder) {
     int tried = 0;
-    while (tried < 3) {
+    int delay = 5000;
+    while (tried < 5) {
       try {
         return builder.buildNativeCluster();
       } catch (NoHostAvailableException e) {

Review comment:
       I couldn't find that this exception of type RuntimeException is thrown 
during cluster startup. We may want to catch all `Exception` here. 

##########
File path: 
sdks/java/io/cassandra/src/test/java/org/apache/beam/sdk/io/cassandra/CassandraIOTest.java
##########
@@ -153,18 +153,22 @@ public static void beforeClass() throws Exception {
 
   private static Cluster buildCluster(CassandraEmbeddedServerBuilder builder) {
     int tried = 0;
-    while (tried < 3) {
+    int delay = 5000;
+    while (tried < 5) {
       try {
         return builder.buildNativeCluster();
       } catch (NoHostAvailableException e) {
         tried++;

Review comment:
       ```suggestion
           if (exception == null) {
             exception = e;
           } else {
             exception.addSuppressed(e);
           }
           tried++;
   ```

##########
File path: 
sdks/java/io/cassandra/src/test/java/org/apache/beam/sdk/io/cassandra/CassandraIOTest.java
##########
@@ -153,18 +153,22 @@ public static void beforeClass() throws Exception {
 
   private static Cluster buildCluster(CassandraEmbeddedServerBuilder builder) {
     int tried = 0;
-    while (tried < 3) {
+    int delay = 5000;
+    while (tried < 5) {
       try {
         return builder.buildNativeCluster();
       } catch (NoHostAvailableException e) {
         tried++;
         try {
-          Thread.sleep(1000L);
+          Thread.sleep(delay);
         } catch (InterruptedException e1) {

Review comment:
       ```suggestion
           } catch (InterruptedException e1) {
             Thread.currentThread().interrupt();
             throw new RuntimeException("interrupted");
           }
   ```

##########
File path: 
sdks/java/io/cassandra/src/test/java/org/apache/beam/sdk/io/cassandra/CassandraIOTest.java
##########
@@ -153,18 +153,22 @@ public static void beforeClass() throws Exception {
 
   private static Cluster buildCluster(CassandraEmbeddedServerBuilder builder) {
     int tried = 0;
-    while (tried < 3) {
+    int delay = 5000;
+    while (tried < 5) {
       try {
         return builder.buildNativeCluster();
       } catch (NoHostAvailableException e) {
         tried++;
         try {
-          Thread.sleep(1000L);
+          Thread.sleep(delay);
         } catch (InterruptedException e1) {
         }
       }
     }
-    throw new RuntimeException("Unable to create embedded Cassandra cluster");
+    throw new RuntimeException(
+        String.format(
+            "Unable to create embedded Cassandra cluster: tried %d times with 
%d delay",
+            tried, delay));

Review comment:
       ```suggestion
       throw new RuntimeException(
           String.format(
               "Unable to create embedded Cassandra cluster: tried %d times 
with %d delay",
                   tried, delay), 
               exception);
   ```




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 429430)
    Time Spent: 4h 40m  (was: 4.5h)

> Cassandra IO classMethod test is flaky
> --------------------------------------
>
>                 Key: BEAM-8025
>                 URL: https://issues.apache.org/jira/browse/BEAM-8025
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-cassandra, test-failures
>    Affects Versions: 2.16.0
>            Reporter: Kyle Weaver
>            Assignee: Etienne Chauchot
>            Priority: Critical
>              Labels: flake
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> The most recent runs of this test are failing:
> [https://builds.apache.org/job/beam_PreCommit_Java_Commit/7398/]
> [https://builds.apache.org/job/beam_PreCommit_Java_Commit/7399/console]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to