From f2df8f3efa70af1d430afd6bc203528ba56f36d0 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Wed, 7 May 2025 14:05:03 -0500 Subject: [PATCH 1/2] Update log message to reflect correct sample count in listener launch --- runtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtest.sh b/runtest.sh index 49de54a..3691e33 100755 --- a/runtest.sh +++ b/runtest.sh @@ -174,7 +174,7 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do if [ "$LISTENER_ENABLED" -eq 1 ]; then LISTENER_SAMPLE_FILE="${TEST_FILE%.csv}-listener-$COUNTER-$i.csv" - log "Launching listener for sample $i/$NUM_TESTS..." + log "Launching listener for sample $i/$NUM_SAMPLES..." READY_FILE="/tmp/listener_ready_${COUNTER}_${i}" From 05ce0e2ee6b02a8a0a49b2ef9c3689c3cc8a4ea2 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Thu, 8 May 2025 10:26:38 -0500 Subject: [PATCH 2/2] Improve listener initialization timeout handling with warning log --- runtest.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/runtest.sh b/runtest.sh index 3691e33..7d756ad 100755 --- a/runtest.sh +++ b/runtest.sh @@ -195,8 +195,18 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do "${ADAPTIVE_ARGS[@]}" > >(tee "$READY_FILE") & LISTENER_PID=$! - # Wait for the READY_FILE to contain "LISTENING_STARTED" - bash -c "until grep -q LISTENING_STARTED $READY_FILE; do sleep 0.2; done" + # Wait up to 10 seconds for LISTENING_STARTED + log "Waiting for listener to initialize (timeout in 10s)..." + for ((j = 0; j < 50; j++)); do + if grep -q LISTENING_STARTED "$READY_FILE"; then + break + fi + sleep 0.2 + done + + if ! grep -q LISTENING_STARTED "$READY_FILE"; then + warn "Listener did not start properly (LISTENING_STARTED not found in time). Proceeding without it." + fi fi log " Sample $i of $NUM_SAMPLES"