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

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 8c2107396d193b0eae0bdcda164ed891ea93f9c2
Author: Eric Lee <dagang...@huawei.com>
AuthorDate: Fri Feb 9 23:19:18 2018 +0800

    SCB-330 attempt to fix test failure
    
    Signed-off-by: Eric Lee <dagang...@huawei.com>
---
 .../servicecomb/saga/alpha/server/AlphaIntegrationTest.java | 13 +++++++++++++
 docs/user_guide.md                                          |  2 +-
 docs/user_guide_zh.md                                       |  2 +-
 .../grpc/LoadBalancedClusterMessageSenderTest.java          |  2 +-
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git 
a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java
 
b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java
index 497c244..8b2672c 100644
--- 
a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java
+++ 
b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java
@@ -389,6 +389,8 @@ public class AlphaIntegrationTest {
     assertThat(events.get(1).type(), is(TxAbortedEvent.name()));
     assertThat(events.get(2).type(), is(SagaEndedEvent.name()));
 
+    await().atMost(2, SECONDS).until(this::waitTillTimeoutDone);
+
     assertThat(timeoutEntityRepository.count(), is(1L));
     Iterable<TxTimeout> timeouts = timeoutEntityRepository.findAll();
     timeouts.forEach(timeout -> {
@@ -416,6 +418,8 @@ public class AlphaIntegrationTest {
     assertThat(events.get(3).type(), is(TxCompensatedEvent.name()));
     assertThat(events.get(4).type(), is(SagaEndedEvent.name()));
 
+    await().atMost(2, SECONDS).until(this::waitTillTimeoutDone);
+
     assertThat(timeoutEntityRepository.count(), is(1L));
     Iterable<TxTimeout> timeouts = timeoutEntityRepository.findAll();
     timeouts.forEach(timeout -> {
@@ -425,6 +429,15 @@ public class AlphaIntegrationTest {
     });
   }
 
+  private boolean waitTillTimeoutDone() {
+    for (TxTimeout txTimeout : timeoutEntityRepository.findAll()) {
+      if (txTimeout.status().equals(DONE.name())) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   private GrpcAck onCompensation(GrpcCompensateCommand command) {
     return blockingStub.onTxEvent(
         eventOf(TxCompensatedEvent,
diff --git a/docs/user_guide.md b/docs/user_guide.md
index bd9733d..a0d9db5 100644
--- a/docs/user_guide.md
+++ b/docs/user_guide.md
@@ -1,4 +1,4 @@
-# Saga 用户指南
+# Saga User Guide
 [![ZH 
doc](https://img.shields.io/badge/document-中文-blue.svg)](user_guide_zh.md)
 
 ## Prerequisites
diff --git a/docs/user_guide_zh.md b/docs/user_guide_zh.md
index 25a8ff2..6b8ce47 100644
--- a/docs/user_guide_zh.md
+++ b/docs/user_guide_zh.md
@@ -1,4 +1,4 @@
-# Saga User Guide
+# Saga 用户指南
 [![EN 
doc](https://img.shields.io/badge/document-English-blue.svg)](user_guide.md)
 
 ## 准备环境
diff --git 
a/omega/omega-connector/omega-connector-grpc/src/test/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSenderTest.java
 
b/omega/omega-connector/omega-connector-grpc/src/test/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSenderTest.java
index bb24c5c..fce9c0b 100644
--- 
a/omega/omega-connector/omega-connector-grpc/src/test/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSenderTest.java
+++ 
b/omega/omega-connector/omega-connector-grpc/src/test/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSenderTest.java
@@ -176,7 +176,7 @@ public class LoadBalancedClusterMessageSenderTest {
     messageSender.send(event);
 
     startServerOnPort(deadPort);
-    await().atMost(2, SECONDS).until(() -> connected.get(deadPort).size() == 
3);
+    await().atMost(3, SECONDS).until(() -> connected.get(deadPort).size() == 
3);
 
     TxEvent abortedEvent = new TxAbortedEvent(globalTxId, localTxId, 
parentTxId, compensationMethod, new RuntimeException("oops"));
     messageSender.send(abortedEvent);

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.

Reply via email to