From 99ef41160096793664cbc90dfa05fcd551a571b6 Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Wed, 13 Sep 2023 12:12:20 +0800 Subject: [PATCH] ci: move solana-client-test to nextest (#33185) --- Cargo.lock | 1 + ci/stable/run-partition.sh | 1 - client-test/Cargo.toml | 1 + client-test/tests/client.rs | 8 +++----- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cd1182991..829336f9ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5646,6 +5646,7 @@ name = "solana-client-test" version = "1.17.0" dependencies = [ "futures-util", + "rand 0.8.5", "serde_json", "solana-client", "solana-ledger", diff --git a/ci/stable/run-partition.sh b/ci/stable/run-partition.sh index 0c4738c80a..6fbbb0e47f 100755 --- a/ci/stable/run-partition.sh +++ b/ci/stable/run-partition.sh @@ -31,7 +31,6 @@ if [ ! "$LIMIT" -gt "$INDEX" ]; then fi DONT_USE_NEXTEST_PACKAGES=( - solana-client-test solana-cargo-build-sbf solana-core ) diff --git a/client-test/Cargo.toml b/client-test/Cargo.toml index ac6fabf0a2..5a88e4d114 100644 --- a/client-test/Cargo.toml +++ b/client-test/Cargo.toml @@ -12,6 +12,7 @@ edition = { workspace = true } [dependencies] futures-util = { workspace = true } +rand = { workspace = true } serde_json = { workspace = true } solana-client = { workspace = true } solana-ledger = { workspace = true } diff --git a/client-test/tests/client.rs b/client-test/tests/client.rs index 00c075c228..65acd1adaa 100644 --- a/client-test/tests/client.rs +++ b/client-test/tests/client.rs @@ -1,5 +1,6 @@ use { futures_util::StreamExt, + rand::Rng, serde_json::{json, Value}, solana_ledger::{blockstore::Blockstore, get_tmp_ledger_path}, solana_pubsub_client::{nonblocking, pubsub_client::PubsubClient}, @@ -28,7 +29,6 @@ use { commitment_config::{CommitmentConfig, CommitmentLevel}, native_token::sol_to_lamports, pubkey::Pubkey, - rpc_port, signature::{Keypair, Signer}, system_program, system_transaction, }, @@ -41,7 +41,7 @@ use { collections::HashSet, net::{IpAddr, SocketAddr}, sync::{ - atomic::{AtomicBool, AtomicU16, AtomicU64, Ordering}, + atomic::{AtomicBool, AtomicU64, Ordering}, Arc, RwLock, }, thread::sleep, @@ -51,12 +51,10 @@ use { tungstenite::connect, }; -static NEXT_RPC_PUBSUB_PORT: AtomicU16 = AtomicU16::new(rpc_port::DEFAULT_RPC_PUBSUB_PORT); - fn pubsub_addr() -> SocketAddr { SocketAddr::new( IpAddr::V4(Ipv4Addr::UNSPECIFIED), - NEXT_RPC_PUBSUB_PORT.fetch_add(1, Ordering::Relaxed), + rand::thread_rng().gen_range(1024..65535), ) }