diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 462290bff43bef327ef5c16f1f4e52d11e2655d4..2a7cf88ff3335ff84d7e5c00753ecc33f2e4c513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,12 @@ jobs: steps: - uses: actions/checkout@v3 + # https://github.com/jlumbroso/free-disk-space + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + - name: Fetch cache uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 with: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf5ddb37e7e4ca6adfbeaf6511cb7b87a0f22ecc..7118e4bbe22f4450781e4f1b618926f6dec0205a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,7 +31,7 @@ k8s-integration-test-smoke: tags: - zombienet-polkadot-integration-test script: - - RUST_LOG=zombienet_orchestrator=debug cargo test --features ci-k8s --test smoke -- --nocapture + - RUST_LOG=zombienet_orchestrator=debug,zombienet_provider=debug cargo test --features ci-k8s --test smoke -- --nocapture variables: CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE] RUN_IN_CI: "1" diff --git a/crates/provider/src/kubernetes/namespace.rs b/crates/provider/src/kubernetes/namespace.rs index fa952f162ece47bc145ce732d3735c6d9e3014c8..4ba58228651880400c738628b6170f0511be7e5e 100644 --- a/crates/provider/src/kubernetes/namespace.rs +++ b/crates/provider/src/kubernetes/namespace.rs @@ -3,6 +3,7 @@ use std::{ env, path::PathBuf, sync::{Arc, Weak}, + time::Duration, }; use anyhow::anyhow; @@ -202,9 +203,9 @@ where port: IntOrString::Int(80), ..Default::default() }), - initial_delay_seconds: Some(5), - period_seconds: Some(3), - failure_threshold: Some(15), + initial_delay_seconds: Some(1), + period_seconds: Some(2), + failure_threshold: Some(3), ..Default::default() }), ..Default::default() @@ -381,6 +382,9 @@ where .await?; debug!("temp ready!"); + trace!("adding 500ms sleep as workaround!"); + tokio::time::sleep(Duration::from_millis(500)).await; + for GenerateFileCommand { program, args, diff --git a/crates/provider/src/kubernetes/scripts/zombie-wrapper.sh b/crates/provider/src/kubernetes/scripts/zombie-wrapper.sh index ab262ffd7c0529c4e76a9fa06d534b72c0f4308a..6b46d87159418573749fa57d641d1022098036c2 100755 --- a/crates/provider/src/kubernetes/scripts/zombie-wrapper.sh +++ b/crates/provider/src/kubernetes/scripts/zombie-wrapper.sh @@ -8,6 +8,7 @@ if [ -f /cfg/coreutils ]; then LS="/cfg/coreutils ls" KILL="/cfg/coreutils kill" SLEEP="/cfg/coreutils sleep" + ECHO="/cfg/coreutils echo" else RM="rm" MKFIFO="mkfifo" @@ -15,6 +16,7 @@ else LS="ls" KILL="kill" SLEEP="sleep" + ECHO="echo" fi echo "COMMANDS DEFINED" @@ -52,8 +54,17 @@ CMD=($@) echo "COMMAND TO RUN IS: $CMD" start() { - "${CMD[@]}" & + # redirect the output to be expored to loki + "${CMD[@]}" >> /proc/1/fd/1 2 >> /proc/1/fd/2 & child_pid="$!" + + # store pid + $ECHO ${child_pid} > /cfg/zombie.pid + + # check if the process is running + if ! $LS /proc/$child_pid > /dev/null 2>&1 ; then + exit 1 + fi; } restart() { diff --git a/crates/sdk/tests/smoke.rs b/crates/sdk/tests/smoke.rs index 77844d88e8e1c490c8a38f7c9a92f64acac73cd4..303de4e09c883aa720489f1947f75994fbf9d379 100644 --- a/crates/sdk/tests/smoke.rs +++ b/crates/sdk/tests/smoke.rs @@ -1,4 +1,4 @@ -use std::{panic, pin::Pin}; +use std::{panic, pin::Pin, time::Duration}; use configuration::{NetworkConfig, NetworkConfigBuilder}; use futures::{stream::StreamExt, Future}; @@ -83,6 +83,8 @@ fn basic_functionalities_should_works() { let config = small_network(); run_k8s_test(config, |network| { Box::pin(async move { + // give some time to node bootstrap + tokio::time::sleep(Duration::from_secs(3)).await; // Get a ref to the node let alice = network.get_node("alice").unwrap();