Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 20, 2020
2 parents b76f386 + e89391b commit 784a4af
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
Expand Up @@ -337,6 +337,10 @@ public void test021AddAssignmentModifyAccountAssignment() throws Exception {
assertNoMinusAttributeValues(plusAccountConstruction,
getDummyResourceController().getAttributeQName(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME));

assertTrue("Old legal variable for projection context is not true", accContext.isLegalOld());
assertTrue("Legal variable for projection context is not true", accContext.isLegal());
assertTrue("Old assigned variable for projection context is not true", accContext.isAssignedOld());
assertTrue("Assigned variable for projection context is not true", accContext.isAssigned());
}

@Test
Expand Down
Expand Up @@ -50,6 +50,13 @@ public class ConcurrencyTest extends BaseSQLRepoTest {

private static final long WAIT_FOR_THREAD_NATURAL_STOP_TIME = 300000;

@Override
public void initSystem() throws Exception {
Session session = getFactory().openSession();
session.doWork(connection -> System.out.println(">>>> Connection.TRANSACTION_* (transaction isolation level): " + connection.getTransactionIsolation()));
session.close();
}

@Test
public void test001TwoWriters_OneAttributeEach__NoReader() throws Exception {
PropertyModifierThread[] mts = new PropertyModifierThread[] {
Expand Down Expand Up @@ -128,11 +135,6 @@ private interface Checker {
}

private void concurrencyUniversal(String name, long duration, long waitStep, PropertyModifierThread[] modifierThreads, Checker checker) throws Exception {

Session session = getFactory().openSession();
session.doWork(connection -> System.out.println(">>>>" + connection.getTransactionIsolation()));
session.close();

final File file = new File("src/test/resources/concurrency/user.xml");
PrismObject<UserType> user = prismContext.parseObject(file);
user.asObjectable().setName(new PolyStringType(name));
Expand Down Expand Up @@ -508,10 +510,6 @@ public void test100AddOperationExecution() throws Exception {
int THREADS = 8;
long DURATION = 30000L;

Session session = getFactory().openSession();
session.doWork(connection -> System.out.println(">>>>" + connection.getTransactionIsolation()));
session.close();

UserType user = new UserType(prismContext).name("jack");

OperationResult result = new OperationResult("test100AddOperationExecution");
Expand Down Expand Up @@ -603,7 +601,7 @@ public void test110AddAssignments() throws Exception {
public void test120AddApproverRef() throws Exception {

int THREADS = 4;
long DURATION = 30000L;
long DURATION = 30_000L;
final String DELEGATED_REF_FORMAT = "oid-%d-%s";

RoleType role = new RoleType(prismContext).name("judge");
Expand Down
8 changes: 8 additions & 0 deletions repo/repo-sql-impl-test/testng-db-specific.xml
Expand Up @@ -14,4 +14,12 @@
<class name="com.evolveum.midpoint.repo.sql.closure.OrgClosurePerformanceTest2"/>
</classes>
</test>
<test name="Concurrency Tests" parallel="false" preserve-order="true" verbose="10" enabled="true">
<classes>
<class name="com.evolveum.midpoint.repo.sql.ConcurrencyTest"/>
<class name="com.evolveum.midpoint.repo.sql.SequenceTest"/>
<class name="com.evolveum.midpoint.repo.sql.closure.OrgClosureConcurrencyTest"/>
<class name="com.evolveum.midpoint.repo.sql.ExtDictionaryTest"/>
</classes>
</test>
</suite>
8 changes: 0 additions & 8 deletions repo/repo-sql-impl-test/testng-integration.xml
Expand Up @@ -50,14 +50,6 @@
<class name="com.evolveum.midpoint.repo.sql.OrgPhotoTest"/>
</classes>
</test>
<test name="Concurrency Tests" parallel="false" preserve-order="true" verbose="10" enabled="false"> <!-- enabled only for dbtest -->
<classes>
<class name="com.evolveum.midpoint.repo.sql.ConcurrencyTest"/>
<class name="com.evolveum.midpoint.repo.sql.SequenceTest"/>
<class name="com.evolveum.midpoint.repo.sql.closure.OrgClosureConcurrencyTest"/>
<class name="com.evolveum.midpoint.repo.sql.ExtDictionaryTest"/>
</classes>
</test>
<test name="Utils Tests" parallel="false" preserve-order="true" verbose="10" enabled="true">
<classes>
<class name="com.evolveum.midpoint.repo.sql.RAnyConverterStaticTest"/>
Expand Down
Expand Up @@ -43,6 +43,12 @@ public class ExtItemDictionary {
private Map<Integer, RExtItem> itemsById;
private Map<RExtItem.Key, RExtItem> itemsByKey;

@PostConstruct
public synchronized void initialize() {
itemsByKey = null;
itemsById = null;
}

private boolean fetchItemsIfNeeded() {
if (itemsByKey != null) {
return false;
Expand Down Expand Up @@ -127,12 +133,6 @@ private RExtItem createOrFindItemByDefinitionInternal(
return item;
}

@PostConstruct
public synchronized void initialize() {
itemsByKey = null;
itemsById = null;
}

private void addExtItemAttempt(RExtItem item) {
Session session = null;
try {
Expand Down

0 comments on commit 784a4af

Please sign in to comment.