Skip to content

Commit

Permalink
ci: add delay on podvm smoke-test
Browse files Browse the repository at this point in the history
1s delay between claiming an IP address and launching kata-agent is not
enough in some cases, resulting in a flaky test.

Changing the delay before attempting to connect to the agent to 5s seems
to resolve the issue. Running the test in a loop with 25+ launches didn't
produce a failure, while doing the same with the original 1s delay, will
result in "connection refused" failure after a couple of runs.

Signed-off-by: Magnus Kulke <[email protected]>
  • Loading branch information
mkulke committed Jan 30, 2025
1 parent ad0401b commit b0bc946
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/podvm_smoketest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,21 @@ jobs:
fi
echo "sleeping for ${n} seconds"
sleep "$n"
VM_IP="$(sudo virsh -q domifaddr smoketest | awk '{print $4}' | cut -d/ -f1)"
if [ -n "$VM_IP" ]; then
vm_ip="$(sudo virsh -q domifaddr smoketest | awk '{print $4}' | cut -d/ -f1)"
if [ -n "$vm_ip" ]; then
break
fi
done
echo "VM_IP=$VM_IP" >> "$GITHUB_ENV"
echo "VM_IP=$vm_ip" >> "$GITHUB_ENV"
- name: Run smoke test
run: |
socat UNIX-LISTEN:./apf.sock,fork "TCP:${VM_IP}:15150" &
sleep 1
kata-agent-ctl connect --server-address unix://./apf.sock --cmd CreateSandbox
host_port="${VM_IP}:15150"
sock="./agent.sock"
echo "bridge ${host_port} to ${sock}"
socat "UNIX-LISTEN:${sock},fork" "TCP:${host_port}" &
echo "sleeping for 5 seconds"
sleep 5
kata-agent-ctl connect \
--server-address "unix://${sock}" \
--cmd CreateSandbox

0 comments on commit b0bc946

Please sign in to comment.