budaidev commented on code in PR #5164:
URL: https://github.com/apache/fineract/pull/5164#discussion_r2559139125
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/messaging/event/EventCheckHelper.java:
##########
@@ -83,111 +82,92 @@
import
org.apache.fineract.test.messaging.event.loan.transaction.LoanUndoContractTerminationBusinessEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import retrofit2.Response;
@Slf4j
@Component
@RequiredArgsConstructor
public class EventCheckHelper {
private static final DateTimeFormatter FORMATTER_EVENTS =
DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ private static final long TRANSACTION_COMMIT_DELAY_MS = 500L;
@Autowired
- private ClientApi clientApi;
- @Autowired
- private LoansApi loansApi;
+ private FineractFeignClient fineractClient;
@Autowired
private EventAssertion eventAssertion;
@Autowired
- private ExternalAssetOwnersApi externalAssetOwnersApi;
- @Autowired
private GlobalConfigurationHelper configurationHelper;
+ @Autowired
+ private org.apache.fineract.test.messaging.config.EventProperties
eventProperties;
+
+ private void waitForTransactionCommit() {
+ if (eventProperties.isEventVerificationEnabled() &&
TRANSACTION_COMMIT_DELAY_MS > 0) {
+ try {
+ Thread.sleep(TRANSACTION_COMMIT_DELAY_MS);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RuntimeException("Interrupted while waiting for
transaction commit", e);
+ }
+ }
+ }
Review Comment:
Yes, this was the case previously, but unfortunately on CI we have issues
with these, which doesn't happen locally. This was the only solution which
worked after many tries
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]