You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2019/04/02 08:18:02 UTC

[jira] [Updated] (SCB-1152) About abortTimeoutTxStartedEvent test case failed

     [ https://issues.apache.org/jira/browse/SCB-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang updated SCB-1152:
------------------------------
    Affects Version/s:     (was: saga-0.4.0)

> About abortTimeoutTxStartedEvent test case failed
> -------------------------------------------------
>
>                 Key: SCB-1152
>                 URL: https://issues.apache.org/jira/browse/SCB-1152
>             Project: Apache ServiceComb
>          Issue Type: Test
>          Components: Saga
>            Reporter: Lei Zhang
>            Assignee: Lei Zhang
>            Priority: Minor
>             Fix For: saga-0.4.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> ```
>  await().atMost(2, SECONDS).until(() -> {
>  List<TxEvent> events = eventRepo.findByGlobalTxId(globalTxId);
>  return eventRepo.count() == 5 && events.get(events.size() - 1).type().equals(SagaEndedEvent.name());
>  });
> ```
> Sometimes although eventRepo.count()==5 but there events list of results as follows
> ```
> SagaStartedEvent
> TxStartedEvent
> TxAbortedEvent
> SagaEndedEvent
> SagaEndedEvent
> ```
> compensation has not yet executed a cycle (method deleteDuplicateSagaEndedEvents() has not been executed yet), TxCompensatedEvent has not been added yet, but the condition eventRepo.count()==5 is met, so I suggest changing to the following
> ```
>  await().atMost(2, SECONDS).until(() -> {
>  List<TxEvent> events = eventRepo.findByGlobalTxId(globalTxId);
>  return eventRepo.count() == 5 && events.get(events.size() - 1).type().equals(SagaEndedEvent.name()) && !events.get(events.size() - 2).type().equals(SagaEndedEvent.name());
>  });
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)