Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,6 @@ tests:
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2UnavailableRemotesIT
method: testEsqlRcs2UnavailableRemoteScenarios
issue: https://github.com/elastic/elasticsearch/issues/136493
- class: org.elasticsearch.xpack.core.HealthApiFeatureSetUsageTests
method: testEqualsAndHashcode
issue: https://github.com/elastic/elasticsearch/issues/136648
- class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT
method: testILMDownsampleRollingRestart
issue: https://github.com/elastic/elasticsearch/issues/136585
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public abstract class AbstractWireTestCase<T> extends ESTestCase {
* Tests that the equals and hashcode methods are consistent and copied
* versions of the instance are equal.
*/
public final void testEqualsAndHashcode() {
public void testEqualsAndHashcode() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the removal of final here intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, leftover from reproduction, will revert this part.

for (int runs = 0; runs < NUMBER_OF_TEST_RUNS; runs++) {
T testInstance = createTestInstance();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;



public class HealthApiFeatureSetUsageTests extends AbstractWireSerializingTestCase<HealthApiFeatureSetUsage> {

@Override
Expand All @@ -37,9 +39,9 @@ protected HealthApiFeatureSetUsage createTestInstance() {
@Override
protected HealthApiFeatureSetUsage mutateInstance(HealthApiFeatureSetUsage instance) {
Map<String, Object> originalStats = instance.stats();
Counters newStats = randomCounters();
Counters newStats = randomCounters(false);
while (originalStats.equals(newStats.toMutableNestedMap())) {
newStats = randomCounters();
newStats = randomCounters(false);
}
return new HealthApiFeatureSetUsage(true, true, newStats);
}
Expand All @@ -50,7 +52,11 @@ protected Writeable.Reader<HealthApiFeatureSetUsage> instanceReader() {
}

private Counters randomCounters() {
if (rarely()) {
return randomCounters(true);
}

private Counters randomCounters(boolean allowNull) {
if (allowNull && rarely()) {
return null;
}
Counters counters = new Counters();
Expand Down