**Build scan:**
https://gradle-enterprise.elastic.co/s/dp4oxnqg2vukm/tests/:server:internalClusterTest/org.elasticsearch.discovery.StableMasterDisruptionIT/testRepeatedNullMasterRecognizedAsGreenIfMasterDoesNotKnowItIsUnstable

**Reproduction line:**
`./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.discovery.StableMasterDisruptionIT.testRepeatedNullMasterRecognizedAsGreenIfMasterDoesNotKnowItIsUnstable" -Dtests.seed=18D8D91821113F4 -Dtests.locale=sr-Latn -Dtests.timezone=Africa/Lome -Druntime.java=17`

**Applicable branches:**
master

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.discovery.StableMasterDisruptionIT&tests.test=testRepeatedNullMasterRecognizedAsGreenIfMasterDoesNotKnowItIsUnstable

**Failure excerpt:**
```
com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=1567, name=TEST-StableMasterDisruptionIT.testRepeatedNullMasterRecognizedAsGreenIfMasterDoesNotKnowItIsUnstable-seed#[18D8D91821113F4][LongGCDisruption][blockDetection], state=RUNNABLE, group=TGRP-StableMasterDisruptionIT]

  at __randomizedtesting.SeedInfo.seed([18D8D91821113F4:EAA67330B99E723D]:0)

  Caused by: java.lang.AssertionError: Thread [elasticsearch[node_t1][AsyncLucenePersistedState#updateTask][T#1]] is blocked waiting on the resource [java.util.HashMap@389ac76e] held by the suspended thread [elasticsearch[node_t0][cluster_coordination][T#1]] of the disrupted node [node_t0].
  Please add this occurrence to the unsafeClasses list in [org.elasticsearch.test.disruption.LongGCDisruption].
  Stack trace of blocked thread: app//org.apache.lucene.tests.mockfile.WindowsFS.onOpen(WindowsFS.java:65)
  app//org.apache.lucene.tests.mockfile.HandleTrackingFS.callOpenHook(HandleTrackingFS.java:82)
  app//org.apache.lucene.tests.mockfile.HandleTrackingFS.newFileChannel(HandleTrackingFS.java:202)
  java.base@17.0.2/java.nio.channels.FileChannel.open(FileChannel.java:298)
  java.base@17.0.2/java.nio.channels.FileChannel.open(FileChannel.java:357)
  app//org.apache.lucene.util.IOUtils.fsync(IOUtils.java:465)
  app//org.apache.lucene.store.FSDirectory.syncMetaData(FSDirectory.java:279)
  app//org.apache.lucene.store.LockValidatingDirectoryWrapper.syncMetaData(LockValidatingDirectoryWrapper.java:62)
  app//org.apache.lucene.index.SegmentInfos.prepareCommit(SegmentInfos.java:900)
  app//org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:5318)
  app//org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3535)
  app//org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:3355)
  app//org.elasticsearch.gateway.PersistedClusterStateService$MetadataIndexWriter.prepareCommit(PersistedClusterStateService.java:752)
  app//org.elasticsearch.gateway.PersistedClusterStateService$Writer.prepareCommit(PersistedClusterStateService.java:1071)
  app//org.elasticsearch.gateway.PersistedClusterStateService$Writer.commit(PersistedClusterStateService.java:1047)
  app//org.elasticsearch.gateway.PersistedClusterStateService$Writer.writeIncrementalStateAndCommit(PersistedClusterStateService.java:865)
  app//org.elasticsearch.gateway.GatewayMetaState$LucenePersistedState.setLastAcceptedState(GatewayMetaState.java:506)
  app//org.elasticsearch.gateway.GatewayMetaState$AsyncPersistedState$1.doRun(GatewayMetaState.java:383)
  app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:768)
  app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
  java.base@17.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  java.base@17.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  java.base@17.0.2/java.lang.Thread.run(Thread.java:833)
  Stack trace of blocking thread: java.base@17.0.2/sun.nio.fs.UnixNativeDispatcher.stat0(Native Method)
  java.base@17.0.2/sun.nio.fs.UnixNativeDispatcher.stat(UnixNativeDispatcher.java:277)
  java.base@17.0.2/sun.nio.fs.UnixFileAttributes.get(UnixFileAttributes.java:70)
  java.base@17.0.2/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:52)
  app//org.apache.lucene.tests.mockfile.WindowsFS.getKey(WindowsFS.java:59)
  app//org.apache.lucene.tests.mockfile.WindowsFS.onOpen(WindowsFS.java:66)
  app//org.apache.lucene.tests.mockfile.HandleTrackingFS.callOpenHook(HandleTrackingFS.java:82)
  app//org.apache.lucene.tests.mockfile.HandleTrackingFS.newOutputStream(HandleTrackingFS.java:163)
  java.base@17.0.2/java.nio.file.Files.newOutputStream(Files.java:228)
  app//org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:392)
  app//org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:385)
  app//org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:220)
  app//org.apache.lucene.store.LockValidatingDirectoryWrapper.createOutput(LockValidatingDirectoryWrapper.java:43)
  app//org.apache.lucene.index.SegmentInfos.write(SegmentInfos.java:557)
  app//org.apache.lucene.index.SegmentInfos.prepareCommit(SegmentInfos.java:901)
  app//org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:5318)
  app//org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3535)
  app//org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:3355)
  app//org.elasticsearch.gateway.PersistedClusterStateService$MetadataIndexWriter.prepareCommit(PersistedClusterStateService.java:752)
  app//org.elasticsearch.gateway.PersistedClusterStateService$Writer.prepareCommit(PersistedClusterStateService.java:1071)
  app//org.elasticsearch.gateway.PersistedClusterStateService$Writer.commit(PersistedClusterStateService.java:1047)
  app//org.elasticsearch.gateway.PersistedClusterStateService$Writer.writeIncrementalStateAndCommit(PersistedClusterStateService.java:865)
  app//org.elasticsearch.gateway.GatewayMetaState$LucenePersistedState.setLastAcceptedState(GatewayMetaState.java:506)
  app//org.elasticsearch.cluster.coordination.CoordinationState.handlePublishRequest(CoordinationState.java:392)
  app//org.elasticsearch.cluster.coordination.Coordinator.handlePublishRequest(Coordinator.java:434)
  app//org.elasticsearch.cluster.coordination.Coordinator$$Lambda$1961/0x000000080122f390.apply(Unknown Source)
  app//org.elasticsearch.cluster.coordination.PublicationTransportHandler$PublicationContext.lambda$sendPublishRequest$3(PublicationTransportHandler.java:351)
  app//org.elasticsearch.cluster.coordination.PublicationTransportHandler$PublicationContext$$Lambda$3041/0x000000080141d0b8.get(Unknown Source)
  app//org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47)
  app//org.elasticsearch.action.ActionRunnable$$Lambda$3042/0x000000080141d2e0.accept(Unknown Source)
  app//org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62)
  app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:768)
  app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
  java.base@17.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  java.base@17.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  java.base@17.0.2/java.lang.Thread.run(Thread.java:833)

    at __randomizedtesting.SeedInfo.seed([18D8D91821113F4]:0)
    at org.elasticsearch.test.disruption.LongGCDisruption.onBlockDetected(LongGCDisruption.java:330)
    at org.elasticsearch.test.disruption.LongGCDisruption$2.doRun(LongGCDisruption.java:161)
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
    at java.lang.Thread.run(Thread.java:833)

```
test/framework/src/main/java/org/elasticsearch/test/disruption/LongGCDisruption.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.test.disruption;
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.test.InternalTestCluster;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
import java.util.Arrays;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
 * Suspends all threads on the specified node in order to simulate a long gc.
 */
public class LongGCDisruption extends SingleNodeDisruption {