leerho commented on code in PR #576:
URL: https://github.com/apache/datasketches-java/pull/576#discussion_r1718875132
##########
src/test/java/org/apache/datasketches/quantiles/DoublesSketchTest.java:
##########
@@ -140,50 +139,37 @@ public void checkEmptyExceptions() {
@Test
public void directSketchShouldMoveOntoHeapEventually() {
- try (WritableHandle wdh = WritableMemory.allocateDirect(1000,
- ByteOrder.nativeOrder(), new DefaultMemoryRequestServer())) {
- WritableMemory mem = wdh.getWritable();
- UpdateDoublesSketch sketch = DoublesSketch.builder().build(mem);
- Assert.assertTrue(sketch.isSameResource(mem));
- for (int i = 0; i < 1000; i++) {
- sketch.update(i);
- }
- Assert.assertFalse(sketch.isSameResource(mem));
- } catch (final Exception e) {
- throw new RuntimeException(e);
+ WritableMemory wmem = WritableMemory.allocateDirect(1000,
ByteOrder.nativeOrder(), new DefaultMemoryRequestServer());
+ UpdateDoublesSketch sketch = DoublesSketch.builder().build(wmem);
+ Assert.assertTrue(sketch.isSameResource(wmem));
+ for (int i = 0; i < 1000; i++) {
+ sketch.update(i);
}
+ println(sketch.toString());
}
@Test
public void directSketchShouldMoveOntoHeapEventually2() {
Review Comment:
Right. If _wmem_ is still alive at the end then the test failed. I just
added one line.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]