beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (BEAM-3949) IOIT's setup() and teardown() db connection attempt sometimes fail resulting in test flakiness
Date Tue, 29 May 2018 15:18:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 29/May/18 15:17
            Start Date: 29/May/18 15:17
    Worklog Time Spent: 10m 
      Work Description: kkucharc commented on a change in pull request #5434: [BEAM-3949]
IOIT's setup() and teardown() db connection attempt sometimes fail resulting in test flakiness
URL: https://github.com/apache/beam/pull/5434#discussion_r191465562
 
 

 ##########
 File path: sdks/java/io/common/src/test/java/org/apache/beam/sdk/io/common/IOITHelper.java
 ##########
 @@ -36,4 +42,55 @@ public static String getHashForRecordCount(int recordCount, Map<Integer,
String>
     }
     return hash;
   }
+
+  public static void retry(RetryFunction function, int attempts, long delay)
+      throws InterruptedException {
+    ArrayList<Exception> errorList = new ArrayList<Exception>();
+    int countAttempts = 0;
+
+    while (countAttempts < attempts) {
+      try {
+        function.run();
+        return;
+      } catch (Exception e) {
+        LOG.warn(
+            "Attempt #{} of {} threw exception: {}", countAttempts + 1, attempts, e.getMessage());
+        errorList.add(e);
+        countAttempts++;
+        if (countAttempts == attempts) {
+          throw RetryException.composeErrors(errorList);
+        } else {
+          Thread.sleep(delay);
 
 Review comment:
   Ok, I will change

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


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

    Worklog Id:     (was: 106675)
    Time Spent: 5.5h  (was: 5h 20m)

> IOIT's setup() and teardown() db connection attempt sometimes fail resulting in test
flakiness
> ----------------------------------------------------------------------------------------------
>
>                 Key: BEAM-3949
>                 URL: https://issues.apache.org/jira/browse/BEAM-3949
>             Project: Beam
>          Issue Type: Sub-task
>          Components: testing
>            Reporter: Łukasz Gajowy
>            Assignee: Kasia Kucharczyk
>            Priority: Major
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> setup() and teardown() methods sometimes have trouble connecting database in Performance
tests. It results in test flakiness. 
> Example logs: 
> [https://builds.apache.org/view/A-D/view/Beam/job/beam_PerformanceTests_HadoopInputFormat/65/console]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message