diff options
author | Alan Somers <asomers@gmail.com> | 2019-05-26 19:44:47 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2019-06-06 08:54:51 -0600 |
commit | d26749e33a06cf46ca5c2e2e716faf2a71ca747f (patch) | |
tree | 0311c19024981f63d7ec3cd5c0e3c2d8e2b5d2d2 /test/test_stat.rs | |
parent | 129485cfa3455b7eda3217e36ee89d4ca75d38b2 (diff) | |
download | nix-d26749e33a06cf46ca5c2e2e716faf2a71ca747f.zip |
Fix some bugs with multithreaded tests:
* kmod tests must run exclusively, because they load and unload a module
with a constant name.
* A few tests were doing some variant of chdir, but weren't taking the
CWD_MTX.
* The kmod tests read files by path relative to CWD, so they need the
CWD_MTX. But they don't need it exclusively, so convert the CWD_MTX
into an RwLock.
* Tests that do change the cwd need to change it back when they're done.
Diffstat (limited to 'test/test_stat.rs')
-rw-r--r-- | test/test_stat.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test_stat.rs b/test/test_stat.rs index fae8df82..b9da7fc3 100644 --- a/test/test_stat.rs +++ b/test/test_stat.rs @@ -154,6 +154,7 @@ fn test_fchmod() { #[test] fn test_fchmodat() { + let _dr = ::DirRestore::new(); let tempdir = tempfile::tempdir().unwrap(); let filename = "foo.txt"; let fullpath = tempdir.path().join(filename); @@ -241,6 +242,7 @@ fn test_futimens() { #[test] fn test_utimensat() { + let _dr = ::DirRestore::new(); let tempdir = tempfile::tempdir().unwrap(); let filename = "foo.txt"; let fullpath = tempdir.path().join(filename); |