From 7fc3f94e241a8095197c1c7dd879e00c711dd1ce Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 24 May 2025 11:57:31 +0300 Subject: [PATCH] nixosTests.mycelium: make less flaky We immediately expected for the other peer to be available in the peer list, right after startup, but that's racy. Instead try the pinging multiple times until it succeeds (max 10 times), then check the list of peers for completion. (cherry picked from commit bb05bee4e5f3a987bf83b537fdebb6c1198a7783) --- nixos/tests/mycelium/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/tests/mycelium/default.nix b/nixos/tests/mycelium/default.nix index 82ec074f77c4..49184abd223a 100644 --- a/nixos/tests/mycelium/default.nix +++ b/nixos/tests/mycelium/default.nix @@ -61,11 +61,13 @@ import ../make-test-python.nix ( peer1.wait_for_unit("mycelium.service") peer2.wait_for_unit("mycelium.service") + # Give mycelium some time to discover the other peer + peer1.wait_until_succeeds("ping -c1 ${peer2-ip}", timeout=10) + peer2.succeed("ping -c1 ${peer1-ip}") + peer1.succeed("mycelium peers list | grep 192.168.1.12") peer2.succeed("mycelium peers list | grep 192.168.1.11") - peer1.succeed("ping -c5 ${peer2-ip}") - peer2.succeed("ping -c5 ${peer1-ip}") ''; } )