diff --git a/muted-tests.yml b/muted-tests.yml index 8a31484090b94..59d49e4eaf66c 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -204,9 +204,6 @@ tests: - class: org.elasticsearch.smoketest.SmokeTestMonitoringWithSecurityIT method: testHTTPExporterWithSSL issue: https://github.com/elastic/elasticsearch/issues/122220 -- class: org.elasticsearch.blocks.SimpleBlocksIT - method: testConcurrentAddBlock - issue: https://github.com/elastic/elasticsearch/issues/122324 - class: org.elasticsearch.xpack.ilm.TimeSeriesLifecycleActionsIT method: testHistoryIsWrittenWithFailure issue: https://github.com/elastic/elasticsearch/issues/123203 diff --git a/server/src/internalClusterTest/java/org/elasticsearch/blocks/SimpleBlocksIT.java b/server/src/internalClusterTest/java/org/elasticsearch/blocks/SimpleBlocksIT.java index 0fb4959ee38d6..f0ae5b5032af2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/blocks/SimpleBlocksIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/blocks/SimpleBlocksIT.java @@ -412,8 +412,11 @@ public void testConcurrentAddBlock() throws InterruptedException, ExecutionExcep try { startInParallel(threadCount, i -> { try { - indicesAdmin().prepareAddBlock(block, indexName).get(); - assertIndexHasBlock(block, indexName); + AddIndexBlockResponse response = indicesAdmin().prepareAddBlock(block, indexName).get(); + // Check that the block has been added only for the request that won the race + if (response.isAcknowledged() && response.getIndices().isEmpty() == false) { + assertIndexHasBlock(block, indexName); + } } catch (final ClusterBlockException e) { assertThat(e.blocks(), hasSize(1)); assertTrue(e.blocks().stream().allMatch(b -> b.id() == block.getBlock().id()));