summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/reverse/correctness_test.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go
index 40b53f9..ee0a5b0 100644
--- a/tests/reverse/correctness_test.go
+++ b/tests/reverse/correctness_test.go
@@ -2,6 +2,7 @@ package reverse_test
import (
"bytes"
+ "fmt"
"io/ioutil"
"os"
"syscall"
@@ -23,13 +24,17 @@ func TestLongnameStat(t *testing.T) {
fd.Close()
path := dirC + "/" + name
if !test_helpers.VerifyExistence(path) {
- t.Fail()
+ t.Fatalf("failed to verify %q", path)
}
test_helpers.VerifySize(t, path, 0)
// A large number of longname files is a performance problem in
- // reverse mode. Delete the file once we are done with it to speed up
- // the test (2 seconds -> 0.2 seconds)
- syscall.Unlink(dirA + "/" + name)
+ // reverse mode. Move the file out of the way once we are done with it
+ // to speed up the test (2 seconds -> 0.2 seconds).
+ // We do NOT unlink it because ext4 reuses inode numbers immediately,
+ // which will cause "Found linked inode, but Nlink == 1" warnings and
+ // file not found errors.
+ // TODO: This problem should be handled at the go-fuse level.
+ syscall.Rename(dirA+"/"+name, test_helpers.TmpDir+"/"+fmt.Sprintf("x%d", i))
}
}