Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-12302 Test ZookeeperDiscoveryTopologyChangeAndReconnectTest.testDuplicatedNodeId is broken. #6986

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -31,7 +31,6 @@
import java.util.stream.Collectors;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.configuration.CacheConfiguration;
Expand All @@ -45,15 +44,18 @@
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.WithSystemProperty;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZKUtil;
import org.apache.zookeeper.ZkTestClientCnxnSocketNIO;
import org.apache.zookeeper.ZooKeeper;
import org.junit.Ignore;
import org.junit.Test;

import static org.apache.ignite.IgniteSystemProperties.IGNITE_SQL_DISABLE_SYSTEM_VIEWS;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED;
import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED;
Expand Down Expand Up @@ -562,32 +564,23 @@ public void testForcibleClientFail() throws Exception {
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_SQL_DISABLE_SYSTEM_VIEWS, value = "true")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IgniteH2Indexing connects to H2 instance by URL based on nodeId, so there can be more errors in indexing here in the future even if system views are disabled.
Perhaps it's better to disable indexing at all for this test (something like GridQueryProcessor.idxCls = DummyQueryIndexing.class; before each grid start).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-plekhanov, thanks for the suggestion. I have fixed the test. Could you take a look? TC test suite looks fine.

public void testDuplicatedNodeId() throws Exception {
UUID nodeId0 = nodeId = UUID.randomUUID();

startGrid(0);

int failingNodeIdx = 100;

for (int i = 0; i < 5; i++) {
for (int i = 0; i < 2; i++) {
final int idx = failingNodeIdx++;

nodeId = nodeId0;

info("Start node with duplicated ID [iter=" + i + ", nodeId=" + nodeId + ']');

Throwable err = GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
startGrid(idx);

return null;
}
}, IgniteCheckedException.class, null);

assertTrue(err instanceof IgniteCheckedException);

assertTrue(err.getMessage().contains("Failed to start processor:")
|| err.getMessage().contains("Failed to start manager:"));
GridTestUtils.assertThrowsAnyCause(log,
() -> startGrid(idx), IgniteSpiException.class, "Node with the same ID already exists");

nodeId = null;

Expand Down