Closed LiranCohen closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.62%. Comparing base (
94da019
) to head (2fea4de
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I needed to test async events on another project. I initially polled to make sure the event had finished, but the tests were taking a long time. Instead, I created a promise in the test code that I resolved in the event handler, and the tests ran 2-3 times faster. I don't know if this approach is appropriate for what you're doing, but I thought I'd mention it.
Due to the async nature of testing
EventStream
and Subscriptions, and some external pub/sub systems taking a longer time to publish and/or receive a message, we have added a helper method to help wait for a test case to assert.Additionally we modified the tests to be able to more accurately check negative test cases where testing the absence of something which arrives async could be challenging.
pollUntilSuccessOrTimeout
will execute a delegate function passed to it, if it fails it will sleepretrySleep
ms, and will retry. If the total retry time exceedstimeout
, it will finally fail.