eclipse / microprofile-lra

microprofile-lra
Apache License 2.0
101 stars 30 forks source link

Fix the race condition in the TckParticipantTests.cancelLraDuringBusi… #330

Closed xstefank closed 4 years ago

xstefank commented 4 years ago

…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.