Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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