diff options
author | Ryan Zoeller <rtzoeller@rtzoeller.com> | 2021-11-27 13:50:29 -0600 |
---|---|---|
committer | Ryan Zoeller <rtzoeller@rtzoeller.com> | 2021-11-27 13:50:29 -0600 |
commit | 09bddc36769b4be38b6ce567c3352e2934204771 (patch) | |
tree | 679be22f4cdb6c9775b2da67551bca55c61900bc /test/sys/test_termios.rs | |
parent | b91bce3113c79728e84b1a24a565b5cac6333f52 (diff) | |
download | nix-09bddc36769b4be38b6ce567c3352e2934204771.zip |
Avoid lock poisoning by using parking_lot
parking_lot provides synchronization primitives which aren't
poisoned on panic. This makes it easier to determine which tests
are failing, as a test failure no longer causes all subsequent tests
using that mutex to fail.
Diffstat (limited to 'test/sys/test_termios.rs')
-rw-r--r-- | test/sys/test_termios.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sys/test_termios.rs b/test/sys/test_termios.rs index 63d6a51f..4a861543 100644 --- a/test/sys/test_termios.rs +++ b/test/sys/test_termios.rs @@ -19,7 +19,7 @@ fn write_all(f: RawFd, buf: &[u8]) { #[test] fn test_tcgetattr_pty() { // openpty uses ptname(3) internally - let _m = crate::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test"); + let _m = crate::PTSNAME_MTX.lock(); let pty = openpty(None, None).expect("openpty failed"); assert!(termios::tcgetattr(pty.slave).is_ok()); @@ -46,7 +46,7 @@ fn test_tcgetattr_ebadf() { #[test] fn test_output_flags() { // openpty uses ptname(3) internally - let _m = crate::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test"); + let _m = crate::PTSNAME_MTX.lock(); // Open one pty to get attributes for the second one let mut termios = { @@ -88,7 +88,7 @@ fn test_output_flags() { #[test] fn test_local_flags() { // openpty uses ptname(3) internally - let _m = crate::PTSNAME_MTX.lock().expect("Mutex got poisoned by another test"); + let _m = crate::PTSNAME_MTX.lock(); // Open one pty to get attributes for the second one let mut termios = { |