diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh
index 8773ebebaef31aab2f5d4e9d39f65abe4d1d8ca4..ef7d32d0ef517c75fe83f5bf27635edf607a99b4 100644
--- a/lustre/tests/sanityN.sh
+++ b/lustre/tests/sanityN.sh
@@ -160,6 +160,9 @@ test_6() {
 run_test 6 "remove of open file on other node =================="
 
 test_7() {
+	# run_one creates uniq $tdir (bug 13798)
+	# opendirunlink failes if it exists
+	rmdir $DIR1/$tdir || true
 	opendirunlink $DIR1/$tdir $DIR2/$tdir || \
 		error "opendirunlink $DIR1/$tdir $DIR2/$tdir"
 }