mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-10 15:20:55 +00:00
fix(test/dir): make lock thread-safe (#1575)
* fix(test/dir): make lock thread-safe * stronger ordering
This commit is contained in:
parent
8c71eb5307
commit
0912ed0058
@ -430,8 +430,7 @@ mod tests {
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn symlinked_subdirectory_git_repo_out_of_tree() -> io::Result<()> {
|
||||
while LOCK.load(Ordering::Relaxed) {}
|
||||
LOCK.store(true, Ordering::Relaxed);
|
||||
while LOCK.swap(true, Ordering::Acquire) {}
|
||||
let tmp_dir = TempDir::new_in(home_dir().unwrap().as_path())?;
|
||||
let repo_dir = tmp_dir.path().join("above-repo").join("rocket-controls");
|
||||
let src_dir = repo_dir.join("src/meters/fuel-gauge");
|
||||
@ -452,7 +451,7 @@ mod tests {
|
||||
|
||||
assert_eq!(expected, actual);
|
||||
|
||||
LOCK.store(false, Ordering::Relaxed);
|
||||
LOCK.store(false, Ordering::Release);
|
||||
|
||||
tmp_dir.close()
|
||||
}
|
||||
@ -460,8 +459,7 @@ mod tests {
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn git_repo_in_home_directory_truncate_to_repo_true() -> io::Result<()> {
|
||||
while LOCK.load(Ordering::Relaxed) {}
|
||||
LOCK.store(true, Ordering::Relaxed);
|
||||
while LOCK.swap(true, Ordering::Acquire) {}
|
||||
let tmp_dir = TempDir::new_in(home_dir().unwrap().as_path())?;
|
||||
let dir = tmp_dir.path().join("src/fuel-gauge");
|
||||
fs::create_dir_all(&dir)?;
|
||||
@ -487,7 +485,7 @@ mod tests {
|
||||
|
||||
assert_eq!(expected, actual);
|
||||
|
||||
LOCK.store(false, Ordering::Relaxed);
|
||||
LOCK.store(false, Ordering::Release);
|
||||
|
||||
tmp_dir.close()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user