Remove CHAOS_MODE

This is dead code. It is never set to true.
This commit is contained in:
Daniel Rainer
2025-06-04 00:40:53 +02:00
parent 33b651ad91
commit ccb9c8225f
2 changed files with 0 additions and 10 deletions

View File

@@ -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);

View File

@@ -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