Skip to content

Commit

Permalink
org.opensearch.repositories.s3.S3BlobStoreRepositoryTests.testRequest…
Browse files Browse the repository at this point in the history
…Stats fails with NullPointerException

It's a NullPointerException from S3BlobStore.extendedStats() method, where 'genericStatsMetricPublisher' is null. This parameter sets through S3Repository constructor from test and in this test it sets as null. This is the root cause of the issue. If we set valid a GenericStatsMetricPublisher, test works fine without any issue. This was a consistent failure, not a random failure.

Resolves #10735

Signed-off-by: Abdul Muneer Kolarkunnu <muneer.kolarkunnu@netapp.com>
Signed-off-by: akolarkunnu <abdul.kolarkunnu@netapp.com>
  • Loading branch information
akolarkunnu committed May 29, 2024
1 parent a1ae789 commit 2d22f27
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ public void testEnforcedCooldownPeriod() throws IOException {
assertThat(repository.threadPool().relativeTimeInNanos() - beforeFastDelete, lessThan(TEST_COOLDOWN_PERIOD.getNanos()));
}

@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/10735")
@Override
public void testRequestStats() throws Exception {
final String repository = createRepository(randomName());
Expand Down Expand Up @@ -312,6 +311,8 @@ protected S3Repository createRepository(
ClusterService clusterService,
RecoverySettings recoverySettings
) {
GenericStatsMetricPublisher genericStatsMetricPublisher = new GenericStatsMetricPublisher(10000L, 10, 10000L, 10);

return new S3Repository(
metadata,
registry,
Expand All @@ -326,7 +327,7 @@ protected S3Repository createRepository(
false,
null,
null,
null
genericStatsMetricPublisher
) {

@Override
Expand Down

0 comments on commit 2d22f27

Please sign in to comment.