do not fault on Fsync until we correctly define the expected behaviour in the simulator

This commit is contained in:
pedrocarlo
2025-08-26 12:26:20 -03:00
parent c158db072b
commit 1eb1171f55
3 changed files with 6 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ use rand::{RngCore, SeedableRng};
use rand_chacha::ChaCha8Rng;
use turso_core::{Clock, IO, Instant, OpenFlags, PlatformIO, Result};
use crate::runner::{clock::SimulatorClock, file::SimulatorFile, SimIO};
use crate::runner::{SimIO, clock::SimulatorClock, file::SimulatorFile};
pub(crate) struct SimulatorIO {
pub(crate) inner: Box<dyn IO>,

View File

@@ -5,7 +5,7 @@ use std::{
use rand::{Rng as _, SeedableRng};
use rand_chacha::ChaCha8Rng;
use tracing::{instrument, Level};
use tracing::{Level, instrument};
use turso_core::{Completion, File, Result};
use crate::runner::{
@@ -131,7 +131,8 @@ impl MemorySimFile {
}
fn insert_op(&self, op: OperationType) {
let fault = self.fault.get();
// FIXME: currently avoid any fsync faults until we correctly define the expected behaviour in the simulator
let fault = self.fault.get() && !matches!(op, OperationType::Sync { .. });
if fault {
let mut io_tracker = self.io_tracker.borrow_mut();
match &op {

View File

@@ -5,11 +5,11 @@ use indexmap::IndexMap;
use parking_lot::Mutex;
use rand::{RngCore, SeedableRng};
use rand_chacha::ChaCha8Rng;
use turso_core::{Clock, Completion, Instant, OpenFlags, Result, IO};
use turso_core::{Clock, Completion, IO, Instant, OpenFlags, Result};
use crate::runner::SimIO;
use crate::runner::clock::SimulatorClock;
use crate::runner::memory::file::MemorySimFile;
use crate::runner::SimIO;
/// File descriptor
pub type Fd = String;