summaryrefslogtreecommitdiff
path: root/tests/reverse
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-10-03 21:15:17 +0200
committerJakob Unterwurzacher2017-10-03 21:15:17 +0200
commit64e5906ffa1f225a51048b3d0ac6b1a09e2ca170 (patch)
tree1f1ae78b2ddd9a7d670ffe315b4b58e3b0be6f50 /tests/reverse
parent4da245c69d7994efec75e1deaef56a03020d39db (diff)
fusefrontend_reverse: workaround ext4 test failure
The extended TestLongnameStat() exposes a pathological case when run on ext4, as ext4 reuses inode numbers immediately. This change modifies the test to not delete the files immediately, so the inode numbers cannot be reused immediately. Fix for the underlying issue is a TODO.
Diffstat (limited to 'tests/reverse')
-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))
}
}