diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh
index fad85859df68c5ecdcff091f8a3b321388c796ba..6484ee5a01982234206ad1a4405af04d4dbcef04 100644
--- a/lustre/tests/sanity.sh
+++ b/lustre/tests/sanity.sh
@@ -5512,8 +5512,8 @@ test_140() { #bug-17379
                 }
         done
         i=`expr $i - 1`
-        [ $i -eq 5 -o $i -eq 8 ] || error "Invalid symlink depth"
         echo "The symlink depth = $i"
+        [ $i -eq 5 -o $i -eq 8 ] || error "Invalid symlink depth"
 }
 run_test 140 "Check reasonable stack depth (shouldn't LBUG) ===="