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

[pubsub-client] doctest loops indefinitely; contacts the internet #4713

Open
steveluscher opened this issue Jan 31, 2025 · 0 comments
Open

Comments

@steveluscher
Copy link

Consider this doctest:

//! ```
//! use anyhow::Result;
//! use solana_commitment_config::CommitmentConfig;
//! use solana_pubkey::Pubkey;
//! use solana_pubsub_client::pubsub_client::PubsubClient;
//! use solana_rpc_client_api::config::RpcAccountInfoConfig;
//! use std::thread;
//!
//! fn get_account_updates(account_pubkey: Pubkey) -> Result<()> {
//! let url = "wss://api.devnet.solana.com/";
//!
//! let (mut account_subscription_client, account_subscription_receiver) =
//! PubsubClient::account_subscribe(
//! url,
//! &account_pubkey,
//! Some(RpcAccountInfoConfig {
//! encoding: None,
//! data_slice: None,
//! commitment: Some(CommitmentConfig::confirmed()),
//! min_context_slot: None,
//! }),
//! )?;
//!
//! loop {
//! match account_subscription_receiver.recv() {
//! Ok(response) => {
//! println!("account subscription response: {:?}", response);
//! }
//! Err(e) => {
//! println!("account subscription error: {:?}", e);
//! break;
//! }
//! }
//! }
//!
//! Ok(())
//! }
//! #
//! # get_account_updates(solana_pubkey::new_rand());
//! # Ok::<(), anyhow::Error>(())
//! ```

  • Only ever times out after 60 seconds (slows down CI)
  • Actually connects to api.devnet.solana.com (ergo will fail CI if that server is unreachable)
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

No branches or pull requests

1 participant