]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/ceph-helpers.sh: added time out to ceph pg $pgid query -f json wip-ksirivad-fix-67093
authorKamoltat Sirivadhna <ksirivad@redhat.com>
Wed, 26 Nov 2025 21:24:25 +0000 (21:24 +0000)
committerKamoltat Sirivadhna <ksirivad@redhat.com>
Wed, 26 Nov 2025 21:24:25 +0000 (21:24 +0000)
Fixes: https://tracker.ceph.com/issues/74004
Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
qa/standalone/ceph-helpers.sh

index ccf5f63ee874c4ebbc9654d4ed14a7ba0eab8c58..8c974f4d4cf369c8b5379992d26a59d50ff3317d 100755 (executable)
@@ -1571,7 +1571,10 @@ function test_is_clean() {
 function is_pg_clean() {
     local pgid=$1
     local pg_state
-    pg_state=$(ceph pg $pgid query 2>/dev/null | jq -r ".state ")
+    pg_state=$(timeout 120 bash -c "ceph pg $pgid query -f json" 2>/dev/null | jq -r ".state ")
+    if [[ $? -eq 124 ]]; then
+        echo "WARN: timeout running 'ceph pg $pgid query'" >&2
+    fi
     [[ "$pg_state" == "active+clean"* ]]
 }