diff --git a/test/e2e/cli/attach.sh b/test/e2e/cli/attach.sh index 56bdb83f2..d16192fc7 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"