You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/08/03 04:06:54 UTC

[GitHub] [flink] zhuzhurk commented on a change in pull request #12917: [FLINK-18355][tests] Simplify tests of SlotPoolImpl

zhuzhurk commented on a change in pull request #12917:
URL: https://github.com/apache/flink/pull/12917#discussion_r464183893



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolBatchSlotRequestTest.java
##########
@@ -81,8 +67,10 @@ public static void teardownClass() {
 	 */
 	@Test
 	public void testPendingBatchSlotRequestTimeout() throws Exception {
-		try (final SlotPoolImpl slotPool = new SlotPoolBuilder(mainThreadExecutor)
-				.build()) {
+		try (final SlotPoolImpl slotPool = slotPoolBuilder
+			.setBatchSlotTimeout(Time.milliseconds(2L))
+			.build()) {
+
 			final CompletableFuture<PhysicalSlot> slotFuture = SlotPoolUtils.requestNewAllocatedBatchSlot(
 				slotPool,
 				mainThreadExecutor,

Review comment:
       To avoid thread leak, it's better to use `try-finally`. A ref can be `SlotPoolPendingRequestFailureTest#testPendingSlotRequestTimeout`.




----------------------------------------------------------------
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:
users@infra.apache.org