@Test
  public void compactWithCompactionInProgressTest() throws Exception {
    refreshState(false, true, false);
    List<LogSegmentName> segmentsUnderCompaction = getLogSegments(0, 2);
    CompactionDetails details = new CompactionDetails(0, segmentsUnderCompaction, null);

    // create a compaction log in order to mimic a compaction being in progress
    try (CompactionLog cLog = new CompactionLog(tempDirStr, STORE_ID, state.time, details, config)) {
      compactor = getCompactor(state.log, DISK_IO_SCHEDULER, null, false);
      compactor.initialize(state.index);
      compactor.compact(details, bundleReadBuffer);
      fail("compact() should have failed because a compaction is already in progress");
    } catch (IllegalStateException e) {
      // expected. Nothing to do.
    } finally {
      compactor.close(0);
    }
  }
Tests to make sure that {@link BlobStoreCompactor#compact(CompactionDetails, byte[])} fails when a compaction is
already in progress.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java