@Test
  public void storeRemoveDirectoryAndRestartTestWithOtherError() throws Exception {
    generateConfigs(true, false, false, 2, true, false);
    MockDataNodeId dataNode = clusterMap.getDataNodes().get(0);
    ReplicaId replica = clusterMap.getReplicaIds(dataNode).get(0);

    // Start a storage manager so the replica's first log segment would be created
    StorageManager storageManager = createStorageManager(dataNode, metricRegistry, null);
    storageManager.start();
    storageManager.shutdown();

    // Now find the lock file in the blob store and lock this file
    FileLock fileLock = new FileLock(new File(replica.getReplicaPath(), BlobStore.LockFile));
    Assert.assertTrue(fileLock.tryLock());

    // This file is locked already, replica won't be started
    storageManager = createStorageManager(dataNode, metricRegistry, null);
    storageManager.start();
    assertNull(storageManager.getStore(replica.getPartitionId(), false));
    storageManager.shutdown();
    fileLock.destroy();
  }
Test the case where the blob store can't get started and we need to remove the directory and then restart the blobstore.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/StorageManagerTest.java