This is an automated email from the ASF dual-hosted git repository.

hzh0425 pushed a commit to branch dledger-controller-snapshot
in repository https://gitbox.apache.org/repos/asf/rocketmq.git

commit 90da4923e7b23fbf95c525f888b41ee0c5c56dbe
Author: hzh0425 <[email protected]>
AuthorDate: Mon Jan 2 19:46:01 2023 +0800

    Add shutdown hook in StatemachineSnapshotFileGeneratorTest
---
 .../impl/statemachine/StatemachineSnapshotFileGeneratorTest.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/statemachine/StatemachineSnapshotFileGeneratorTest.java
 
b/controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/statemachine/StatemachineSnapshotFileGeneratorTest.java
index 9a092ebc1..01a774d6a 100644
--- 
a/controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/statemachine/StatemachineSnapshotFileGeneratorTest.java
+++ 
b/controller/src/test/java/org/apache/rocketmq/controller/impl/controller/impl/statemachine/StatemachineSnapshotFileGeneratorTest.java
@@ -16,10 +16,12 @@
  */
 package org.apache.rocketmq.controller.impl.controller.impl.statemachine;
 
+import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.controller.impl.manager.BrokerInfo;
 import org.apache.rocketmq.controller.impl.manager.ReplicasInfoManager;
 import org.apache.rocketmq.controller.impl.manager.SyncStateInfo;
 import 
org.apache.rocketmq.controller.impl.statemachine.StatemachineSnapshotFileGenerator;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -75,6 +77,11 @@ public class StatemachineSnapshotFileGeneratorTest {
         this.snapshotGenerator = new 
StatemachineSnapshotFileGenerator(Collections.singletonList(this.replicasInfoManager));
     }
 
+    @After
+    public void shutdown() {
+        UtilAll.deleteFile(new File(this.snapshotPath));
+    }
+
     @Test
     public void testGenerateAndLoadEmptySnapshot() throws IOException {
         ReplicasInfoManager emptyManager = new ReplicasInfoManager(null);

Reply via email to