Skip to content

Commit

Permalink
Add more details fslock names
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Mar 30, 2024
1 parent 946db45 commit 14aa91f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions serial_test/src/parallel_file_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion serial_test/src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 8 additions & 4 deletions serial_test/src/serial_file_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 14aa91f

Please sign in to comment.