This is an automated email from the ASF dual-hosted git repository. namelchev pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git
The following commit(s) were added to refs/heads/master by this push: new c1aae7f1 IGNITE-22860 Added a separate test for the conflict resolver metrics (#281) c1aae7f1 is described below commit c1aae7f1756859eb091b6ef449f072361a9fbe2d Author: Nikita Amelchev <nsamelc...@gmail.com> AuthorDate: Tue Jul 30 13:24:34 2024 +0300 IGNITE-22860 Added a separate test for the conflict resolver metrics (#281) * IGNITE-22860 Added a separate test for the conflict resolver metrics * IGNITE-22860 Added a separate test for the conflict resolver metrics --- .../ignite/cdc/CacheConflictOperationsTest.java | 22 ++++++++++++++++------ ...heConflictOperationsWithCustomResolverTest.java | 7 +++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsTest.java b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsTest.java index 7131f49a..7315c030 100644 --- a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsTest.java +++ b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsTest.java @@ -200,8 +200,6 @@ public class CacheConflictOperationsTest extends GridCommonAbstractTest { // Remove with the higher topVer should succeed. putConflict(key, new GridCacheVersion(3, order, 1, otherClusterId), true); - checkMetrics(4, 8); - key = key("UpdateClusterUpdateReorder3", otherClusterId); int topVer = 1; @@ -212,16 +210,12 @@ public class CacheConflictOperationsTest extends GridCommonAbstractTest { putConflict(key, new GridCacheVersion(topVer, order, 2, otherClusterId), false); putConflict(key, new GridCacheVersion(topVer, order, 1, otherClusterId), false); - checkMetrics(5, 10); - // Remove with the equal or lower nodeOrder should ignored. removeConflict(key, new GridCacheVersion(topVer, order, 2, otherClusterId), false); removeConflict(key, new GridCacheVersion(topVer, order, 1, otherClusterId), false); // Remove with the higher nodeOrder should succeed. putConflict(key, new GridCacheVersion(topVer, order, 3, otherClusterId), true); - - checkMetrics(6, 12); } /** Tests cache operations for entry replicated from another cluster. */ @@ -260,6 +254,22 @@ public class CacheConflictOperationsTest extends GridCommonAbstractTest { putConflict(key, 5, conflictResolveField() != null); } + /** */ + @Test + public void testMetrics() throws Exception { + String key = key("UpdateClusterUpdateReorder", otherClusterId); + + checkMetrics(0, 0); + + putConflict(key, 1, true); + + checkMetrics(1, 0); + + putConflict(key, 1, false); + + checkMetrics(1, 1); + } + /** */ private void put(String key) { ConflictResolvableTestData newVal = ConflictResolvableTestData.create(); diff --git a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsWithCustomResolverTest.java b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsWithCustomResolverTest.java index 621aaf60..ca5a3fe8 100644 --- a/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsWithCustomResolverTest.java +++ b/modules/cdc-ext/src/test/java/org/apache/ignite/cdc/CacheConflictOperationsWithCustomResolverTest.java @@ -51,6 +51,13 @@ public class CacheConflictOperationsWithCustomResolverTest extends CacheConflict GridTestUtils.assertThrows(log, super::testUpdatesConflict, AssertionError.class, ""); } + /** {@inheritDoc} */ + @Test + @Override public void testMetrics() throws Exception { + // LWW strategy resolves conflicts in unexpected way at versioned resolve test. + GridTestUtils.assertThrows(log, super::testMetrics, AssertionError.class, ""); + } + /** * */