Skip to content

Commit

Permalink
IGNITE-23138 add devs advise
Browse files Browse the repository at this point in the history
  • Loading branch information
superminkfan committed Sep 26, 2024
1 parent 7c7d345 commit 1f8dbfc
Showing 1 changed file with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public class TxWithKeyContentionSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testPessimisticRepeatableReadCheckContentionTxMetric() throws Exception {
runKeyCollisionsMetric(PESSIMISTIC, REPEATABLE_READ);
}
Expand All @@ -145,7 +145,7 @@ public void testPessimisticRepeatableReadCheckContentionTxMetric() throws Except
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testPessimisticRepeatableReadCheckContentionTxMetricNear() throws Exception {
nearCache = true;

Expand All @@ -156,7 +156,7 @@ public void testPessimisticRepeatableReadCheckContentionTxMetricNear() throws Ex
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testPessimisticReadCommitedCheckContentionTxMetric() throws Exception {
runKeyCollisionsMetric(PESSIMISTIC, READ_COMMITTED);
}
Expand All @@ -165,7 +165,7 @@ public void testPessimisticReadCommitedCheckContentionTxMetric() throws Exceptio
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testPessimisticReadCommitedCheckContentionTxMetricNear() throws Exception {
nearCache = true;

Expand All @@ -176,7 +176,7 @@ public void testPessimisticReadCommitedCheckContentionTxMetricNear() throws Exce
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testOptimisticReadCommittedCheckContentionTxMetric() throws Exception {
runKeyCollisionsMetric(OPTIMISTIC, READ_COMMITTED);
}
Expand All @@ -185,7 +185,7 @@ public void testOptimisticReadCommittedCheckContentionTxMetric() throws Exceptio
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testOptimisticReadCommittedCheckContentionTxMetricNear() throws Exception {
nearCache = true;

Expand All @@ -196,7 +196,7 @@ public void testOptimisticReadCommittedCheckContentionTxMetricNear() throws Exce
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testOptimisticRepeatableReadCheckContentionTxMetric() throws Exception {
runKeyCollisionsMetric(OPTIMISTIC, REPEATABLE_READ);
}
Expand All @@ -205,7 +205,7 @@ public void testOptimisticRepeatableReadCheckContentionTxMetric() throws Excepti
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "40000")
@WithSystemProperty(key = IGNITE_DUMP_TX_COLLISIONS_INTERVAL, value = "30000")
public void testOptimisticRepeatableReadCheckContentionTxMetricNear() throws Exception {
nearCache = true;

Expand All @@ -221,7 +221,7 @@ public void testOptimisticRepeatableReadCheckContentionTxMetricNear() throws Exc
private void runKeyCollisionsMetric(TransactionConcurrency concurrency, TransactionIsolation isolation) throws Exception {
Ignite ig = startGridsMultiThreaded(2);

int contCnt = (int)U.staticField(IgniteTxManager.class, "COLLISIONS_QUEUE_THRESHOLD") * 5;
int contCnt = (int)U.staticField(IgniteTxManager.class, "COLLISIONS_QUEUE_THRESHOLD") * 20;

CountDownLatch txLatch = new CountDownLatch(contCnt);

Expand Down Expand Up @@ -304,17 +304,15 @@ private void runKeyCollisionsMetric(TransactionConcurrency concurrency, Transact

IgniteTxManager srvTxMgr = ((IgniteEx)ig).context().cache().context().tm();

try {
U.invoke(IgniteTxManager.class, srvTxMgr, "collectTxCollisionsInfo");
}
catch (IgniteCheckedException e) {
fail(e.toString());
}

assertTrue(GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
try {
U.invoke(IgniteTxManager.class, srvTxMgr, "collectTxCollisionsInfo");

U.sleep(1000);
}
catch (IgniteCheckedException e) {
fail(e.toString());
}

CacheMetrics metrics = cache.localMetrics();

String coll1 = metrics.getTxKeyCollisions();
Expand All @@ -334,7 +332,7 @@ private void runKeyCollisionsMetric(TransactionConcurrency concurrency, Transact
else
return false;
}
}, 30_000));
}, 20_000));

f.get();

Expand Down

0 comments on commit 1f8dbfc

Please sign in to comment.