I hit this race condition in the testing of new spec versions. This test performs a manual cancel of the started LRA at line 208. However, the invoked method in the LongBusinessMethodParticipant class is annotated with default LRA annotation that attempts to close the LRA when the method finishes. This introduces conflict and a race condition between the latch await and automatic Close of the LRA and between manual Cancel of the LRA in the test. A simple fix is just to not close the LRA automatically in the LRA method.
…nessMethod
I hit this race condition in the testing of new spec versions. This test performs a manual cancel of the started LRA at line 208. However, the invoked method in the LongBusinessMethodParticipant class is annotated with default LRA annotation that attempts to close the LRA when the method finishes. This introduces conflict and a race condition between the latch await and automatic Close of the LRA and between manual Cancel of the LRA in the test. A simple fix is just to not close the LRA automatically in the LRA method.