Skip to content

Commit

Permalink
IGNITE-22860 Added a separate test for the conflict resolver metrics (#…
Browse files Browse the repository at this point in the history
…281)

* IGNITE-22860 Added a separate test for the conflict resolver metrics

* IGNITE-22860 Added a separate test for the conflict resolver metrics
  • Loading branch information
NSAmelchev authored Jul 30, 2024
1 parent c3813f7 commit c1aae7f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ public void testUpdatesReorderFromOtherCluster() throws Exception {
// 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;
Expand All @@ -212,16 +210,12 @@ public void testUpdatesReorderFromOtherCluster() throws Exception {
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. */
Expand Down Expand Up @@ -260,6 +254,22 @@ public void testUpdatesConflict() throws Exception {
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
}

/**
*
*/
Expand Down

0 comments on commit c1aae7f

Please sign in to comment.