Copilot commented on code in PR #515:
URL: https://github.com/apache/atlas/pull/515#discussion_r2778369082


##########
repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java:
##########
@@ -188,7 +188,9 @@ public void testSortListV2() throws Exception {
     public void testDeleteEventsV2() throws Exception {
         String      id1       = "id1" + rand();
         int         ttlInDays = 1;
-        long        ts        = System.currentTimeMillis() - (ttlInDays * 
DateUtils.MILLIS_PER_DAY);
+        long        now       = System.currentTimeMillis();
+        long        bufferMs  = 5 * DateUtils.MILLIS_PER_MINUTE; // buffer to 
avoid failure in TTL based delete in env with faster/lightly-loaded env

Review Comment:
   The inline comment is a bit unclear/grammatically awkward (“in env with 
faster/lightly-loaded env”). Consider rephrasing to something like: “Buffer to 
avoid TTL cutoff edge cases due to time truncation/rounding or timing 
granularity across environments.”
   ```suggestion
           long        bufferMs  = 5 * DateUtils.MILLIS_PER_MINUTE; // buffer 
to avoid TTL cutoff edge cases due to time truncation/rounding or timing 
granularity across environments
   ```



##########
repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java:
##########
@@ -188,7 +188,9 @@ public void testSortListV2() throws Exception {
     public void testDeleteEventsV2() throws Exception {
         String      id1       = "id1" + rand();
         int         ttlInDays = 1;
-        long        ts        = System.currentTimeMillis() - (ttlInDays * 
DateUtils.MILLIS_PER_DAY);
+        long        now       = System.currentTimeMillis();
+        long        bufferMs  = 5 * DateUtils.MILLIS_PER_MINUTE; // buffer to 
avoid failure in TTL based delete in env with faster/lightly-loaded env

Review Comment:
   The `5 * DateUtils.MILLIS_PER_MINUTE` is a magic number in the test. 
Consider extracting it into a clearly named constant (e.g., 
`TTL_DELETE_BUFFER_MS`) and/or adding a brief reason that’s more specific 
(e.g., handling timestamp rounding/truncation or cutoff equality) so future 
readers know why “5 minutes” is required.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to