Skip to content
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

Merged
merged 4 commits into from
Nov 22, 2023
Merged

fix: unsubscription test #1244

merged 4 commits into from
Nov 22, 2023

Conversation

niklasad1
Copy link
Member

@niklasad1 niklasad1 requested a review from a team as a code owner November 21, 2023 17:09
Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


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");
Copy link
Contributor

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?

Copy link
Member Author

@niklasad1 niklasad1 Nov 22, 2023

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

@niklasad1 niklasad1 merged commit f4e2a74 into master Nov 22, 2023
11 checks passed
@niklasad1 niklasad1 deleted the na-fix-unsubscription-test branch November 22, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants