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

[rpc module]: improve TestSubscription to return None when closed #566

Merged
merged 3 commits into from Nov 18, 2021

Conversation

niklasad1
Copy link
Member

No description provided.

assert_eq!(id, v2::params::SubscriptionId::Num(my_sub.subscription_id()));

// close the subscription to ensure it doesn't return any items.
my_sub.close();
Copy link
Member Author

Choose a reason for hiding this comment

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

technically this doesn't test that inner thread was terminated correctly and it's bit cheating because we terminate the SubscriptionSink directly there but we do the exact thing in WsServer so should be sufficient here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess it's possible to inject a channel/flag to the RpcModule for testing but really annoying for other however the SubscriptionSink terminates the subscription once SubscriptionSink::send fails anyway...

@niklasad1 niklasad1 merged commit 0e46b5c into master Nov 18, 2021
@niklasad1 niklasad1 deleted the na-test-subscription-none-when-closed branch November 18, 2021 11:03
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

👍

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.

None yet

4 participants