From 14aa91f5d472a1fd2472d637c0e5a53657be514d Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Sat, 30 Mar 2024 22:13:11 +0000 Subject: [PATCH] Add more details fslock names --- serial_test/src/parallel_file_lock.rs | 4 ++-- serial_test/src/rwlock.rs | 2 +- serial_test/src/serial_file_lock.rs | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/serial_test/src/parallel_file_lock.rs b/serial_test/src/parallel_file_lock.rs index beed7e1..a030e74 100644 --- a/serial_test/src/parallel_file_lock.rs +++ b/serial_test/src/parallel_file_lock.rs @@ -102,10 +102,10 @@ mod tests { #[test] fn unlock_on_assert_sync_without_return() { - let lock_path = path_for_name("unlock_on_assert_sync_without_return"); + let lock_path = path_for_name("parallel_unlock_on_assert_sync_without_return"); let _ = panic::catch_unwind(|| { fs_parallel_core( - vec!["unlock_on_assert_sync_without_return"], + vec!["parallel_unlock_on_assert_sync_without_return"], Some(&lock_path), || { assert!(false); diff --git a/serial_test/src/rwlock.rs b/serial_test/src/rwlock.rs index 59096b9..0be0c90 100644 --- a/serial_test/src/rwlock.rs +++ b/serial_test/src/rwlock.rs @@ -118,7 +118,7 @@ impl Locks { pub fn end_parallel(&self) { #[cfg(feature = "logging")] - debug!("End parallel"); + debug!("End parallel '{}", self.name); let mut lock_state = self.arc.mutex.lock(); assert!(lock_state.parallels > 0); lock_state.parallels -= 1; diff --git a/serial_test/src/serial_file_lock.rs b/serial_test/src/serial_file_lock.rs index ba92172..2c99569 100644 --- a/serial_test/src/serial_file_lock.rs +++ b/serial_test/src/serial_file_lock.rs @@ -74,11 +74,15 @@ mod tests { #[test] fn unlock_on_assert_sync_without_return() { - let lock_path = path_for_name("unlock_on_assert_sync_without_return"); + let lock_path = path_for_name("serial_unlock_on_assert_sync_without_return"); let _ = panic::catch_unwind(|| { - fs_serial_core(vec!["foo"], Some(&lock_path), || { - assert!(false); - }) + fs_serial_core( + vec!["serial_unlock_on_assert_sync_without_return"], + Some(&lock_path), + || { + assert!(false); + }, + ) }); let mut lockfile = LockFile::open(&lock_path).unwrap(); assert!(lockfile.try_lock().unwrap());