From c1c878d2779cfde42cc80f1ff0d4aac44da73de9 Mon Sep 17 00:00:00 2001 From: Patrice Hannotin Date: Sat, 1 Nov 2025 16:21:13 +0100 Subject: [PATCH] add retry to io check in e2e tests --- test/e2e/cli/attach.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/e2e/cli/attach.sh b/test/e2e/cli/attach.sh index 56bdb83f28..d16192fc76 100644 --- a/test/e2e/cli/attach.sh +++ b/test/e2e/cli/attach.sh @@ -11,6 +11,17 @@ $pm2 start stdin.js -o out-rel.log --merge-logs # Send LINE\n to stdin application $pm2 send 0 "LINE" +# Wait for log to be written with circuit breaker +max_attempts=5 +attempt=0 +while [ $attempt -lt $max_attempts ]; do + if grep -q "LINE" out-rel.log 2>/dev/null; then + break + fi + sleep 0.1 + attempt=$((attempt + 1)) +done + cat out-rel.log grep "LINE" out-rel.log spec "Should have reveived line"