You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/08/17 03:15:03 UTC

[GitHub] HuZheting opened a new issue #253: when AbortEvent is late

HuZheting opened a new issue #253: when AbortEvent is late
URL: https://github.com/apache/incubator-servicecomb-saga/issues/253
 
 
   I write a test in AlphaIntegrationTest,
   `
     public void whenAbortEventIsLate(){
         
         String sagaGlobalId = UUID.randomUUID().toString();
         String localIdEntry = UUID.randomUUID().toString();
         String localIdEndpoint = UUID.randomUUID().toString();
         
         String anotherSagaGlobalId = UUID.randomUUID().toString();
         String anotheEntryLocalId = UUID.randomUUID().toString();
         String anotherEndPointLocalId = UUID.randomUUID().toString();
         
         asyncStub.onConnected(serviceConfig, compensateResponseObserver);
         blockingStub.onTxEvent(someGrpcEvent(SagaStartedEvent, sagaGlobalId, localIdEntry));
         blockingStub.onTxEvent(someGrpcEvent(SagaStartedEvent, anotherSagaGlobalId, anotheEntryLocalId));
         
         blockingStub.onTxEvent(someGrpcEvent(TxStartedEvent, sagaGlobalId, localIdEndpoint));
         blockingStub.onTxEvent(someGrpcEvent(TxEndedEvent, sagaGlobalId, localIdEndpoint));
         await().atMost(1, SECONDS).until(() -> eventRepo.count() == 4);
         
         blockingStub.onTxEvent(someGrpcEvent(TxStartedEvent, anotherSagaGlobalId, anotherEndPointLocalId));
         blockingStub.onTxEvent(someGrpcEvent(TxEndedEvent, anotherSagaGlobalId, anotherEndPointLocalId));
         blockingStub.onTxEvent(someGrpcEvent(TxAbortedEvent, anotherSagaGlobalId, anotherEndPointLocalId));
         
         
         await().atMost(2, SECONDS).until(() -> !receivedCommands.isEmpty());
         assertThat(receivedCommands.poll().getGlobalTxId(), is(anotherSagaGlobalId));
         
         blockingStub.onTxEvent(someGrpcEvent(TxAbortedEvent, sagaGlobalId, anotheEntryLocalId));
         
         await().atMost(10, SECONDS).until(() -> receivedCommands.size() > 1);
         assertThat(receivedCommands.size(), is(2));
     }`
   and the test fail.
   ![image](https://user-images.githubusercontent.com/9289881/44245949-280d4400-a20e-11e8-9992-08b1df7442d3.png)
   
   
   It seems that the first uncompensate tx  can not be found after another abort event is found before.
   I believe that the variable "nextEndedEventId" cause this problem. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services