diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41c38b8bb853426c9b105aca0b9bfc13634e026f..5442c68bb8cf59a17e67570d02a7b468fa229385 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,8 @@ tests: - if: '$CI_MERGE_REQUEST_ID ||$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^release/' - when: manual stage: tests + variables: + DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION: "10" script: - cargo build - cargo test diff --git a/integration-tests/tests/common/mod.rs b/integration-tests/tests/common/mod.rs index 8a5d1e160049f9c657b0cf178baa160371576158..09a31a92905b13beb648d7ae4b2de98ffdb2c4c8 100644 --- a/integration-tests/tests/common/mod.rs +++ b/integration-tests/tests/common/mod.rs @@ -63,7 +63,14 @@ pub async fn spawn_node() -> (Api, Client, Process) { .spawn() .expect("failed to spawn node"), ); - std::thread::sleep(std::time::Duration::from_secs(4)); + let duration_secs = if let Ok(duration_string) = + std::env::var("DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION") + { + duration_string.parse().unwrap_or(4) + } else { + 4 + }; + std::thread::sleep(std::time::Duration::from_secs(duration_secs)); let client = ClientBuilder::new() .set_url(format!("ws://127.0.0.1:{}", ws_port))