-
Notifications
You must be signed in to change notification settings - Fork 2
Add robust subscription #172
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
base: main
Are you sure you want to change the base?
Conversation
ref: remove comment
efd857d to
e6b1455
Compare
ref: better comments fix: remove bracket
e6b1455 to
71a3b3b
Compare
| let block = stream.next().await.unwrap()?; | ||
| assert_eq!(1, block.number()); |
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.
nit: can't use assert_next!?
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn test_robust_subscription_stream_with_failover() -> anyhow::Result<()> { |
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.
We need a test case that shows that the scanner occasionally tries the primary provider.
Maybe something like:
- Spawn
anvil_1 - Connect
provider_1 - Store
anvil_1.port()in a local variableanvil_1_port - Spawn
anvil_2 - Connect
provider_2 - Mint block on
anvil_1, assert - Drop
anvil_1 - Mint block on
anvil_2, assert stream still works - Spawn new
anvil_3with.port(anvil_1_port)<- this will ensureprovider_1ws_endpoint_url is again valid - ???
- Verify that scanner switches back to
provider_1
| Ok(()) | ||
| } | ||
|
|
||
| #[tokio::test] |
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.
- Add test with multiple pubsub fallbacks, where each works but then stops, to confirm scanner goes through all of them in turn.
- Add subscribe test with no fallbacks
Resolves #167
(and hopefully #170)