integration: add a double rename stress test

Reviewed By: kmancini

Differential Revision: D38007959

fbshipit-source-id: d4cb79d6bbff918d01c8ad7af616306a9ce0d7a3
This commit is contained in:
Xavier Deguillard 2022-08-02 13:03:34 -07:00 committed by Facebook GitHub Bot
parent 03004f5a41
commit f725a47f82

View File

@ -262,3 +262,31 @@ class PrjFSStress(testcase.EdenRepoTest):
("hello", stat.S_IFREG),
}
)
def test_rename_twice(self) -> None:
with self.run_with_fault():
self.mkdir("first")
self.touch("first/a")
self.mkdir("first/b")
self.mkdir("second")
self.touch("second/c")
self.touch("second/d")
self.rename("first", "third")
self.rename("second", "first")
self.rename("third", "second")
self.wait_on_fault_unblock(12)
self.assertAllMaterialized(
{
("first", stat.S_IFDIR),
("first/c", stat.S_IFREG),
("first/d", stat.S_IFREG),
("second", stat.S_IFDIR),
("second/a", stat.S_IFREG),
("second/b", stat.S_IFDIR),
("hello", stat.S_IFREG),
}
)