1313import org .elasticsearch .plugins .Plugin ;
1414import org .elasticsearch .plugins .PluginsService ;
1515import org .elasticsearch .snapshots .AbstractSnapshotIntegTestCase ;
16- import org .elasticsearch .snapshots .mockstore .MockRepository ;
1716import org .elasticsearch .telemetry .Measurement ;
1817import org .elasticsearch .telemetry .TestTelemetryPlugin ;
1918import 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