anton-vinogradov commented on a change in pull request #8822:
URL: https://github.com/apache/ignite/pull/8822#discussion_r594249554
##########
File path:
modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
##########
@@ -2419,6 +2422,35 @@ protected void assertCountersSame(int partId, boolean
withReserveCntr) throws As
}
}
+ /**
+ * @param partId Partition.
+ * @param withReserveCntr {@code True} to compare reserve counters.
Because reserve counters are synced during
+ * @param cacheName Cache name.
+ * @param cnt Counter.
+ * @param reserved Reserved counter.
+ * PME invoking with {@code true} makes sense only after PME was finished.
+ */
+ protected void assertCountersAsExpected(int partId, boolean
withReserveCntr, String cacheName, long cnt,
+ long reserved) throws AssertionFailedError {
+ List<T3<String, @Nullable PartitionUpdateCounter, Boolean>> cntrMap =
G.allGrids().stream().filter(ignite ->
+ !ignite.configuration().isClientMode()).map(ignite ->
+ new T3<>(ignite.name(), counter(partId, cacheName, ignite.name()),
+
ignite.affinity(cacheName).isPrimary(ignite.cluster().localNode(),
partId))).collect(toList());
+
+ for (T3<String, PartitionUpdateCounter, Boolean> cntr : cntrMap) {
+ if (cntr.get2() == null)
+ continue;
+
+ assertEquals("Expecting same counters [partId=" + partId +
+ ", cntrs=" + cntrMap + ']', cnt, cntr.get2().get());
+
+ if (withReserveCntr)
Review comment:
Fixed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]