From d3899d2cc3912fe47314a6af0c7bceee89114789 Mon Sep 17 00:00:00 2001 From: Chung En Lee Date: Fri, 20 Sep 2024 00:13:13 +0800 Subject: [PATCH] Clean up files created after TestKeyValueHandlerWithUnhealthyContainer#testMarkContainerUnhealthyInFailedVolume (#7219) --- .../keyvalue/TestKeyValueHandlerWithUnhealthyContainer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandlerWithUnhealthyContainer.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandlerWithUnhealthyContainer.java index f0c8a2077ea..1db2d7ff53e 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandlerWithUnhealthyContainer.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandlerWithUnhealthyContainer.java @@ -35,12 +35,14 @@ import org.apache.hadoop.ozone.container.common.volume.MutableVolumeSet; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.UUID; @@ -72,6 +74,9 @@ public class TestKeyValueHandlerWithUnhealthyContainer { public static final Logger LOG = LoggerFactory.getLogger( TestKeyValueHandlerWithUnhealthyContainer.class); + @TempDir + private File tempDir; + private IncrementalReportSender mockIcrSender; @BeforeEach @@ -220,6 +225,7 @@ public void testMarkContainerUnhealthyInFailedVolume() throws IOException { KeyValueContainerData mockContainerData = mock(KeyValueContainerData.class); HddsVolume mockVolume = mock(HddsVolume.class); when(mockContainerData.getVolume()).thenReturn(mockVolume); + when(mockContainerData.getMetadataPath()).thenReturn(tempDir.getAbsolutePath()); KeyValueContainer container = new KeyValueContainer( mockContainerData, new OzoneConfiguration());