Skip to content
Snippets Groups Projects
Commit c0f80db4 authored by Éloïs's avatar Éloïs
Browse files

[tests] ws2p: TI must be run in serial

parent e2ded849
No related branches found
No related tags found
1 merge request!261[tests] ws2p: TI must be run in serial
...@@ -1239,6 +1239,7 @@ dependencies = [ ...@@ -1239,6 +1239,7 @@ dependencies = [
"failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
......
...@@ -35,6 +35,7 @@ ws = { version = "0.9.*", features = ["permessage-deflate"] } ...@@ -35,6 +35,7 @@ ws = { version = "0.9.*", features = ["permessage-deflate"] }
[dev-dependencies] [dev-dependencies]
durs-common-tests-tools = { path = "../../../tests-tools/common-tests-tools" } durs-common-tests-tools = { path = "../../../tests-tools/common-tests-tools" }
once_cell = "1.3.1"
[features] [features]
ssl = ["ws/ssl"] ssl = ["ws/ssl"]
...@@ -27,13 +27,18 @@ use durs_ws2p_protocol::connection_state::WS2PConnectionState; ...@@ -27,13 +27,18 @@ use durs_ws2p_protocol::connection_state::WS2PConnectionState;
use durs_ws2p_protocol::controller::{WS2PControllerEvent, WebsocketActionOrder}; use durs_ws2p_protocol::controller::{WS2PControllerEvent, WebsocketActionOrder};
use durs_ws2p_protocol::orchestrator::OrchestratorMsg; use durs_ws2p_protocol::orchestrator::OrchestratorMsg;
use durs_ws2p_protocol::MySelfWs2pNode; use durs_ws2p_protocol::MySelfWs2pNode;
use once_cell::sync::Lazy;
use std::sync::mpsc; use std::sync::mpsc;
use std::sync::Mutex;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
static PORT: &'static u16 = &10899; static PORT: &'static u16 = &10899;
static TIMEOUT_IN_MS: &'static u64 = &30_000; static TIMEOUT_IN_MS: &'static u64 = &30_000;
// Empty mutex used to ensure that only one test runs at a time
static MUTEX: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
pub fn currency() -> CurrencyName { pub fn currency() -> CurrencyName {
CurrencyName(String::from("g1")) CurrencyName(String::from("g1"))
} }
...@@ -75,6 +80,7 @@ fn client_node() -> MySelfWs2pNode { ...@@ -75,6 +80,7 @@ fn client_node() -> MySelfWs2pNode {
#[cfg(unix)] #[cfg(unix)]
fn test_connection_negociation_denial() { fn test_connection_negociation_denial() {
durs_common_tests_tools::logger::init_logger_stdout(vec!["ws"]); durs_common_tests_tools::logger::init_logger_stdout(vec!["ws"]);
let _lock = MUTEX.lock().expect("MUTEX poisoned");
// ===== initialization ===== // ===== initialization =====
// client and server are initialized and launched in separate threads // client and server are initialized and launched in separate threads
...@@ -152,6 +158,7 @@ fn test_connection_negociation_denial() { ...@@ -152,6 +158,7 @@ fn test_connection_negociation_denial() {
#[cfg(unix)] #[cfg(unix)]
fn test_connection_negociation_success() { fn test_connection_negociation_success() {
durs_common_tests_tools::logger::init_logger_stdout(vec!["ws"]); durs_common_tests_tools::logger::init_logger_stdout(vec!["ws"]);
let _lock = MUTEX.lock().expect("MUTEX poisoned");
// ===== initialization ===== // ===== initialization =====
// client and server are initialized and launched in separate threads // client and server are initialized and launched in separate threads
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment