```
REPRODUCE WITH: ./gradlew ':server:test' --tests "org.elasticsearch.cluster.metadata.DataStreamTests.testConcurrentSerialization" -Dtests.seed=C961FFF1D24CB144 -Dtests.locale=sl-SI -Dtests.timezone=Europe/Nicosia -Druntime.java=17

org.elasticsearch.cluster.metadata.DataStreamTests > testConcurrentSerialization FAILED	
    java.lang.AssertionError: 	
    Expected: an empty collection	
         but: <[LEAK: resource was not cleaned up before it was garbage-collected.	
    Recent access records: 	
    Created at:	
    	org.elasticsearch.common.util.MockPageCacheRecycler.wrap(MockPageCacheRecycler.java:32)	
    	org.elasticsearch.common.util.MockPageCacheRecycler.bytePage(MockPageCacheRecycler.java:72)	
    	org.elasticsearch.transport.BytesRefRecycler.obtain(BytesRefRecycler.java:27)	
    	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$ClearableRecycler.obtain(AbstractCoordinatorTestCase.java:1927)	
    	org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput.ensureCapacityFromPosition(RecyclerBytesStreamOutput.java:234)	
    	org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput.ensureCapacity(RecyclerBytesStreamOutput.java:223)	
    	org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput.writeBytes(RecyclerBytesStreamOutput.java:77)	
    	org.elasticsearch.common.io.Streams$FlushOnCloseOutputStream.writeBytes(Streams.java:236)	
    	org.elasticsearch.common.io.stream.StreamOutput.write(StreamOutput.java:504)	
    	java.base/java.io.OutputStream.write(OutputStream.java:127)	
    	org.elasticsearch.common.compress.DeflateCompressor.threadLocalOutputStream(DeflateCompressor.java:169)	
    	org.elasticsearch.cluster.coordination.JoinValidationService.serializeClusterState(JoinValidationService.java:348)	
    	org.elasticsearch.cluster.coordination.JoinValidationService$JoinValidation.lambda$doRun$0(JoinValidationService.java:305)	
    	java.base/java.util.Objects.requireNonNullElseGet(Objects.java:308)	
    	org.elasticsearch.cluster.coordination.JoinValidationService$JoinValidation.doRun(JoinValidationService.java:305)	
    	org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)	
    	org.elasticsearch.cluster.coordination.JoinValidationService.processNextItem(JoinValidationService.java:230)	
    	org.elasticsearch.cluster.coordination.JoinValidationService$1.doRun(JoinValidationService.java:200)	
    	org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)	
    	org.elasticsearch.common.util.concurrent.DeterministicTaskQueue$3.run(DeterministicTaskQueue.java:531)	
    	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster$ClusterNode$2.run(AbstractCoordinatorTestCase.java:1392)	
    	org.elasticsearch.common.util.concurrent.DeterministicTaskQueue.runTask(DeterministicTaskQueue.java:135)	
    	org.elasticsearch.common.util.concurrent.DeterministicTaskQueue.runRandomTask(DeterministicTaskQueue.java:129)	
    	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster.runFor(AbstractCoordinatorTestCase.java:762)	
    	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster.stabilise(AbstractCoordinatorTestCase.java:563)	
    	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster.stabilise(AbstractCoordinatorTestCase.java:550)	
    	org.elasticsearch.cluster.coordination.CoordinatorTests.testUnhealthyNodesGetsRemoved(CoordinatorTests.java:147)	
    	java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
    	java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)	
    	java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
    	java.base/java.lang.reflect.Method.invoke(Method.java:568)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)	
    	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
    	org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)	
    	org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)	
    	org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)	
    	org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)	
    	org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)	
    	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
    	com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)	
    	com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)	
    	com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)	
    	com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)	
    	org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)	
    	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
    	org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)	
    	com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)	
    	com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)	
    	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
    	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
    	org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)	
    	org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)	
    	org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)	
    	org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)	
    	org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)	
    	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
    	com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)	
    	com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)	
    	java.base/java.lang.Thread.run(Thread.java:833)]>	
        at __randomizedtesting.SeedInfo.seed([C961FFF1D24CB144:61715BB7E6A80B98]:0)	
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)	
        at org.junit.Assert.assertThat(Assert.java:956)	
        at org.junit.Assert.assertThat(Assert.java:923)	
        at org.elasticsearch.test.ESTestCase.checkStaticState(ESTestCase.java:681)	
        at org.elasticsearch.test.ESTestCase.after(ESTestCase.java:472)	
        at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)	
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)	
        at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)	
        at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:1004)	
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
        at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)	
        at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)	
        at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)	
        at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)	
        at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)	
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)	
        at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)	
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)	
        at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)	
        at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)	
        at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)	
        at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)	
        at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)	
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
        at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)	
        at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)	
        at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)	
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
        at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)	
        at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)	
        at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)	
        at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)	
        at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)	
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)	
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)	
        at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)	
        at java.base/java.lang.Thread.run(Thread.java:833)
```

**Build scan:**
https://gradle-enterprise.elastic.co/s/lp4jbyge3neck/tests/:server:test/org.elasticsearch.cluster.metadata.DataStreamTests/testConcurrentSerialization

**Reproduction line:**
`./gradlew ':server:test' --tests "org.elasticsearch.cluster.metadata.DataStreamTests.testConcurrentSerialization" -Dtests.seed=C961FFF1D24CB144 -Dtests.locale=sl-SI -Dtests.timezone=Europe/Nicosia -Druntime.java=17`

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.cluster.metadata.DataStreamTests&tests.test=testConcurrentSerialization

**Failure excerpt:**
```
java.lang.AssertionError: 
Expected: an empty collection
     but: <[LEAK: resource was not cleaned up before it was garbage-collected.
Recent access records: 
Created at:
	org.elasticsearch.common.util.MockPageCacheRecycler.wrap(MockPageCacheRecycler.java:32)
	org.elasticsearch.common.util.MockPageCacheRecycler.bytePage(MockPageCacheRecycler.java:72)
	org.elasticsearch.transport.BytesRefRecycler.obtain(BytesRefRecycler.java:27)
	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$ClearableRecycler.obtain(AbstractCoordinatorTestCase.java:1927)
	org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput.ensureCapacityFromPosition(RecyclerBytesStreamOutput.java:234)
	org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput.ensureCapacity(RecyclerBytesStreamOutput.java:223)
	org.elasticsearch.common.io.stream.RecyclerBytesStreamOutput.writeBytes(RecyclerBytesStreamOutput.java:77)
	org.elasticsearch.common.io.Streams$FlushOnCloseOutputStream.writeBytes(Streams.java:236)
	org.elasticsearch.common.io.stream.StreamOutput.write(StreamOutput.java:504)
	java.base/java.io.OutputStream.write(OutputStream.java:127)
	org.elasticsearch.common.compress.DeflateCompressor.threadLocalOutputStream(DeflateCompressor.java:169)
	org.elasticsearch.cluster.coordination.JoinValidationService.serializeClusterState(JoinValidationService.java:348)
	org.elasticsearch.cluster.coordination.JoinValidationService$JoinValidation.lambda$doRun$0(JoinValidationService.java:305)
	java.base/java.util.Objects.requireNonNullElseGet(Objects.java:308)
	org.elasticsearch.cluster.coordination.JoinValidationService$JoinValidation.doRun(JoinValidationService.java:305)
	org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	org.elasticsearch.cluster.coordination.JoinValidationService.processNextItem(JoinValidationService.java:230)
	org.elasticsearch.cluster.coordination.JoinValidationService$1.doRun(JoinValidationService.java:200)
	org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	org.elasticsearch.common.util.concurrent.DeterministicTaskQueue$3.run(DeterministicTaskQueue.java:531)
	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster$ClusterNode$2.run(AbstractCoordinatorTestCase.java:1392)
	org.elasticsearch.common.util.concurrent.DeterministicTaskQueue.runTask(DeterministicTaskQueue.java:135)
	org.elasticsearch.common.util.concurrent.DeterministicTaskQueue.runRandomTask(DeterministicTaskQueue.java:129)
	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster.runFor(AbstractCoordinatorTestCase.java:762)
	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster.stabilise(AbstractCoordinatorTestCase.java:563)
	org.elasticsearch.cluster.coordination.AbstractCoordinatorTestCase$Cluster.stabilise(AbstractCoordinatorTestCase.java:550)
	org.elasticsearch.cluster.coordination.CoordinatorTests.testUnhealthyNodesGetsRemoved(CoordinatorTests.java:147)
	java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base/java.lang.reflect.Method.invoke(Method.java:568)
	com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
	com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
	com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
	com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)
	org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
	org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
	org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
	com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
	com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
	com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
	com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
	com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
	com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
	org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
	com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
	org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
	org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
	org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
	org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
	com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
	com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
	com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
	java.base/java.lang.Thread.run(Thread.java:833)]>

  at __randomizedtesting.SeedInfo.seed([C961FFF1D24CB144:61715BB7E6A80B98]:0)
  at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
  at org.junit.Assert.assertThat(Assert.java:956)
  at org.junit.Assert.assertThat(Assert.java:923)
  at org.elasticsearch.test.ESTestCase.checkStaticState(ESTestCase.java:681)
  at org.elasticsearch.test.ESTestCase.after(ESTestCase.java:472)
  at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(null:-1)
  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:568)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:1004)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:833)

```
test/framework/src/main/java/org/elasticsearch/cluster/coordination/AbstractCoordinatorTestCase.java
@Override
        protected boolean publicationMayFail() {
            return publicationMayFail;
        }
    }
    static class DisruptableClusterApplierService extends ClusterApplierService {
        private final String nodeName;
        private final String nodeId;
        private final DeterministicTaskQueue deterministicTaskQueue;
        private final ThreadPool threadPool;
        ClusterStateApplyResponse clusterStateApplyResponse = ClusterStateApplyResponse.SUCCEED;
        private boolean applicationMayFail;
        DisruptableClusterApplierService(
            String nodeName,
            String nodeId,
            Settings settings,
            ClusterSettings clusterSettings,
            DeterministicTaskQueue deterministicTaskQueue,
            ThreadPool threadPool
        ) {
            super(nodeName, settings, clusterSettings, threadPool);
            this.nodeName = nodeName;
            this.nodeId = nodeId;
            this.deterministicTaskQueue = deterministicTaskQueue;
            this.threadPool = threadPool;
            addStateApplier(event -> {
                switch (clusterStateApplyResponse) {
                    case SUCCEED, HANG -> {
                        final ClusterState oldClusterState = event.previousState();
                        final ClusterState newClusterState = event.state();