From 0145a41ea503e3a396b9381d97f21e30b0a3d6e2 Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Wed, 19 Jun 2024 16:06:23 +0200 Subject: [PATCH] Log more data for PrevalidateShardPathIT#testCheckShards (#109887) `PrevalidateShardPathIT#testCheckShards` still keeps failing on CI, so we need more logging. * Add debug logging for `MasterService` events to verify that a cluster service update is triggered. * Log explanation for stuck shards regardless whether they are located on node_2 in the cluster state. See #104807 --- muted-tests.yml | 4 +--- .../org/elasticsearch/cluster/PrevalidateShardPathIT.java | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index 86ddd0b26e925..ef3c8188498a9 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -67,9 +67,6 @@ tests: - class: "org.elasticsearch.xpack.shutdown.NodeShutdownReadinessIT" issue: "https://github.com/elastic/elasticsearch/issues/109838" method: "testShutdownReadinessService" -- class: "org.elasticsearch.cluster.PrevalidateShardPathIT" - issue: "https://github.com/elastic/elasticsearch/issues/104807" - method: "testCheckShards" - class: "org.elasticsearch.packaging.test.RpmPreservationTests" issue: "https://github.com/elastic/elasticsearch/issues/109898" method: "test30PreserveConfig" @@ -82,6 +79,7 @@ tests: issue: "https://github.com/elastic/elasticsearch/issues/109915" method: "testRandomMultiValuesTopN" + # Examples: # # Mute a single test case in a YAML test suite: diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/PrevalidateShardPathIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/PrevalidateShardPathIT.java index ea566c90ad769..3ff7e66d25639 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/PrevalidateShardPathIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/PrevalidateShardPathIT.java @@ -22,6 +22,7 @@ import org.elasticsearch.common.xcontent.ChunkedToXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.junit.annotations.TestLogging; import java.util.HashSet; import java.util.List; @@ -39,6 +40,10 @@ @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0) public class PrevalidateShardPathIT extends ESIntegTestCase { + @TestLogging( + value = "org.elasticsearch.cluster.service.MasterService:DEBUG", + reason = "https://github.com/elastic/elasticsearch/issues/104807" + ) public void testCheckShards() throws Exception { internalCluster().startMasterOnlyNode(); String node1 = internalCluster().startDataOnlyNode(); @@ -95,7 +100,6 @@ public void testCheckShards() throws Exception { .allShards() .filter(s -> s.getIndexName().equals(indexName)) .filter(s -> node2ShardIds.contains(s.shardId())) - .filter(s -> s.currentNodeId().equals(node2Id)) .toList(); logger.info("Found {} shards on the relocation source node {} in the cluster state", node2Shards, node2Id); for (var node2Shard : node2Shards) {