Skip to content

Commit 9ba0d4a

Browse files
committed
Fix SnapshotMetricsIT
1 parent b929cd1 commit 9ba0d4a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

server/src/internalClusterTest/java/org/elasticsearch/repositories/SnapshotMetricsIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.elasticsearch.plugins.Plugin;
1414
import org.elasticsearch.plugins.PluginsService;
1515
import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase;
16-
import org.elasticsearch.snapshots.mockstore.MockRepository;
1716
import org.elasticsearch.telemetry.Measurement;
1817
import org.elasticsearch.telemetry.TestTelemetryPlugin;
1918
import org.hamcrest.Matcher;
@@ -37,7 +36,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
3736
return CollectionUtils.appendToCopy(super.nodePlugins(), TestTelemetryPlugin.class);
3837
}
3938

40-
public void testUpdateRepository() throws Exception {
39+
public void testSnapshotAPMMetrics() throws Exception {
4140
final String repositoryName = randomIdentifier();
4241

4342
createRepository(repositoryName, "mock");
@@ -50,8 +49,7 @@ public void testUpdateRepository() throws Exception {
5049
indexRandom(true, indexName, randomIntBetween(100, 300));
5150

5251
// Block the snapshot to test "snapshot shards in progress"
53-
MockRepository repository = asInstanceOf(MockRepository.class, getRepositoryOnMaster(repositoryName));
54-
repository.blockOnDataFiles();
52+
blockAllDataNodes(repositoryName);
5553
final String snapshotName = randomIdentifier();
5654
final long beforeCreateSnapshotNanos = System.nanoTime();
5755
try {
@@ -64,7 +62,7 @@ public void testUpdateRepository() throws Exception {
6462
collectMetrics();
6563
assertShardsInProgressMetricIs(hasItem(greaterThan(0L)));
6664
} finally {
67-
repository.unblock();
65+
unblockAllDataNodes(repositoryName);
6866
}
6967

7068
// wait for snapshot to finish to test the other metrics

0 commit comments

Comments
 (0)