alex-plekhanov commented on code in PR #13227:
URL: https://github.com/apache/ignite/pull/13227#discussion_r3388786329


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheTryLockMultithreadedTest.java:
##########
@@ -17,27 +17,54 @@
 
 package org.apache.ignite.internal.processors.cache.distributed;
 
+import java.util.Collection;
+import java.util.List;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 
 /**
  *
  */
+@RunWith(Parameterized.class)
 public class CacheTryLockMultithreadedTest extends GridCommonAbstractTest {
     /** */
-    private static final int SRVS = 2;
+    private static final int SRVS = 3;
+
+    /** */
+    @Parameterized.Parameter
+    public CacheMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backups;
+
+    /** */
+    @Parameterized.Parameters(name = "cacheMode={0}, backups={1}")
+    public static Collection<?> parameters() {
+        return GridTestUtils.cartesianProduct(F.asList(REPLICATED, 
PARTITIONED), F.asList(0, 1));

Review Comment:
   For REPLICATED cache backups count 0 and 1 test the same functionality, but 
it adds 30 seconds for existing test and 10 seconds for the new test, lets use 
three set of parameters here (REPLICATED, 0), (PARTITIONED, 0) and 
(PARTITIONED, 1) 
   Also, maybe reduce test time for testTryLock (for example to 15 seconds) to 
save teamcity time? We now incremented tests count, so total test time for 3 
cases will be 45 seconds, it's still more than current 30 seconds and 
probability of detection of concurrent problem will be increased.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java:
##########
@@ -553,6 +553,17 @@ void onResult(UUID nodeId, GridDhtLockResponse res) {
                 return;
             }
 
+            if (isDone() || timedOut) {

Review Comment:
   This condition is under another `if (!isDone())` condition, so logic 
`!isDone() && isDone()` looks weird 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to