-
Notifications
You must be signed in to change notification settings - Fork 170
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
fix: unsubscription test #1244
fix: unsubscription test #1244
Conversation
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.
Nice!
tests/tests/integration_tests.rs
Outdated
|
||
assert!(success); | ||
// When the subscription is closed a message is sent out on this channel. | ||
let res = rx.next().with_timeout(std::time::Duration::from_secs(10)).await.expect("Timeout 10 secs exceeded"); |
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.
Would there be a way to avoid relying on the sleep here? Might be possible that the CI will lag at some point and we'd exceed this?
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.
I can remove it, it just a way to ensure that the test fails if the "future never completes".
The underlying subscription will run forever and can only be cancelled if the connection is closed or unsubscribed. https://github.com/paritytech/jsonrpsee/blob/d3a34030f04c43359e380a9938430d515c06d794/tests/tests/helpers.rs#L176-#L188
Fixes #1168 (comment)