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 10, 2025
1 parent eecf301 commit 37cbb32
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions mountpoint-s3/tests/reftests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,4 +1290,65 @@ mod mutations {
0,
)
}


#[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 37cbb32

Please sign in to comment.