diff --git a/Cargo.lock b/Cargo.lock index c1fbd59c22..53868a05a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1054,6 +1054,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dashmap" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown 0.12.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "digest" version = "0.8.1" @@ -2029,6 +2042,16 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.17" @@ -2402,6 +2425,29 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.4.1", + "smallvec", + "windows-targets 0.48.5", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -2775,6 +2821,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -3297,6 +3352,31 @@ dependencies = [ "serde", ] +[[package]] +name = "serial_test" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" +dependencies = [ + "dashmap", + "futures", + "lazy_static", + "log", + "parking_lot", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "sha1" version = "0.6.1" @@ -3588,6 +3668,7 @@ dependencies = [ "serde_derive", "serde_json", "serde_stacker", + "serial_test", "slog", "slog-json", "slog-term", diff --git a/stacks-signer/Cargo.toml b/stacks-signer/Cargo.toml index 5c65c43397..77d747fe78 100644 --- a/stacks-signer/Cargo.toml +++ b/stacks-signer/Cargo.toml @@ -43,6 +43,9 @@ tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } wsts = { workspace = true } rand = { workspace = true } +[dev-dependencies] +serial_test = "3.0.0" + [dependencies.serde_json] version = "1.0" features = ["arbitrary_precision", "unbounded_depth"] diff --git a/stacks-signer/src/client/stackerdb.rs b/stacks-signer/src/client/stackerdb.rs index 771dc5ff6d..73e30d67e2 100644 --- a/stacks-signer/src/client/stackerdb.rs +++ b/stacks-signer/src/client/stackerdb.rs @@ -177,11 +177,13 @@ mod tests { TransactionSmartContract, TransactionVersion, }; use blockstack_lib::util_lib::strings::StacksString; + use serial_test::serial; use super::*; use crate::client::tests::{write_response, TestConfig}; #[test] + #[serial] fn get_signer_transactions_with_retry_should_succeed() { let mut config = TestConfig::new(); let sk = StacksPrivateKey::new(); @@ -226,6 +228,7 @@ mod tests { } #[test] + #[serial] fn send_signer_message_with_retry_should_succeed() { let mut config = TestConfig::new(); let sk = StacksPrivateKey::new(); diff --git a/stacks-signer/src/runloop.rs b/stacks-signer/src/runloop.rs index 69b820b298..96a1e897ff 100644 --- a/stacks-signer/src/runloop.rs +++ b/stacks-signer/src/runloop.rs @@ -995,6 +995,7 @@ mod tests { use libsigner::SIGNER_SLOTS_PER_USER; use rand::distributions::Standard; use rand::Rng; + use serial_test::serial; use stacks_common::bitvec::BitVec; use stacks_common::types::chainstate::{ ConsensusHash, StacksBlockId, StacksPrivateKey, TrieHash, @@ -1192,6 +1193,7 @@ mod tests { } #[test] + #[serial] fn get_expected_transactions_should_filter_invalid_transactions() { // Create a runloop of a valid signer let config = Config::load_from_file("./src/tests/conf/signer-0.toml").unwrap(); @@ -1298,6 +1300,7 @@ mod tests { } #[test] + #[serial] fn verify_transactions_valid() { let config = Config::load_from_file("./src/tests/conf/signer-0.toml").unwrap(); let mut runloop: RunLoop> = RunLoop::from(&config);