Skip to content

Commit

Permalink
#13196, #13213: Fix test on windows to close file so it can be delete…
Browse files Browse the repository at this point in the history
…d after test run
  • Loading branch information
uschindler committed Mar 25, 2024
1 parent 91b4753 commit ae5d353
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ public void testWithRandom() throws Exception {
out.writeBytes(bytes, 0, bytes.length);
}

final IndexInput in = dir.openInput("test", IOContext.RANDOM);
final byte[] readBytes = new byte[size];
in.readBytes(readBytes, 0, readBytes.length);
assertArrayEquals(bytes, readBytes);
try (final IndexInput in = dir.openInput("test", IOContext.RANDOM)) {
final byte[] readBytes = new byte[size];
in.readBytes(readBytes, 0, readBytes.length);
assertArrayEquals(bytes, readBytes);
}
}
}
}

0 comments on commit ae5d353

Please sign in to comment.