[PATCH stalld 25/36] tests/functional: Use wait_for_stalld_ready() in test_backend_selection

Wander Lairson Costa <[email protected]>
Newsgroups org.kernel.vger.linux-rt-users
Message-ID <[email protected]>
Replace the post-startup sleep with wait_for_stalld_ready() for
event-driven readiness detection. Add -g 1 for consistency with
start_stalld_with_log().

Signed-off-by: Wander Lairson Costa <[email protected]>
---
 tests/functional/test_backend_selection.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/functional/test_backend_selection.sh b/tests/functional/test_backend_selection.sh
index 5d60072..c274025 100755
--- a/tests/functional/test_backend_selection.sh
+++ b/tests/functional/test_backend_selection.sh
@@ -33,15 +33,15 @@ test_backend_flag() {
 
 	CLEANUP_FILES+=("${log_file}")
 
-	"${TEST_ROOT}/../stalld" -v -f -l -b "${backend_flag}" -t 60 \
+	"${TEST_ROOT}/../stalld" -v -f -l -g 1 -b "${backend_flag}" -t 60 \
 		> "${log_file}" 2>&1 &
 	STALLD_PID=$!
 	CLEANUP_PIDS+=("${STALLD_PID}")
-	sleep 1
 
-	if ! kill -0 ${STALLD_PID} 2>/dev/null; then
+	if ! wait_for_stalld_ready "${log_file}" 15; then
 		TEST_FAILED=$((TEST_FAILED + 1))
 		echo -e "  ${RED}FAIL${NC}: stalld failed to start (${description})"
+		stop_stalld
 		return 1
 	fi
 
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.