zentol commented on a change in pull request #8416: [FLINK-12331] Introduce
partition/gate setup to decouple task registration with NetworkEnvironment
URL: https://github.com/apache/flink/pull/8416#discussion_r284667365
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPoolTest.java
##########
@@ -236,35 +236,32 @@ public void
testRequestMemorySegmentsMoreThanTotalBuffers() throws Exception {
}
/**
- * Tests {@link NetworkBufferPool#requestMemorySegments(int)} with the
invalid argument to
+ * Tests {@link NetworkBufferPool} constructor with the invalid
argument to
* cause exception.
*/
- @Test
- public void testRequestMemorySegmentsWithInvalidArgument() throws
Exception {
- final int numBuffers = 10;
-
- NetworkBufferPool globalPool = new
NetworkBufferPool(numBuffers, 128);
-
+ @Test(expected = IllegalArgumentException.class)
+ public void testRequestMemorySegmentsWithInvalidArgument() {
+ NetworkBufferPool globalPool = null;
try {
// the number of requested buffers should be larger
than zero
- globalPool.requestMemorySegments(0);
+ globalPool = new NetworkBufferPool(10, 128, 0);
Review comment:
Would move this out of the `try` block. If this fails the finally block
isn't doing anything anyway.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services