From 1b7375508739ff6a76bcc4bda510ad0a835e780c Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Wed, 12 Jan 2022 23:13:18 +0100 Subject: [PATCH] ci: fix integration tests execution --- .gitlab-ci.yml | 2 ++ integration-tests/tests/common/mod.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41c38b8bb..5442c68bb 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 8a5d1e160..09a31a929 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)) -- GitLab