You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/08/24 10:42:25 UTC

[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #389: Add test cases

aokolnychyi commented on a change in pull request #389: Add test cases
URL: https://github.com/apache/incubator-iceberg/pull/389#discussion_r317353512
 
 

 ##########
 File path: core/src/test/java/org/apache/iceberg/TestScanSummary.java
 ##########
 @@ -32,7 +33,47 @@
 import static org.apache.iceberg.expressions.Expressions.lessThan;
 import static org.apache.iceberg.expressions.Expressions.lessThanOrEqual;
 
-public class TestScanSummary {
+public class TestScanSummary extends TableTestBase {
+
+  @Test
+  public void testSnapshotTimeRangeValidation() {
+    long t0 = System.currentTimeMillis();
+
+    table.newAppend()
+        .appendFile(FILE_A) // data_bucket=0
+        .appendFile(FILE_B) // data_bucket=1
+        .commit();
+
+    long t1 = System.currentTimeMillis();
+
+    table.newAppend()
+        .appendFile(FILE_C) // data_bucket=2
+        .commit();
+
+    long secondSnapshotId = table.currentSnapshot().snapshotId();
+
+    long t2 = System.currentTimeMillis();
+
+    // expire the first snapshot
+    table.expireSnapshots()
+        .expireOlderThan(t1)
+        .commit();
+
+    Assert.assertEquals("Should have one snapshot",
+        1, Lists.newArrayList(table.snapshots()).size());
 
 Review comment:
   @xabriel @rdblue we also see failures from time to time in our internal builds

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org