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

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


The following commit(s) were added to refs/heads/master by this push:
     new 1cf282c  ISSUE 3044: ETCD tests hang. Added global timeout, fork tests 
jvm, fixed noop slf4j to see log in case of hang (#3051)
1cf282c is described below

commit 1cf282c31997f2260a4cdaa1467b38ee6a1ef720
Author: Andrey Yegorov <[email protected]>
AuthorDate: Mon Feb 21 18:17:38 2022 -0800

    ISSUE 3044: ETCD tests hang. Added global timeout, fork tests jvm, fixed 
noop slf4j to see log in case of hang (#3051)
    
    Descriptions of the changes in this PR:
    
    ### Motivation
    
    ETCD test flake / hang occasionally causing CI job timeout.
    
    ### Changes
    
    Added global timeout - kill test early if hanged
    fork tests jvm - I think it helped locally (no repro) but possibly just 
reduced frequency of hangs
    fixed noop slf4j warning, also to see log in case of hang
    
    Master Issue: #3044
---
 metadata-drivers/etcd/build.gradle                                   | 3 +++
 .../org/apache/bookkeeper/metadata/etcd/testing/EtcdTestBase.java    | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/metadata-drivers/etcd/build.gradle 
b/metadata-drivers/etcd/build.gradle
index 837eb0f..7ab7559 100644
--- a/metadata-drivers/etcd/build.gradle
+++ b/metadata-drivers/etcd/build.gradle
@@ -54,3 +54,6 @@ publishing {
     }
 }
 
+test {
+    forkEvery = 1
+}
diff --git 
a/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdTestBase.java
 
b/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdTestBase.java
index 066c8c5..4929517 100644
--- 
a/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdTestBase.java
+++ 
b/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdTestBase.java
@@ -31,6 +31,8 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.rules.Timeout;
 
 /**
  * A test base that setup etcd cluster for testing.
@@ -38,6 +40,9 @@ import org.junit.BeforeClass;
 @Slf4j
 public abstract class EtcdTestBase {
 
+    @Rule
+    public Timeout globalTimeout = Timeout.seconds(120);
+
     protected static EtcdContainer etcdContainer;
 
     @BeforeClass

Reply via email to