This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new e9ace5950 ATLAS-5204: fix flaky test
InMemoryAuditRepositoryTest.testDeleteEventsV2() (#515)
e9ace5950 is described below
commit e9ace5950f752dcf7c8ba9556e8468a3be73af63
Author: Madhan Neethiraj <[email protected]>
AuthorDate: Thu Feb 12 18:36:06 2026 -0800
ATLAS-5204: fix flaky test InMemoryAuditRepositoryTest.testDeleteEventsV2()
(#515)
---
.../org/apache/atlas/repository/audit/AuditRepositoryTestBase.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java
b/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java
index 332e05b85..82f5862cc 100644
---
a/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java
+++
b/repository/src/test/java/org/apache/atlas/repository/audit/AuditRepositoryTestBase.java
@@ -188,7 +188,9 @@ public class AuditRepositoryTestBase {
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
+ long ts = now - (ttlInDays * DateUtils.MILLIS_PER_DAY) -
bufferMs;
AtlasEntity entity = new AtlasEntity(rand());
int j = 0;
@@ -231,7 +233,7 @@ public class AuditRepositoryTestBase {
assertNotEquals(remainingEvents.get(3), events.get(0));
assertFalse(remainingEvents.contains(events.get(0)));
- EntityAuditEventV2 latestEvent = new EntityAuditEventV2(id1,
System.currentTimeMillis(), "User-b",
EntityAuditEventV2.EntityAuditActionV2.ENTITY_DELETE, "details" + j++, entity);
+ EntityAuditEventV2 latestEvent = new EntityAuditEventV2(id1, now,
"User-b", EntityAuditEventV2.EntityAuditActionV2.ENTITY_DELETE, "details" +
j++, entity);
eventRepository.putEventsV2(latestEvent);
List<EntityAuditEventV2> allEvents = eventRepository.listEventsV2(id1,
null, "timestamp", false, 0, (short) -1);