Whamcloud - gitweb
LU-16457 tests: wait for remote sleep in sanity-pcc/101a 87/49587/9
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 10 Jan 2023 15:37:03 +0000 (08:37 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 3 Feb 2023 06:51:27 +0000 (06:51 +0000)
Wait longer for the remote sleep command to start on the agent node.

Test-Parameters: trivial testlist=sanity-pcc env=ONLY=101a,ONLY_REPEAT=200
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I5dcbd6a7127b3e17aa658c87f5c75874432dc353
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49587
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Feng Lei <flei@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-pcc.sh

index a1b1072..8dc3ada 100644 (file)
@@ -1510,13 +1510,18 @@ test_101a() {
        echo "creating user namespace for $RUNAS_ID"
        # Create a mount and user namespace with this command, and leave the
        # process running so we can do the rest of our steps
-       do_facet $SINGLEAGT $RUNAS unshare -Um sleep 600 &
-       # Let the child start...
-       sleep 2
-       # Get the sleep PID so we can find its namespace and kill it later
-       PID=$(do_facet $SINGLEAGT pgrep sleep)
+       local start=$SECONDS
+       local PID=$(do_facet $SINGLEAGT \
+                   "$RUNAS unshare -Um sleep 600 &>/dev/null & echo \\\$!")
+       local elapsed=$((SECONDS - start))
+       local count=0
+
+       do_facet $SINGLEAGT ps auxww | grep sleep
+       echo "Created NS: child (sleep) pid=$PID in $elapsed seconds"
+       [[ -n "$PID" ]] || error "remote sleep start failed"
        stack_trap "do_facet $SINGLEAGT kill -9 $PID" EXIT
-       echo "Created NS: child (sleep) pid $PID"
+       (( elapsed < 300 )) || error "remote sleep took $elapsed sec to start"
+
        # Map 'RUNAS' to root in the namespace, so it has rights to do whatever
        # This is handled by '-r' in unshare in newer versions
        do_facet $SINGLEAGT $RUNAS newuidmap $PID 0 $RUNAS_ID 1 ||