rpuch commented on code in PR #5509:
URL: https://github.com/apache/ignite-3/pull/5509#discussion_r2016543973


##########
modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexRegistrationAndRebalanceConcurrencyTest.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * 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.index;
+
+import static 
org.apache.ignite.internal.catalog.CatalogService.DEFAULT_STORAGE_PROFILE;
+import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
+
+import java.time.Duration;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.internal.ClusterPerTestIntegrationTest;
+import org.junit.jupiter.api.Test;
+
+class ItIndexRegistrationAndRebalanceConcurrencyTest extends 
ClusterPerTestIntegrationTest {
+    private static final String TEST_ZONE_NAME = "test_zone";
+    private static final String TEST_TABLE_NAME = "test_table";
+
+    /**
+     * This makes sure that partitions coming in/going out during index 
registration do not break anything.
+     */
+    @Test
+    void indexRegistrationAndRebalanceConcurrency() {
+        Ignite ignite = node(0);
+
+        ignite.sql().executeScript(
+                "CREATE ZONE " + TEST_ZONE_NAME + " WITH replicas=3, 
storage_profiles='" + DEFAULT_STORAGE_PROFILE + "';"
+                        + "CREATE TABLE " + TEST_TABLE_NAME + " (key INT 
PRIMARY KEY, val VARCHAR(20)) ZONE test_zone"
+        );
+
+        waitForStoragesToBeCreated(ignite);
+
+        initiateRebalanceOnTestZone(ignite);
+
+        assertTimeoutPreemptively(

Review Comment:
   It doesn't have to timeout, it has to NOT timeout :) Index creation hangs 
(forever) if something goes wrong; putting an explicit timeout on it allows to 
see the failure sooner



-- 
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