mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-11 04:04:20 +01:00
do not fault on Fsync until we correctly define the expected behaviour in the simulator
This commit is contained in:
@@ -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>,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user