Type: Tech Debt
Status: Open (View Workflow)
Affects Version/s: None
Fix Version/s: None
ApiTestBase$verifyPostResponse has been using verifyInvoiceSummaryUpdateEvent to wait for some update events to finish. As this is no longer done async, verifyInvoiceSummaryUpdateEvent is not longer needed. But without a new sleep to replace it, tests can fail because some async operations happen at the same time as the next tests (verifyInvoiceSummaryUpdateEvent had a minimum 50ms delay which was helping to avoid issues).
The sleep workaround introduced in the resolution for
MODINVOICE-233 is not ideal because the right value depends on the environment, and it slows down the tests.
Steps to reproduce:
(errors may vary depending on the running environment)
- Remove the sleep in ApiTestBase$verifyPostResponse
- A better workaround to wait for async operations to finish without using a fixed sleep value, OR
- Change the tests to support parallel execution (this could be complicated and probably require changes in MockServer)