mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 21:00:35 +00:00
Randomly mutate worktree in addition to mutating the file-system
This ensures that we test the code path that refreshes entries. Co-Authored-By: Julia Risley <julia@zed.dev>
This commit is contained in:
parent
7f27d72b20
commit
48ad3866b7
1 changed files with 11 additions and 1 deletions
|
@ -3946,7 +3946,17 @@ mod tests {
|
||||||
let mut mutations_len = operations;
|
let mut mutations_len = operations;
|
||||||
fs.as_fake().pause_events().await;
|
fs.as_fake().pause_events().await;
|
||||||
while mutations_len > 1 {
|
while mutations_len > 1 {
|
||||||
|
if rng.gen_bool(0.2) {
|
||||||
|
worktree
|
||||||
|
.update(cx, |worktree, cx| {
|
||||||
|
randomly_mutate_worktree(worktree, &mut rng, cx)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
} else {
|
||||||
randomly_mutate_fs(&fs, root_dir, 1.0, &mut rng).await;
|
randomly_mutate_fs(&fs, root_dir, 1.0, &mut rng).await;
|
||||||
|
}
|
||||||
|
|
||||||
let buffered_event_count = fs.as_fake().buffered_event_count().await;
|
let buffered_event_count = fs.as_fake().buffered_event_count().await;
|
||||||
if buffered_event_count > 0 && rng.gen_bool(0.3) {
|
if buffered_event_count > 0 && rng.gen_bool(0.3) {
|
||||||
let len = rng.gen_range(0..=buffered_event_count);
|
let len = rng.gen_range(0..=buffered_event_count);
|
||||||
|
|
Loading…
Reference in a new issue