obelix74 commented on code in PR #3385:
URL: https://github.com/apache/polaris/pull/3385#discussion_r2820071507


##########
runtime/service/src/test/java/org/apache/polaris/service/events/listeners/inmemory/InMemoryBufferEventListenerIntegrationTest.java:
##########
@@ -117,10 +119,32 @@ public void setup(
     baseLocation = 
IntegrationTestsHelper.getTemporaryDirectory(tempDir).resolve(realm + "/");
   }
 
+  /**
+   * Reset the database state before each test to ensure test isolation. The 
H2 in-memory database
+   * with DB_CLOSE_DELAY=-1 persists state across tests, so we need to clean 
up catalog-related
+   * entities while preserving the realm and principal entities set up in 
@BeforeAll.
+   */
+  @BeforeEach
+  public void resetDatabaseState() {

Review Comment:
   No, this isn't specifically for metrics persistence. This was added to fix a 
pre-existing test isolation issue that surfaced while running tests.
   
   The H2 in-memory database (with DB_CLOSE_DELAY=-1) persists state across 
tests within the same JVM. The resetDatabaseState() method cleans up the EVENTS 
table before each test, and the ALLOW_OVERLAPPING_CATALOG_URLS feature flag was 
added to avoid catalog base location conflicts.
   
   I can move this change to a separate PR if you prefer to keep the metrics PR 
focused. Would you like me to do that?



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