test failure in org.apache.jackrabbit.oak.segment.standby.ExternalPrivateStoreIT
Closed all InputStreams left open
@@ -152,9 +152,13 @@ public abstract class DataStoreTestBase extends TestBase {
Blob b = ps.getValue(Type.BINARY);
assertEquals(blobSize, b.length());
byte[] testData = new byte[blobSize];
- ByteStreams.readFully(b.getNewStream(), testData);
+ try (
+ InputStream blobInputStream = b.getNewStream()
+ ) {
+ ByteStreams.readFully(blobInputStream, testData);
assertArrayEquals(data, testData);
}
+ }
/*
* See OAK-5902.
@@ -190,7 +194,12 @@ public abstract class DataStoreTestBase extends TestBase {
Blob b = ps.getValue(Type.BINARY);
assertEquals(blobSize, b.length());
- assertTrue(IOUtils.contentEquals(newRandomInputStream(blobSize, seed), b.getNewStream()));
+ try (
+ InputStream randomInputStream = newRandomInputStream(blobSize, seed);
+ InputStream blobInputStream = b.getNewStream()
+ ) {
+ assertTrue(IOUtils.contentEquals(randomInputStream, blobInputStream));
+ }
}
/*
@@ -302,7 +311,11 @@ public abstract class DataStoreTestBase extends TestBase {
Blob b = ps.getValue(Type.BINARY);
assertEquals(blobSize, b.length());
byte[] testData = new byte[blobSize];
- ByteStreams.readFully(b.getNewStream(), testData);
+ try (
+ InputStream blobInputStream = b.getNewStream()
+ ) {
+ ByteStreams.readFully(blobInputStream, testData);
assertArrayEquals(data, testData);
}
}
+}
