@Test(timeout = 1000)
  public void testRequestOnClosing() {
    int bucketCount = bucketingEnabled ? 1 : 0;
    BlobStoreStats blobStoreStats = setupBlobStoreStats(bucketCount, 0);
    blobStoreStats.close();
    try {
      verifyContainerStorageStatsAndGetTotalValidSize(blobStoreStats, state.time.milliseconds());
      fail("Expected StoreException thrown upon request when BlobStoreStats is closing");
    } catch (StoreException e) {
      assertEquals("Mismatch on expected error code", StoreErrorCodes.StoreShuttingDown, e.getErrorCode());
    }
    try {
      verifyAndGetLogSegmentValidSize(blobStoreStats, new TimeRange(state.time.milliseconds(), 0));
      fail("Expected StoreException thrown upon request when BlobStoreStats is closing");
    } catch (StoreException e) {
      assertEquals("Mismatch on expected error code", StoreErrorCodes.StoreShuttingDown, e.getErrorCode());
    }
  }
Test to verify that once the {@link BlobStoreStats} is closed (or closing), requests throw {@link StoreException}.
ambry-store/src/test/java/com/github/ambry/store/BlobStoreStatsTest.java