Whamcloud - gitweb
LU-168 Fix schedule race in sanityn PDO lock tests
authornasf <yong.fan@whamcloud.com>
Fri, 8 Jul 2011 16:20:56 +0000 (00:20 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 8 Jul 2011 17:47:17 +0000 (10:47 -0700)
In sanityn PDO lock tests, even if the second operation is blocked by
the first one on server-side, after the blocking, the second one may
be finished earlier than the first one because of client-side schedule
order. So sleep a sec before check_pdo_conflict() to ensure the first
operation is finished after OBD_FAIL_MDS_PDO_LOCK barriers.

Change-Id: I62412d74e17be012ee6660179ad77375c196671d
Signed-off-by: nasf <yong.fan@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1030
Tested-by: Hudson
Reviewed-by: Mikhail Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanityn.sh

index 15c3109..a229c61 100644 (file)
@@ -1031,6 +1031,7 @@ run_test 39c "check truncate mtime update ======================"
 check_pdo_conflict() {
        local pid=$1
        local conflict=0
+       sleep 1 # to ensure OP1 is finished on client if OP2 is blocked by OP1
        if [[ `ps --pid $pid | wc -l` == 1 ]]; then
                conflict=1
                echo "Conflict"