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
This commit is contained in:
Carlos Ruiz 2023-05-17 02:23:09 +02:00 committed by GitHub
parent d734cafd9b
commit d2426c5ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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);