Skip to content

Commit

Permalink
Add failing proptest
Browse files Browse the repository at this point in the history
Adds a proptest that exposes (most likely) a bug in Mountpoint regarding the local content (a file that is created, but not open yet) of a directory being forgotten, if all of the remote content is deleted.

Signed-off-by: Christian Hagemeier <[email protected]>
  • Loading branch information
c-hagem committed Jan 13, 2025
1 parent 456c7de commit f261587
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions mountpoint-s3/tests/reftests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ mod mutations {
)

Check warning on line 1308 in mountpoint-s3/tests/reftests/harness.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3/tests/reftests/harness.rs
}


/*
Ensure that local files are shadowed by the remote directories.
*/
Expand All @@ -1330,4 +1331,65 @@ mod mutations {
0,
)

Check warning on line 1332 in mountpoint-s3/tests/reftests/harness.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3/tests/reftests/harness.rs
}


#[test]
fn regression_local_lost_when_removing_remote_entries() {
run_test(TreeNode::Directory(BTreeMap::from([])), vec![
Op::CreateDirectory(
DirectoryIndex(
0,
),
ValidName(
"a".into(),
),
),
Op::CreateDirectory(
DirectoryIndex(
0,
),
ValidName(
"-".into(),
),
),
Op::WriteFile(
ValidName(
"a".into(),
),
DirectoryIndex(
1,
),
FileContent(
0,
FileSize::Small(0),
),
),
Op::CreateFile(
ValidName(
"aa".into(),
),
DirectoryIndex(
1,
),
FileContent(
0,
FileSize::Small(0),
),
),
Op::DeleteObject(
KeyIndex(
0,
),
),
Op::CreateDirectory(
DirectoryIndex(
0,
),
ValidName(
"a".into(),
),
),
], 0)
}

}

0 comments on commit f261587

Please sign in to comment.