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 a4055da commit 61e5da3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,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 61e5da3

Please sign in to comment.