You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/01/25 10:40:33 UTC

[incubator-servicecomb-saga] 02/03: SCB-278 attempted to fix random test failure by waiting a bit longer

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 6c87b3300b6fb78319002e325e186d40fba1dc4c
Author: seanyinx <se...@huawei.com>
AuthorDate: Thu Jan 25 15:31:51 2018 +0800

    SCB-278 attempted to fix random test failure by waiting a bit longer
    
    Signed-off-by: seanyinx <se...@huawei.com>
---
 .../apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java | 7 ++++---
 1 file changed, 4 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 5dddc1d..539f610 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
@@ -361,9 +361,10 @@ public class AlphaIntegrationTest {
 
     blockingStub.onTxEvent(someGrpcEvent(TxEndedEvent, globalTxId, anotherLocalTxId));
 
-    await().atMost(1, SECONDS).until(() -> eventRepo.count() == 8);
-    List<TxEvent> events = eventRepo.findByGlobalTxId(globalTxId);
-    assertThat(events.get(events.size() - 1).type(), is(SagaEndedEvent.name()));
+    await().atMost(1, SECONDS).until(() -> {
+      List<TxEvent> events = eventRepo.findByGlobalTxId(globalTxId);
+      return events.size() == 8 && events.get(events.size() - 1).type().equals(SagaEndedEvent.name());
+    });
   }
 
   private GrpcAck onCompensation(GrpcCompensateCommand command) {

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