This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 98bfcc770f [test] Add tests for expire snapshots in testSnapshotMethods
98bfcc770f is described below
commit 98bfcc770f92c6d6d6d2b4f5293169ebe57b73e0
Author: JingsongLi <[email protected]>
AuthorDate: Tue May 27 12:44:27 2025 +0800
[test] Add tests for expire snapshots in testSnapshotMethods
---
.../org/apache/paimon/rest/RESTCatalogTest.java | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git
a/paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogTest.java
b/paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogTest.java
index 7e6d8d9401..9953264233 100644
--- a/paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogTest.java
@@ -54,6 +54,7 @@ import org.apache.paimon.table.source.Split;
import org.apache.paimon.table.source.TableRead;
import org.apache.paimon.types.DataField;
import org.apache.paimon.types.DataTypes;
+import org.apache.paimon.utils.SnapshotManager;
import org.apache.paimon.view.View;
import org.apache.paimon.view.ViewChange;
@@ -1764,6 +1765,28 @@ public abstract class RESTCatalogTest extends
CatalogTestBase {
table.snapshot(12),
table.snapshot(13),
table.snapshot(14));
+
+ // expire snapshots
+ SnapshotManager snapshotManager = ((FileStoreTable)
table).snapshotManager();
+ snapshotManager.deleteSnapshot(1);
+ snapshotManager.deleteSnapshot(2);
+ snapshots =
+ PagedList.listAllFromPagedApi(
+ token -> api.listSnapshotsPaged(identifier, null,
token));
+ assertThat(snapshots)
+ .containsExactlyInAnyOrder(
+ table.snapshot(3),
+ table.snapshot(4),
+ table.snapshot(5),
+ table.snapshot(6),
+ table.snapshot(7),
+ table.snapshot(8),
+ table.snapshot(9),
+ table.snapshot(10),
+ table.snapshot(11),
+ table.snapshot(12),
+ table.snapshot(13),
+ table.snapshot(14));
}
private TestPagedResponse generateTestPagedResponse(