From d2426c5ebd2e605dd6e18766cc7e3b32aac12b94 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 May 2023 02:23:09 +0200 Subject: [PATCH] IDEMPIERE-5683 ModelForeignKeyTest throwing error when parallel tests (#1836) * IDEMPIERE-5683 ModelForeignKeyTest throwing error when parallel tests * - Add Isolated annotation as suggested by Heng Sin --- .../src/org/idempiere/test/model/ModelForeignKeyTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.idempiere.test/src/org/idempiere/test/model/ModelForeignKeyTest.java b/org.idempiere.test/src/org/idempiere/test/model/ModelForeignKeyTest.java index 2429cef56e..c67d805d86 100644 --- a/org.idempiere.test/src/org/idempiere/test/model/ModelForeignKeyTest.java +++ b/org.idempiere.test/src/org/idempiere/test/model/ModelForeignKeyTest.java @@ -41,12 +41,14 @@ import org.compiere.util.Env; import org.compiere.util.Trx; import org.idempiere.test.AbstractTestCase; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Isolated; /** * * @author Carlos Ruiz - globalqss - bxservice * */ +@Isolated public class ModelForeignKeyTest extends AbstractTestCase { public ModelForeignKeyTest() { @@ -66,7 +68,6 @@ public class ModelForeignKeyTest extends AbstractTestCase { } finally { PO.clearCrossTenantSafe(); } - CacheMgt.get().reset(); MTest test1 = new MTest(ctx, 0, trxName); test1.setName("Test 1"); @@ -78,6 +79,7 @@ public class ModelForeignKeyTest extends AbstractTestCase { test1.setRecord_ID(test2.getTest_ID()); test1.saveEx(); + CacheMgt.get().reset(); test2.deleteEx(true); test1.load(trxName); assertTrue(test1.get_ID() == 0);