@Test
  public void addBlobStoreLoadFailureTest() throws Exception {
    generateConfigs(true, false);
    MockDataNodeId localNode = clusterMap.getDataNodes().get(0);
    List<ReplicaId> localReplicas = clusterMap.getReplicaIds(localNode);

    // Start the StorageManager
    StorageManager storageManager = createStorageManager(localNode, new MetricRegistry(), null);
    storageManager.start();

    // Create a new Partition
    PartitionId newPartition1 =
        new MockPartitionId(11L, MockClusterMap.DEFAULT_PARTITION_CLASS, clusterMap.getDataNodes(), 0);

    // test add store but fail to add segment requirements to DiskSpaceAllocator. (This is simulated by inducing
    // addRequiredSegments failure to make store inaccessible)
    List<String> mountPaths = localNode.getMountPaths();
    String diskToFail = mountPaths.get(0);
    File reservePoolDir = new File(diskToFail, diskManagerConfig.diskManagerReserveFileDirName);
    File storeReserveDir = new File(reservePoolDir, DiskSpaceAllocator.STORE_DIR_PREFIX + newPartition1.toPathString());

    // Delete the Store reserve directory
    Utils.deleteFileOrDirectory(storeReserveDir);
    // Create the file instead of directory
    assertTrue("File creation should succeed", storeReserveDir.createNewFile());

    assertFalse("Add store should fail if store couldn't start due to initializePool failure",
        storageManager.addBlobStore(newPartition1.getReplicaIds().get(0)));
    assertNull("New store shouldn't be in in-memory data structure", storageManager.getStore(newPartition1, false));

    shutdownAndAssertStoresInaccessible(storageManager, localReplicas);
  }
Starts the {@link StorageManager}
Creates a new Partition
Induce the failure in {@link DiskSpaceAllocator}
Try to start the store in for new Partition
@throws Exception exception
ambry-store/src/test/java/com/github/ambry/store/StorageManagerTest.java