diff --git a/src/history.rs b/src/history.rs index 35f576cff..8db59cbfb 100644 --- a/src/history.rs +++ b/src/history.rs @@ -1360,9 +1360,6 @@ unsafe fn maybe_lock_file(file: &mut File, lock_type: libc::c_int) -> bool { if ABANDONED_LOCKING.load() { return false; } - if CHAOS_MODE.load() { - return false; - } if path_get_data_remoteness() == DirRemoteness::remote { return false; } @@ -2084,7 +2081,3 @@ pub fn in_private_mode(vars: &dyn Environment) -> bool { /// Whether to force the read path instead of mmap. This is useful for testing. static NEVER_MMAP: RelaxedAtomicBool = RelaxedAtomicBool::new(false); - -/// Whether we're in maximum chaos mode, useful for testing. -/// This causes things like locks to fail. -pub static CHAOS_MODE: RelaxedAtomicBool = RelaxedAtomicBool::new(false); diff --git a/src/tests/history.rs b/src/tests/history.rs index d0a7e319a..db1942f07 100644 --- a/src/tests/history.rs +++ b/src/tests/history.rs @@ -272,8 +272,6 @@ fn test_history_races() { // Ensure history is clear. History::new(L!("race_test")).clear(); - // history::CHAOS_MODE.store(true); - let mut children = Vec::with_capacity(RACE_COUNT); for i in 0..RACE_COUNT { children.push(std::thread::spawn(move || { @@ -295,7 +293,6 @@ fn test_history_races() { // Ensure that we got sane, sorted results. let hist = History::new(L!("race_test")); - history::CHAOS_MODE.store(false); // History is enumerated from most recent to least // Every item should be the last item in some array