Skip to content

Commit

Permalink
Clean up files created after TestKeyValueHandlerWithUnhealthyContaine…
Browse files Browse the repository at this point in the history
…r#testMarkContainerUnhealthyInFailedVolume (apache#7219)
  • Loading branch information
chungen0126 authored Sep 19, 2024
1 parent 70b8dd5 commit d3899d2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -72,6 +74,9 @@ public class TestKeyValueHandlerWithUnhealthyContainer {
public static final Logger LOG = LoggerFactory.getLogger(
TestKeyValueHandlerWithUnhealthyContainer.class);

@TempDir
private File tempDir;

private IncrementalReportSender<Container> mockIcrSender;

@BeforeEach
Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit d3899d2

Please sign in to comment.