@Test
public void testExecuteWebsterPlan_cleanTempFails() throws Exception {

    final File testOutDir = new File(testOutBaseDir, "testExecuteWebsterPlan_cleanTempFails");
    recursiveDeleteWithRetry(testOutDir);
    final File projectRoot = new File(testOutDir, "content-package");
    FileUtils.copyDirectory(new File(srcDir, "content-package"), projectRoot);
    final WebsterMojo mojo = newMojo();
    final File tempDir = new File(testOutDir, "webster-tmp");
    mojo.websterTempDirectory = tempDir;
    final WebsterPlan.Builder builder = new WebsterPlan.Builder();
    final File segmentStore = new File(testOutDir, "segmentstore");
    builder.withFixtureProvider(() -> JcrFactory.getReadWriteFixture(segmentStore));
    final CompletableFuture<File> globalHome = new CompletableFuture<>();
    withMockTarget(builder, session -> {
        final File tmp = tempDir.listFiles()[0];
        globalHome.complete(tmp);
    });
    mojo.tempDirDeleter = dir -> {
        throw new IOException("OMG I can't tho. Sorry, dir: " + dir.getAbsolutePath());
    };
    mojo.executeWebsterPlan(builder);
    assertTrue("expect log indicating failure to delete global home",
            logFor(mojo).any(entry -> entry.message.startsWith("Failed to delete temp global")));
}