We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 805a5d3 commit 3731f23Copy full SHA for 3731f23
tests/common/mod.rs
@@ -47,6 +47,7 @@ use serde_json::{json, Value};
47
use std::collections::{HashMap, HashSet};
48
use std::env;
49
use std::path::PathBuf;
50
+use std::sync::atomic::{AtomicU16, Ordering};
51
use std::sync::{Arc, RwLock};
52
use std::time::Duration;
53
@@ -202,9 +203,10 @@ pub(crate) fn random_storage_path() -> PathBuf {
202
203
temp_path
204
}
205
206
+static PORT_COUNTER: AtomicU16 = AtomicU16::new(5000);
207
+
208
pub(crate) fn random_port() -> u16 {
- let mut rng = thread_rng();
- rng.gen_range(5000..65535)
209
+ PORT_COUNTER.fetch_add(1, Ordering::Relaxed)
210
211
212
pub(crate) fn random_listening_addresses() -> Vec<SocketAddress> {
0 commit comments