sanpwc commented on code in PR #6641:
URL: https://github.com/apache/ignite-3/pull/6641#discussion_r2388245148


##########
modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItEmptyDataNodesTest.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.distributionzones;
+
+import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
+import static org.apache.ignite.internal.lang.IgniteStringFormatter.format;
+import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.hasCause;
+import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Predicate;
+import org.apache.ignite.internal.ClusterPerTestIntegrationTest;
+import org.apache.ignite.internal.TestWrappers;
+import org.apache.ignite.internal.app.IgniteImpl;
+import 
org.apache.ignite.internal.distributionzones.exception.EmptyDataNodesException;
+import org.apache.ignite.internal.placementdriver.EmptyAssignmentsException;
+import org.apache.ignite.sql.SqlException;
+import org.jetbrains.annotations.Nullable;
+import org.junit.jupiter.api.Test;
+
+class ItEmptyDataNodesTest extends ClusterPerTestIntegrationTest {
+    private static final String ZONE_NAME = "zone0";
+    private static final String TABLE_NAME = "table0";
+
+    @Test
+    public void testInitialEmptyAssignmentsWithSuccessfulWaiting() {
+        createZoneAndTableWithEmptyDataNodes();
+
+        IgniteImpl node = unwrapIgniteImpl(cluster.aliveNode());
+        int zoneId = 
node.catalogManager().activeCatalog(node.clock().now().longValue()).zone(ZONE_NAME.toUpperCase()).id();
+
+        assertTrue(currentDataNodes(node, zoneId).isEmpty());
+
+        setAdditionalNodeFilter(null);
+
+        // Trigger scale down and data nodes recalculation.
+        stopNode(2);
+
+        // No waiting inside test for non-empty data nodes and assignments. 
Assignments placement driver should wait for non-empty
+        // assignments for SQL.
+        sql("SELECT * FROM " + TABLE_NAME);

Review Comment:
   How it's guaranteed that at the moment of processing assignments were still 
empty and became empty after futures were registered?



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