You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by se...@apache.org on 2018/01/16 01:04:45 UTC
[incubator-servicecomb-saga] 02/03: SCB-220 aborted tx was not
supposed to be compensated
This is an automated email from the ASF dual-hosted git repository.
seanyinx pushed a commit to branch SCB-220_avoid_redundant_compensation
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git
commit 3662c5a62bc80184e1ae09c81ca06917def56784
Author: seanyinx <se...@huawei.com>
AuthorDate: Sat Jan 13 15:33:21 2018 +0800
SCB-220 aborted tx was not supposed to be compensated
Signed-off-by: seanyinx <se...@huawei.com>
---
.../servicecomb/saga/integration/pack/tests/PackIT.java | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/integration-tests/pack-tests/src/test/java/org/apache/servicecomb/saga/integration/pack/tests/PackIT.java b/integration-tests/pack-tests/src/test/java/org/apache/servicecomb/saga/integration/pack/tests/PackIT.java
index 7ed1b88..0a340db 100644
--- a/integration-tests/pack-tests/src/test/java/org/apache/servicecomb/saga/integration/pack/tests/PackIT.java
+++ b/integration-tests/pack-tests/src/test/java/org/apache/servicecomb/saga/integration/pack/tests/PackIT.java
@@ -136,14 +136,14 @@ public class PackIT {
assertThat(entity.getStatusCode(), is(INTERNAL_SERVER_ERROR));
- await().atMost(2, SECONDS).until(() -> repository.count() == 8);
+ await().atMost(2, SECONDS).until(() -> repository.count() == 7);
List<String> distinctGlobalTxIds = repository.findDistinctGlobalTxId();
assertThat(distinctGlobalTxIds.size(), is(1));
String globalTxId = distinctGlobalTxIds.get(0);
List<TxEventEnvelope> envelopes = repository.findByGlobalTxIdOrderByCreationTime(globalTxId);
- assertThat(envelopes.size(), is(8));
+ assertThat(envelopes.size(), is(7));
TxEventEnvelope sagaStartedEvent = envelopes.get(0);
assertThat(sagaStartedEvent.type(), is("SagaStartedEvent"));
@@ -170,18 +170,9 @@ public class PackIT {
assertThat(txCompensatedEvent1.serviceName(), is(serviceName));
assertThat(txCompensatedEvent1.instanceId(), is(txStartedEvent1.instanceId()));
- TxEventEnvelope txCompensatedEvent2 = envelopes.get(6);
- assertThat(txCompensatedEvent2.type(), is("TxCompensatedEvent"));
- assertThat(txCompensatedEvent2.localTxId(), is(txStartedEvent2.localTxId()));
- assertThat(txCompensatedEvent2.parentTxId(), is(globalTxId));
- assertThat(txCompensatedEvent2.serviceName(), is(serviceName));
- assertThat(txCompensatedEvent2.instanceId(), is(txStartedEvent2.instanceId()));
+ assertThat(envelopes.get(6).type(), is("SagaEndedEvent"));
- assertThat(envelopes.get(7).type(), is("SagaEndedEvent"));
-
- assertThat(compensatedMessages, contains(
- "Goodbye, " + TRESPASSER,
- "My bad, please take the window instead, " + TRESPASSER));
+ assertThat(compensatedMessages, contains("Goodbye, " + TRESPASSER));
}
@Test(timeout = 5000)
--
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.