mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Add stress tests for two-way sync functionality
- Introduced a new plan for nuclear-grade stress tests and randomized fuzzing for two-way sync operations, focusing on rapid multi-cycle operations and race conditions. - Created a comprehensive set of todos for implementing timing helpers, a deterministic PRNG, and various fuzz tests to validate the robustness of the two-way sync mechanism. - Enhanced existing infrastructure in `two_way_sync.rs` to support new testing strategies, including the addition of a `FuzzState` tracker and `run_fuzz_iteration` helper for managing randomized operations. - Updated `change_processor.rs` and `api.rs` to improve path handling and suppression logic, ensuring accurate event processing during stress tests.
This commit is contained in:
parent
206ffd3720
commit
df729a871e
3 changed files with 421 additions and 12 deletions
|
|
@ -236,16 +236,34 @@ impl JobThreadContext {
|
|||
}
|
||||
|
||||
// Check if this event should be suppressed (one-shot, from API syncback).
|
||||
// Try both the raw event path and its canonical form since suppress_path
|
||||
// stores whichever form it could resolve at insertion time.
|
||||
let event_path = match &event {
|
||||
VfsEvent::Create(p) | VfsEvent::Write(p) | VfsEvent::Remove(p) => Some(p.clone()),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(ref path) = event_path {
|
||||
let canonical = std::fs::canonicalize(path).ok();
|
||||
let mut suppressed = self.suppressed_paths.lock().unwrap();
|
||||
if let Some(count) = suppressed.get_mut(path) {
|
||||
*count = count.saturating_sub(1);
|
||||
if *count == 0 {
|
||||
suppressed.remove(path);
|
||||
// Determine which key matches: try canonical first (most likely
|
||||
// to match what suppress_path stored), then fall back to raw.
|
||||
let matched_key = canonical
|
||||
.as_ref()
|
||||
.filter(|c| suppressed.contains_key(c.as_path()))
|
||||
.cloned()
|
||||
.or_else(|| {
|
||||
if suppressed.contains_key(path) {
|
||||
Some(path.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
if let Some(key) = matched_key {
|
||||
if let Some(count) = suppressed.get_mut(&key) {
|
||||
*count = count.saturating_sub(1);
|
||||
if *count == 0 {
|
||||
suppressed.remove(&key);
|
||||
}
|
||||
}
|
||||
drop(suppressed);
|
||||
// Still commit so VFS stays consistent, but skip patching.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue