You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ma...@apache.org on 2023/12/12 04:08:59 UTC

(iotdb) 01/01: in case of compaction in UT

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

marklau99 pushed a commit to branch fix-snapshot-ut
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 580c995d9b7b8edba3afdf38c32c3bd163aa9a48
Author: Liu Xuxin <li...@outlook.com>
AuthorDate: Tue Dec 12 12:07:08 2023 +0800

    in case of compaction in UT
---
 .../iotdb/db/storageengine/dataregion/snapshot/IoTDBSnapshotTest.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/IoTDBSnapshotTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/IoTDBSnapshotTest.java
index e91119340d7..170ac3f7267 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/IoTDBSnapshotTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/IoTDBSnapshotTest.java
@@ -79,6 +79,7 @@ public class IoTDBSnapshotTest {
               + String.format("%d-%d-0-0.tsfile", i + 1, i + 1);
       TsFileGeneratorUtils.generateMixTsFile(filePath, 5, 5, 10, i * 100, (i + 1) * 100, 10, 10);
       TsFileResource resource = new TsFileResource(new File(filePath));
+      Assert.assertTrue(new File(filePath).exists());
       resources.add(resource);
       for (int idx = 0; idx < 5; idx++) {
         resource.updateStartTime(testSgName + PATH_SEPARATOR + "d" + i, i * 100);
@@ -135,6 +136,7 @@ public class IoTDBSnapshotTest {
       List<TsFileResource> resources = writeTsFiles();
       resources.subList(50, 100).forEach(x -> x.setStatusForTest(TsFileResourceStatus.UNCLOSED));
       DataRegion region = new DataRegion(testSgName, "0");
+      region.setAllowCompaction(false);
       region.getTsFileManager().addAll(resources, true);
       File snapshotDir = new File("target" + File.separator + "snapshot");
       Assert.assertTrue(snapshotDir.exists() || snapshotDir.mkdirs());