libgocryptfs/tests
Jakob Unterwurzacher a55b3cc15a tests/matrix: fix data race in TestConcurrentReadWrite
Fixes https://github.com/golang/go/issues/54715

Output was:

$ go test ./tests/matrix -run TestConcurrentReadWrite -race
test_helpers: warning: testParentDir "/tmp/gocryptfs-test-parent-1026" does not reside on ext4, we will miss failures caused by ino reuse
PASS
PASS
==================
WARNING: DATA RACE
Write at 0x00c00038a0e0 by goroutine 63:
  runtime.racewriterange()
      <autogenerated>:1 +0x29
  internal/poll.(*FD).Pread()
      /usr/local/go/src/internal/poll/fd_unix.go:193 +0x169
  os.(*File).pread()
      /usr/local/go/src/os/file_posix.go:40 +0x335
  os.(*File).ReadAt()
      /usr/local/go/src/os/file.go:136 +0x2de
  github.com/rfjakob/gocryptfs/v2/tests/matrix.TestConcurrentReadWrite.func1()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/matrix/concurrency_test.go:40 +0x14b

Previous write at 0x00c00038a0e0 by goroutine 61:
  runtime.racewriterange()
      <autogenerated>:1 +0x29
  internal/poll.(*FD).Pread()
      /usr/local/go/src/internal/poll/fd_unix.go:193 +0x169
  os.(*File).pread()
      /usr/local/go/src/os/file_posix.go:40 +0x335
  os.(*File).ReadAt()
      /usr/local/go/src/os/file.go:136 +0x2de
  github.com/rfjakob/gocryptfs/v2/tests/matrix.TestConcurrentReadWrite.func1()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/matrix/concurrency_test.go:40 +0x14b

Goroutine 63 (running) created at:
  github.com/rfjakob/gocryptfs/v2/tests/matrix.TestConcurrentReadWrite()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/matrix/concurrency_test.go:34 +0x31d
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /usr/local/go/src/testing/testing.go:1493 +0x47

Goroutine 61 (running) created at:
  github.com/rfjakob/gocryptfs/v2/tests/matrix.TestConcurrentReadWrite()
      /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/matrix/concurrency_test.go:34 +0x31d
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /usr/local/go/src/testing/testing.go:1493 +0x47
==================
--- FAIL: TestConcurrentReadWrite (0.03s)
    testing.go:1319: race detected during execution of test
FAIL
TestMain: matrix[2] = matrix.testcaseMatrix{plaintextnames:false, openssl:"false", aessiv:false, raw64:false, extraArgs:[]string(nil)} failed
FAIL	github.com/rfjakob/gocryptfs/v2/tests/matrix	0.170s
FAIL
2022-08-28 20:31:27 +02:00
..
cli tests: add TestLongnamemax100Reverse 2022-08-28 11:07:35 +02:00
defaults make format 2022-08-28 11:11:36 +02:00
deterministic_names go mod: declare module version v2 2021-08-23 15:05:15 +02:00
example_filesystems Fix typos 2022-06-26 10:59:06 +02:00
fsck go mod: declare module version v2 2021-08-23 15:05:15 +02:00
hkdf_sanity go mod: declare module version v2 2021-08-23 15:05:15 +02:00
matrix tests/matrix: fix data race in TestConcurrentReadWrite 2022-08-28 20:31:27 +02:00
plaintextnames tests: convert Creat() calls to Open() 2021-12-08 18:49:21 +01:00
reverse tests: improve SEEK_DATA test for MacOS 2022-01-04 15:21:20 +01:00
root_test make format 2022-08-28 11:11:36 +02:00
sharedstorage tests: convert Creat() calls to Open() 2021-12-08 18:49:21 +01:00
stress_tests *: trim trailing whitespace 2021-09-01 10:22:01 +02:00
symlink_race golangci-lint: fix issues found by "unused" and "deadcode" 2021-08-19 08:34:49 +02:00
test_helpers tests: enable -fusedebug if FUSEDEBUG env is set 2022-01-22 11:46:08 +01:00
xattr make format 2022-08-28 11:11:36 +02:00
canonical-benchmarks.bash shell scripts: fix shellcheck warnings 2021-09-01 10:22:01 +02:00
dl-linux-tarball.bash shell scripts: fix shellcheck warnings 2021-09-01 10:22:01 +02:00
fuse-unmount.bash shell scripts: fix shellcheck warnings 2021-09-01 10:22:01 +02:00
len2elen.sh shell scripts: fix shellcheck warnings 2021-09-01 10:22:01 +02:00
sshfs-benchmark.bash shell scripts: fix shellcheck warnings 2021-09-01 10:22:01 +02:00