-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor of stream_all_messages, fix flaky stream tests #835
Conversation
…insipx/async-callback
f908455
to
1fca0a3
Compare
13928ad
to
9c916ae
Compare
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.
Well done, this is a number of very helpful improvements! TIL about tokio::sync::notify
, that helps a lot with the flaky tests. And handling the changeover between streams more gracefully is very helpful for reducing missed messages.
I think we need to propagate some changes up to the mobile SDK's, now that the stream methods are synchronous?
Yeah there do need to be some minor sdk changes -- mostly from async to sync and one method has an error return removed |
impl Stream
mem::replace
.tokio::sync::Notify
to create formal sync points across streaming testsStreamCloser
duplication and instead usetokio::task::JoinHandle
as StreamCloser in ffi codeStreamCloser
now has anotherend
function,end_and_wait
.end_and_wait
waits for the stream to end before exiting the function. theend
function is still fire-and-forget (allowing it to remain synchronous).StreamHandle
that has async methods:wait_for_ready
: async waits until the stream is ready to accept messagesend_and_wait
: ends the stream and waits for it to shutdownend
is still sync and just tells the stream to stop without blockingfixes #772
Fixes most of the flaky tests, except for
test_can_stream_group_messages_for_updates
andtest_can_stream_and_update_name_without_forking_group
which are unrelated to the stream changes, and instead one of them suffers from thedblock
issue (although only in CI), and the other is problematic I think b/c ofpublish_intents
conflicts (also only in CI).