Uploaded image for project: 'Apache ServiceComb'
  1. Apache ServiceComb
  2. SCB-1152

About abortTimeoutTxStartedEvent test case failed

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • pack-0.4.0
    • Saga
    • None

    Description

      ```
      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()); }

      );
      ```

      Attachments

        Issue Links

          Activity

            People

              zhanglei Lei Zhang
              zhanglei Lei Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m