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 (#13866)

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 <[email protected]>
Signed-off-by: akolarkunnu <[email protected]>
Co-authored-by: akolarkunnu <[email protected]>
  • Loading branch information
akolarkunnu and akolarkunnu authored May 30, 2024
1 parent a0ff2ff commit 1bdf43d
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 1bdf43d

Please sign in to comment.