]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: workaround race condition in tests 2024/head
authorLoic Dachary <loic@dachary.org>
Wed, 25 Jun 2014 16:07:47 +0000 (18:07 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 25 Jun 2014 16:11:51 +0000 (18:11 +0200)
Trying to "ceph tell" a newly created OSD sometime triggers an
ENXIO. The OSD creation function used for test scripts waits for the OSD
to report that it is up (according to ceph osd tree) before
returning. That reduces (maybe close ?) the condition that triggers the
error so that the tests do not randomly fail.

http://tracker.ceph.com/issues/8630 refs: #8630

Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/osd/osd-test-helpers.sh

index 5117ae38b50aee3a3b01aa8dd02bd33f0953e272..fd05515767359da2d65ddb641889ea0167820d33 100644 (file)
@@ -51,4 +51,17 @@ function run_osd() {
     [ "$id" = "$(cat $osd_data/whoami)" ] || return 1
 
     ./ceph osd crush create-or-move "$id" 1 root=default host=localhost
+
+    status=1
+    # Workaround for http://tracker.ceph.com/issues/8630
+    for ((i=0; i < 60; i++)); do
+        if ! ceph osd dump | grep "osd.$id up"; then
+            sleep 1
+        else
+            status=0
+            break
+        fi
+    done
+
+    return $status
 }