rdblue commented on a change in pull request #1509:
URL: https://github.com/apache/iceberg/pull/1509#discussion_r496262230



##########
File path: 
flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkScan.java
##########
@@ -230,13 +246,16 @@ public void testSnapshotReads() throws Exception {
     long timestampMillis = table.currentSnapshot().timestampMillis();
 
     // produce another timestamp
-    Thread.sleep(10);
+    waitUntilAfter(System.currentTimeMillis() + 10);

Review comment:
       Why is this waiting until 10ms from now? That's basically equivalent to 
`Thread.sleep`. The purpose of using `waitUntilAfter` is to ensure the next 
call to `System.currentTimeMillis()` will be after some point in time. In most 
cases, that's the last snapshot's timestamp.
   
   I think this should be 
`waitUntilAfter(table.currentSnapshot().timestampMillis());`. Then the next 
append will be strictly after that snapshot's timestamp, and the query with 
`as-of-timestamp` will read the older snapshot. There should be no need to wait 
as long as 10ms.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to