rpuch commented on code in PR #2829:
URL: https://github.com/apache/ignite-3/pull/2829#discussion_r1389467954
##########
modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/persistence/store/AbstractFilePageStoreIoTest.java:
##########
@@ -373,4 +376,36 @@ void testRenameAndEnsureRace() throws Exception {
verify(ioFactory).create(newFilePath, CREATE, READ, WRITE);
}
}
+
+ @ParameterizedTest
+ @MethodSource("ioFactories")
+ void testRenameAndReadRace(FileIoFactory ioFactory) throws Exception {
+ Path filePath = workDir.resolve("test");
+
+ try (AbstractFilePageStoreIo filePageStoreIo =
createFilePageStoreIo(filePath, ioFactory)) {
+ filePageStoreIo.ensure();
+
+ long expPageId = createDataPageId(() -> 1);
+
+ ByteBuffer byteBuffer = createPageByteBuffer(expPageId, PAGE_SIZE);
+
+ filePageStoreIo.write(expPageId, byteBuffer.rewind(), true);
+
+ // Loop works way better when you need to reproduce a particularly
naughty race.
Review Comment:
Better than what? Probably better than `@RepeatedTest`, but it's not clear
from the context. Let's either clarify the comment or drop it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]