From f6e99602f7976ae7f5878556e7dcd640f87d51c8 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 31 Oct 2026 10:42:55 -0700 Subject: [PATCH] Fix intermittent failure in ContainerManager testMissesNotCachedInTransaction Background search work queued when the test container is created can look up its EntityId after the delete and legitimately cache the miss, so the test now looks up an unused GUID. --- api/src/org/labkey/api/data/ContainerManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/org/labkey/api/data/ContainerManager.java b/api/src/org/labkey/api/data/ContainerManager.java index 66c2049c264..a2effc9bb59 100644 --- a/api/src/org/labkey/api/data/ContainerManager.java +++ b/api/src/org/labkey/api/data/ContainerManager.java @@ -3000,8 +3000,10 @@ public void testMissesNotCachedInTransaction() User user = TestContext.get().getUser(); Container c = createContainer(_testRoot, "missesInTx", user); int rowId = c.getRowId(); - GUID entityId = c.getEntityId(); assertTrue(delete(c, user)); + // Cache a miss using a GUID no one else knows about, not c.getEntityId(). Background search work queued at + // create (e.g., indexer) can look up the deleted container's EntityId and legitimately cache the miss. + GUID entityId = new GUID(); try (DbScope.Transaction tx = CORE.getSchema().getScope().ensureTransaction()) {