-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add asynchronous API tests #1010
Conversation
@michael-grunder Would async api testing be something that I should continue to pursue? Any thoughts? |
@bjosv Yes, it would be great to have async tests! |
Asynchronous testcases that requires the event library `libevent` can be built and enabled by using the added build flags: - ENABLE_ASYNC_TESTS when using CMake - TEST_ASYNC when using Make The async tests are disabled by default to avoid adding new requirements, but the testcases are built and run in CI.
0b1af42
to
869eea1
Compare
My plan is to add the corresponding test for RESP3 in a separate PR after this is delivered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testcase will subscribe to a channel, and via a second client a message is published to the channel. After receiving the message the testcase will unsubscribe and disconnect.
Remove the use of libevent timer-events for publishing messages, this to mitigate any (yet unseen) timing issues. |
@michael-grunder Is this inline with your thoughts regarding async testing? |
@bjosv Yes, they're great. Do you have any issues with my minor tweaks in 7ad38dc? Without the changes I run into some compilation issues building on a system with both libev and libevent. I didn't look in detail but it seems related to this issue |
@michael-grunder Your change looks fine to me. I have both libev and libevent installed, but it seems that my installed libev-dev apt-package on Ubuntu 20.04 don't contain the file event.h. When I now check libevents file |
Merged, thanks! |
Add asynchronous tests for pubsub (RESP2)
This testcase verifies the asynchronous handling of the pubsub flow.
The testcase subscribes to a channel while a second client is used to publish a message on the channel.
After receiving the published message the testcase will unsubscribe and disconnect.
This testcase can be modified to reproduce an issue with having an incoming published message while unsubscribing to the channel.