petrov-mg commented on code in PR #12488:
URL: https://github.com/apache/ignite/pull/12488#discussion_r2484883315
##########
modules/core/src/test/java/org/apache/ignite/internal/client/thin/ServiceAwarenessTest.java:
##########
@@ -612,6 +611,11 @@ private IgniteClient startClient(@Nullable
Collection<UUID> requestedServerNodes
getClientConfiguration(grid(0)));
}
+ /** */
+ private Set<UUID> nodeIds(int... nodeIdxs) {
Review Comment:
Done.
##########
modules/core/src/test/java/org/apache/ignite/internal/client/thin/ServiceAwarenessTest.java:
##########
@@ -90,11 +98,18 @@ public class ServiceAwarenessTest extends
AbstractThinClientTest {
/** */
private static ListeningTestLogger clientLogLsnr;
+ /** */
+ private final UUID[] nodeIds = new UUID[BASE_NODES_CNT +
TOP_UPD_NODES_CNT];
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+ int nodeIdx = getTestIgniteInstanceIndex(igniteInstanceName);
+
cfg.setDiscoverySpi(new TestBlockingDiscoverySpi());
+ cfg.setNodeId(nodeIds[nodeIdx]);
Review Comment:
Done.
##########
modules/core/src/test/java/org/apache/ignite/internal/client/thin/ServiceAwarenessTest.java:
##########
@@ -350,94 +368,75 @@ public void testForcedServiceRedeployWhileClientIsIdle()
throws Exception {
}
/** */
- private void doTestClusterTopChangesWhileServiceCalling(
- int nodesCnt,
- boolean addNodes,
- boolean multiThreaded)
- throws Exception {
- assert nodesCnt > 0;
-
- Set<UUID> newNodesUUIDs = new GridConcurrentHashSet<>();
+ private void doTestClusterTopChangesWhileServiceCalling(boolean shrinkTop,
int svcInvokeThreads) throws Exception {
+ Set<UUID> expInitSvcTop = shrinkTop ? nodeIds(1, 2, 4, 5, 6) :
nodeIds(1, 2);
+ Set<UUID> expUpdSvcTop = shrinkTop ? nodeIds(1, 2) : nodeIds(1, 2, 4,
5, 6);
// Start additional nodes to stop them.
- if (!addNodes) {
- startGridsMultiThreaded(GRIDS, nodesCnt);
-
- for (int i = GRIDS; i < GRIDS + nodesCnt; ++i)
- newNodesUUIDs.add(grid(i).localNode().id());
- }
+ if (shrinkTop)
+ startGridsMultiThreaded(BASE_NODES_CNT, TOP_UPD_NODES_CNT);
// Service topology on the clients.
- Set<UUID> srvcTopOnClient = new GridConcurrentHashSet<>();
+ AtomicReference<Set<UUID>> actualSvcTop = new AtomicReference<>();
- addSrvcTopUpdateClientLogLsnr(srvcTopOnClient::addAll);
+ registerServiceTopologyUpdateListener(actualSvcTop::set);
- AtomicBoolean changeClusterTop = new AtomicBoolean();
- AtomicBoolean stopFlag = new AtomicBoolean();
+ AtomicBoolean isTestStopped = new AtomicBoolean();
Review Comment:
Done.
##########
modules/core/src/test/java/org/apache/ignite/internal/client/thin/ServiceAwarenessTest.java:
##########
@@ -350,94 +368,75 @@ public void testForcedServiceRedeployWhileClientIsIdle()
throws Exception {
}
/** */
- private void doTestClusterTopChangesWhileServiceCalling(
- int nodesCnt,
- boolean addNodes,
- boolean multiThreaded)
- throws Exception {
- assert nodesCnt > 0;
-
- Set<UUID> newNodesUUIDs = new GridConcurrentHashSet<>();
+ private void doTestClusterTopChangesWhileServiceCalling(boolean shrinkTop,
int svcInvokeThreads) throws Exception {
+ Set<UUID> expInitSvcTop = shrinkTop ? nodeIds(1, 2, 4, 5, 6) :
nodeIds(1, 2);
+ Set<UUID> expUpdSvcTop = shrinkTop ? nodeIds(1, 2) : nodeIds(1, 2, 4,
5, 6);
// Start additional nodes to stop them.
- if (!addNodes) {
- startGridsMultiThreaded(GRIDS, nodesCnt);
-
- for (int i = GRIDS; i < GRIDS + nodesCnt; ++i)
- newNodesUUIDs.add(grid(i).localNode().id());
- }
+ if (shrinkTop)
+ startGridsMultiThreaded(BASE_NODES_CNT, TOP_UPD_NODES_CNT);
// Service topology on the clients.
- Set<UUID> srvcTopOnClient = new GridConcurrentHashSet<>();
+ AtomicReference<Set<UUID>> actualSvcTop = new AtomicReference<>();
Review Comment:
Done.
--
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]