sanpwc commented on code in PR #2122:
URL: https://github.com/apache/ignite-3/pull/2122#discussion_r1211172010
##########
modules/distribution-zones/src/testFixtures/java/org/apache/ignite/internal/distributionzones/DistributionZonesTestUtil.java:
##########
@@ -443,4 +443,34 @@ public static <T> void assertValueInStorage(
assertThat(storageValue == null ? null :
valueTransformer.apply(storageValue), is(expectedValue));
}
}
+
+ /**
+ * Asserts data nodes from the distribution zone manager.
+ *
+ * @param distributionZoneManager Distribution zone manager.
+ * @param zoneId Zone id.
+ * @param expectedValue Expected value.
+ * @param timeoutMillis Timeout in milliseconds.
+ * @throws InterruptedException If interrupted.
+ */
+ public static void assertDataNodesFromManager(
+ DistributionZoneManager distributionZoneManager,
+ int zoneId,
+ @Nullable Set<String> expectedValue,
+ long timeoutMillis
+ ) throws InterruptedException {
+ boolean success = waitForCondition(() -> {
+ // TODO: https://issues.apache.org/jira/browse/IGNITE-19506 change
this to the causality versioned call to dataNodes.
+ Set<String> dataNodes = distributionZoneManager.dataNodes(zoneId);
+
+ return Objects.equals(dataNodes, expectedValue);
+ }, timeoutMillis);
+
+ // We do a second check simply to print a nice error message in case
the condition above is not achieved.
Review Comment:
Nice))
--
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]