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


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/PartitionsReservationIntegrationTest.java:
##########
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.calcite.integration;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.cluster.ClusterTopologyException;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.processors.query.IgniteSQLException;
+import org.apache.ignite.internal.processors.query.QueryUtils;
+import org.apache.ignite.internal.processors.query.calcite.QueryChecker;
+import org.apache.ignite.internal.processors.query.calcite.exec.IndexScan;
+import org.apache.ignite.internal.processors.query.calcite.exec.TableScan;
+import 
org.apache.ignite.internal.processors.query.calcite.rel.IgniteIndexCount;
+import org.apache.ignite.internal.util.typedef.X;
+import org.junit.Test;
+
+/**
+ * Tests partition reservation/releasing for queries over unstable topology.
+ */
+public class PartitionsReservationIntegrationTest extends 
AbstractBasicIntegrationTest {
+    /** */
+    private static final int PARTS = 16;
+
+    /** */
+    private static final int KEYS = PARTS * 100_000;
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        // No-op. Don't start any grids.
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        startGrids(2);
+        client = startClientGrid();
+
+        awaitPartitionMapExchange();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        cfg.setCacheConfiguration(new CacheConfiguration<Integer, 
Integer>(DEFAULT_CACHE_NAME)
+            .setIndexedTypes(Integer.class, Employer.class)
+            .setSqlSchema(QueryUtils.DFLT_SCHEMA)
+            .setAffinity(new RendezvousAffinityFunction(false, PARTS)));
+
+        return cfg;
+    }
+
+    /** */
+    @Test
+    public void testIndexCount() throws Exception {
+        checkPartitionsReservationRelease(

Review Comment:
   If you run it several times it fails with a high failure rate:
   ```
   java.lang.AssertionError: Collections are not equal (position 0):
   Expected: [[1600000]]
   Actual:   [[1599889]]
   
        at org.junit.Assert.fail(Assert.java:88)
        at 
org.apache.ignite.internal.processors.query.calcite.QueryChecker.assertEqualsCollections(QueryChecker.java:479)
        at 
org.apache.ignite.internal.processors.query.calcite.QueryChecker.check(QueryChecker.java:454)
        at 
org.apache.ignite.internal.processors.query.calcite.integration.PartitionsReservationIntegrationTest$1.run(PartitionsReservationIntegrationTest.java:118)
   ```



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to