You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by zh...@apache.org on 2019/07/05 17:51:33 UTC
[servicecomb-pack] branch SCB-1321 updated: SCB-1321 Fix test case
sometimes throws an interrupt exception with CI
This is an automated email from the ASF dual-hosted git repository.
zhanglei pushed a commit to branch SCB-1321
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git
The following commit(s) were added to refs/heads/SCB-1321 by this push:
new fc3725e SCB-1321 Fix test case sometimes throws an interrupt exception with CI
fc3725e is described below
commit fc3725e0411476ca9a120e191d9840af02a622bd
Author: Lei Zhang <zh...@apache.org>
AuthorDate: Sat Jul 6 01:51:08 2019 +0800
SCB-1321 Fix test case sometimes throws an interrupt exception with CI
---
.../servicecomb/pack/omega/transaction/ForwardRecoveryTest.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/omega/omega-transaction/src/test/java/org/apache/servicecomb/pack/omega/transaction/ForwardRecoveryTest.java b/omega/omega-transaction/src/test/java/org/apache/servicecomb/pack/omega/transaction/ForwardRecoveryTest.java
index 23482af..7303772 100644
--- a/omega/omega-transaction/src/test/java/org/apache/servicecomb/pack/omega/transaction/ForwardRecoveryTest.java
+++ b/omega/omega-transaction/src/test/java/org/apache/servicecomb/pack/omega/transaction/ForwardRecoveryTest.java
@@ -18,6 +18,8 @@
package org.apache.servicecomb.pack.omega.transaction;
import static com.seanyinx.github.unit.scaffolding.AssertUtils.expectFailing;
+import static org.hamcrest.Matchers.anyOf;
+import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
@@ -142,7 +144,9 @@ public class ForwardRecoveryTest {
recoveryPolicy.apply(joinPoint, compensable, interceptor, omegaContext, parentTxId, 2);
expectFailing(RuntimeException.class);
} catch (RuntimeException e) {
- assertThat(e.getMessage(), is("oops"));
+ //Sometimes thrown interrupt exception with CI
+ assertThat(e.getMessage(), anyOf(containsString("oops"),
+ containsString("Failed to handle tx because it is interrupted")));
}
assertThat(messages.size(), is(4));