mount: run tests in a subprocess to fix deadlock - fixes #3259

Before this change we ran the tests and the mount in the same process.
This could cause deadlocks and often did, and made the mount tests
very unreliable.

This fixes the problem by running the mount in a seperate process and
commanding it via a pipe over stdin/stdout.
This commit is contained in:
Nick Craig-Wood 2022-06-16 12:08:11 +01:00
parent 626a416ff8
commit 4a382c09ec
5 changed files with 327 additions and 153 deletions

View file

@ -46,7 +46,7 @@ func TestWriteFileDoubleClose(t *testing.T) {
// write to the other dup
_, err = unix.Write(fd2, buf)
if run.vfs.Opt.CacheMode < vfscommon.CacheModeWrites {
if run.vfsOpt.CacheMode < vfscommon.CacheModeWrites {
// produces an error if cache mode < writes
assert.Error(t, err, "input/output error")
} else {