@Test
  public void testCompactPermanentBlobs()
      throws ReflectiveOperationException, StoreException, CloudStorageException, InterruptedException {
    v2TestOnly();
    this.compactionDryRun = false;
    setupCloudStore(false, false, 0, true);
    clearContainer(partitionId, (AzureCloudDestinationSync) dest, new VerifiableProperties(properties));
    MockMessageWriteSet messageWriteSet = new MockMessageWriteSet();

    for (int j = 0; j < 10; j++) {
      // permanent blobs
      // set isVcr = true so that the lifeVersion is 0
      CloudTestUtil.addBlobToMessageSet(messageWriteSet, 1024, Utils.Infinite_Time, refAccountId, refContainerId, false,
          false, partitionId, System.currentTimeMillis(), isVcr);
    }

    // Put blobs
    store.put(messageWriteSet);

    // Try to Compact blobs
    List<MessageInfo> messageInfoList = messageWriteSet.getMessageSetInfo();
    assertEquals(0, dest.compactPartition(String.valueOf(partitionId.getId())));
    for (MessageInfo messageInfo: messageInfoList) {
      assertTrue(dest.doesBlobExist((BlobId) messageInfo.getStoreKey()));
    }
  }
Tests that compaction handles failures incl. 404 and other errors
@throws ReflectiveOperationException
@throws StoreException
@throws CloudStorageException
ambry-vcr/src/test/java/com/github/ambry/vcr/CloudBlobStoreTest.java