diff --git a/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java b/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java index fd379575b18c..00505269c704 100644 --- a/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java +++ b/community/io/src/test/java/org/neo4j/io/pagecache/PageCacheTest.java @@ -3641,7 +3641,13 @@ public void mustCopyIntoSameSizedWritePageCursor() throws Exception while ( cursorA.next() ) { assertTrue( cursorB.next() ); - assertThat( cursorA.copyTo( 0, cursorB, 0, cursorA.getCurrentPageSize() ), is( pageSize ) ); + int bytesCopied; + do + { + bytesCopied = cursorA.copyTo( 0, cursorB, 0, cursorA.getCurrentPageSize() ); + } + while ( cursorA.shouldRetry() ); + assertThat( bytesCopied, is( pageSize ) ); } } @@ -3655,7 +3661,13 @@ public void mustCopyIntoSameSizedWritePageCursor() throws Exception { assertTrue( cursor.next() ); } - assertThat( cursor.getByte(), is( (byte) i ) ); + byte b; + do + { + b = cursor.getByte(); + } + while( cursor.shouldRetry() ); + assertThat( b, is( (byte) i ) ); } } }