From d6bbafad055b86b44bea23a5993e31440215be7d Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Tue, 26 Oct 2021 17:57:10 -0400 Subject: [PATCH] fix(timeout): remove HTTP timeout handler (#737) * fix(timeout): remove HTTP timeout handler Remove TimeoutHandler - this was initially used as a hack around preventing clients from seeing indefinitely-long request "hangs" when requesting URL paths that didn't exist, such as web-client assets in a minimal build. This is now properly handled by the WebClientAssetsHandler responding with a 404 in a minimal build, or else a 200 with the index.html in a non-minimal build. Other actual assets, like .js bundles, fonts, images, continue to be handled by the StaticAssetsHandler. This leaves no real case where the TimeoutHandler was useful. However, there were cases where the TimeoutHandler could be triggered in undesirable ways - for example, long-running report generation, archive uploads, jfr-datasource uploads, and recording downloads. * test(timeout): correct broken unit tests (cherry picked from commit 3706fe20f28fb7eec13a92c408f0fa407f142b67) --- .../reports/ActiveRecordingReportCache.java | 10 +-- .../reports/ArchivedRecordingReportCache.java | 10 +-- .../reports/SubprocessReportGenerator.java | 9 +- .../http/api/v1/TargetReportGetHandler.java | 4 +- .../web/http/generic/HttpGenericModule.java | 4 - .../net/web/http/generic/TimeoutHandler.java | 90 ------------------- .../ActiveRecordingReportCacheTest.java | 24 ++--- .../ArchivedRecordingReportCacheTest.java | 9 +- .../SubprocessReportGeneratorTest.java | 35 +++----- 9 files changed, 30 insertions(+), 165 deletions(-) delete mode 100644 src/main/java/io/cryostat/net/web/http/generic/TimeoutHandler.java diff --git a/src/main/java/io/cryostat/net/reports/ActiveRecordingReportCache.java b/src/main/java/io/cryostat/net/reports/ActiveRecordingReportCache.java index e2b579d527..f91970c54f 100644 --- a/src/main/java/io/cryostat/net/reports/ActiveRecordingReportCache.java +++ b/src/main/java/io/cryostat/net/reports/ActiveRecordingReportCache.java @@ -38,7 +38,6 @@ package io.cryostat.net.reports; import java.nio.file.Path; -import java.time.Duration; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; @@ -56,7 +55,6 @@ import io.cryostat.core.sys.FileSystem; import io.cryostat.net.ConnectionDescriptor; import io.cryostat.net.TargetConnectionManager; -import io.cryostat.net.web.http.generic.TimeoutHandler; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.LoadingCache; @@ -126,13 +124,7 @@ protected String getReport(SubprocessReportGenerator.RecordingDescriptor recordi generationLock.lock(); logger.trace("Active report cache miss for {}", recordingDescriptor.recordingName); try { - saveFile = - subprocessReportGeneratorProvider - .get() - .exec( - recordingDescriptor, - Duration.ofMillis(TimeoutHandler.TIMEOUT_MS)) - .get(); + saveFile = subprocessReportGeneratorProvider.get().exec(recordingDescriptor).get(); return fs.readString(saveFile); } catch (ExecutionException | CompletionException ee) { logger.error(ee); diff --git a/src/main/java/io/cryostat/net/reports/ArchivedRecordingReportCache.java b/src/main/java/io/cryostat/net/reports/ArchivedRecordingReportCache.java index ef989f21e6..1f75733548 100644 --- a/src/main/java/io/cryostat/net/reports/ArchivedRecordingReportCache.java +++ b/src/main/java/io/cryostat/net/reports/ArchivedRecordingReportCache.java @@ -39,7 +39,6 @@ import java.io.IOException; import java.nio.file.Path; -import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; import java.util.concurrent.locks.ReentrantLock; @@ -49,7 +48,6 @@ import io.cryostat.core.log.Logger; import io.cryostat.core.sys.FileSystem; -import io.cryostat.net.web.http.generic.TimeoutHandler; import io.cryostat.recordings.RecordingArchiveHelper; class ArchivedRecordingReportCache { @@ -92,13 +90,7 @@ Future get(String recordingName) { Path archivedRecording = recordingArchiveHelper.getRecordingPath(recordingName).get(); Path saveFile = - subprocessReportGeneratorProvider - .get() - .exec( - archivedRecording, - dest, - Duration.ofMillis(TimeoutHandler.TIMEOUT_MS)) - .get(); + subprocessReportGeneratorProvider.get().exec(archivedRecording, dest).get(); f.complete(saveFile); } catch (Exception e) { logger.error(e); diff --git a/src/main/java/io/cryostat/net/reports/SubprocessReportGenerator.java b/src/main/java/io/cryostat/net/reports/SubprocessReportGenerator.java index 0a9ddf6bfb..0fdf3d3724 100644 --- a/src/main/java/io/cryostat/net/reports/SubprocessReportGenerator.java +++ b/src/main/java/io/cryostat/net/reports/SubprocessReportGenerator.java @@ -44,7 +44,6 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.nio.file.StandardOpenOption; -import java.time.Duration; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -109,7 +108,7 @@ public class SubprocessReportGenerator { this.logger = logger; } - CompletableFuture exec(Path recording, Path saveFile, Duration timeout) + CompletableFuture exec(Path recording, Path saveFile) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException, InterruptedException, ReportGenerationException { @@ -142,7 +141,7 @@ CompletableFuture exec(Path recording, Path saveFile, Duration timeout) return CompletableFuture.supplyAsync( () -> { try { - proc.waitFor(timeout.toMillis(), TimeUnit.MILLISECONDS); + proc.waitFor(5, TimeUnit.MINUTES); ExitStatus status = ExitStatus.byExitCode(proc.exitValue()); switch (status) { case OK: @@ -168,13 +167,13 @@ CompletableFuture exec(Path recording, Path saveFile, Duration timeout) }); } - Future exec(RecordingDescriptor recordingDescriptor, Duration timeout) throws Exception { + Future exec(RecordingDescriptor recordingDescriptor) throws Exception { Path recording = getRecordingFromLiveTarget( recordingDescriptor.recordingName, recordingDescriptor.connectionDescriptor); Path saveFile = tempFileProvider.get(); - CompletableFuture cf = exec(recording, saveFile, timeout); + CompletableFuture cf = exec(recording, saveFile); return cf.whenComplete( (p, t) -> { try { diff --git a/src/main/java/io/cryostat/net/web/http/api/v1/TargetReportGetHandler.java b/src/main/java/io/cryostat/net/web/http/api/v1/TargetReportGetHandler.java index c826b763d1..194330952b 100644 --- a/src/main/java/io/cryostat/net/web/http/api/v1/TargetReportGetHandler.java +++ b/src/main/java/io/cryostat/net/web/http/api/v1/TargetReportGetHandler.java @@ -41,7 +41,6 @@ import java.util.Set; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; import javax.inject.Inject; @@ -53,7 +52,6 @@ import io.cryostat.net.web.http.AbstractAuthenticatedRequestHandler; import io.cryostat.net.web.http.HttpMimeType; import io.cryostat.net.web.http.api.ApiVersion; -import io.cryostat.net.web.http.generic.TimeoutHandler; import io.cryostat.recordings.RecordingNotFoundException; import io.vertx.core.http.HttpHeaders; @@ -117,7 +115,7 @@ public void handleAuthenticated(RoutingContext ctx) throws Exception { .end( reportService .get(getConnectionDescriptorFromContext(ctx), recordingName) - .get(TimeoutHandler.TIMEOUT_MS, TimeUnit.MILLISECONDS)); + .get()); } catch (CompletionException | ExecutionException ee) { Exception rootCause = (Exception) ExceptionUtils.getRootCause(ee); diff --git a/src/main/java/io/cryostat/net/web/http/generic/HttpGenericModule.java b/src/main/java/io/cryostat/net/web/http/generic/HttpGenericModule.java index ec6ce8b20e..5220b7674d 100644 --- a/src/main/java/io/cryostat/net/web/http/generic/HttpGenericModule.java +++ b/src/main/java/io/cryostat/net/web/http/generic/HttpGenericModule.java @@ -46,10 +46,6 @@ @Module public abstract class HttpGenericModule { - @Binds - @IntoSet - abstract RequestHandler bindTimeoutHandler(TimeoutHandler handler); - @Binds @IntoSet abstract RequestHandler bindCorsEnablingHandler(CorsEnablingHandler handler); diff --git a/src/main/java/io/cryostat/net/web/http/generic/TimeoutHandler.java b/src/main/java/io/cryostat/net/web/http/generic/TimeoutHandler.java deleted file mode 100644 index ee5b683e5e..0000000000 --- a/src/main/java/io/cryostat/net/web/http/generic/TimeoutHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright The Cryostat Authors - * - * The Universal Permissive License (UPL), Version 1.0 - * - * Subject to the condition set forth below, permission is hereby granted to any - * person obtaining a copy of this software, associated documentation and/or data - * (collectively the "Software"), free of charge and under any and all copyright - * rights in the Software, and any and all patent rights owned or freely - * licensable by each licensor hereunder covering either (i) the unmodified - * Software as contributed to or provided by such licensor, or (ii) the Larger - * Works (as defined below), to deal in both - * - * (a) the Software, and - * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if - * one is included with the Software (each a "Larger Work" to which the Software - * is contributed by such licensors), - * - * without restriction, including without limitation the rights to copy, create - * derivative works of, display, perform, and distribute the Software and make, - * use, sell, offer for sale, import, export, have made, and have sold the - * Software and the Larger Work(s), and to sublicense the foregoing rights on - * either these or other terms. - * - * This license is subject to the following condition: - * The above copyright notice and either this complete permission notice or at - * a minimum a reference to the UPL must be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package io.cryostat.net.web.http.generic; - -import java.util.Set; - -import javax.inject.Inject; - -import io.cryostat.net.security.ResourceAction; -import io.cryostat.net.web.http.RequestHandler; -import io.cryostat.net.web.http.api.ApiVersion; - -import io.vertx.core.http.HttpMethod; -import io.vertx.ext.web.RoutingContext; - -public class TimeoutHandler implements RequestHandler { - - public static final long TIMEOUT_MS = 15_000L; - final io.vertx.ext.web.handler.TimeoutHandler handler; - - @Inject - TimeoutHandler() { - this.handler = io.vertx.ext.web.handler.TimeoutHandler.create(TIMEOUT_MS); - } - - @Override - public int getPriority() { - return 0; - } - - @Override - public ApiVersion apiVersion() { - return ApiVersion.GENERIC; - } - - @Override - public HttpMethod httpMethod() { - return HttpMethod.OTHER; - } - - @Override - public Set resourceActions() { - return ResourceAction.NONE; - } - - @Override - public String path() { - return ALL_PATHS; - } - - @Override - public void handle(RoutingContext ctx) { - handler.handle(ctx); - } -} diff --git a/src/test/java/io/cryostat/net/reports/ActiveRecordingReportCacheTest.java b/src/test/java/io/cryostat/net/reports/ActiveRecordingReportCacheTest.java index a01051abea..9916f4b53b 100644 --- a/src/test/java/io/cryostat/net/reports/ActiveRecordingReportCacheTest.java +++ b/src/test/java/io/cryostat/net/reports/ActiveRecordingReportCacheTest.java @@ -38,7 +38,6 @@ package io.cryostat.net.reports; import java.nio.file.Path; -import java.time.Duration; import java.util.Set; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; @@ -114,8 +113,7 @@ void shouldReturnTrueWhenDeletingReport() throws Exception { Mockito.when(pathFuture.get()).thenReturn(destinationFile); Mockito.when( subprocessReportGenerator.exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class))) + Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class))) .thenReturn(pathFuture); Mockito.when(fs.readString(destinationFile)).thenReturn(REPORT_DOC); @@ -132,8 +130,7 @@ void shouldReturnGeneratedReportResult() throws Exception { Mockito.when(pathFuture.get()).thenReturn(destinationFile); Mockito.when( subprocessReportGenerator.exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class))) + Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class))) .thenReturn(pathFuture); Mockito.when(fs.readString(destinationFile)).thenReturn(REPORT_DOC); @@ -147,9 +144,7 @@ void shouldReturnGeneratedReportResult() throws Exception { inOrder.verify(lock).lock(); inOrder.verify(subprocessReportGenerator) - .exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class)); + .exec(Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class)); inOrder.verify(fs).readString(destinationFile); @@ -161,8 +156,7 @@ void shouldReturnCachedReportResultOnSecondRequest() throws Exception { Mockito.when(pathFuture.get()).thenReturn(destinationFile); Mockito.when( subprocessReportGenerator.exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class))) + Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class))) .thenReturn(pathFuture); Mockito.when(fs.readString(destinationFile)).thenReturn(REPORT_DOC); @@ -179,9 +173,7 @@ void shouldReturnCachedReportResultOnSecondRequest() throws Exception { inOrder.verify(lock, Mockito.times(1)).lock(); inOrder.verify(subprocessReportGenerator, Mockito.times(1)) - .exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class)); + .exec(Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class)); inOrder.verify(lock, Mockito.times(1)).unlock(); } @@ -191,8 +183,7 @@ void shouldThrowExceptionIfRecordingNotFound() throws Exception { ConnectionDescriptor connectionDescriptor = new ConnectionDescriptor("foo"); Mockito.when( subprocessReportGenerator.exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class))) + Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class))) .thenThrow(new CompletionException(new RecordingNotFoundException("", ""))); Assertions.assertThrows( ExecutionException.class, () -> cache.get(connectionDescriptor, "bar").get()); @@ -203,8 +194,7 @@ void shouldThrowExceptionIfSubprocessExitsNonCleanly() throws Exception { ConnectionDescriptor connectionDescriptor = new ConnectionDescriptor("foo"); Mockito.when( subprocessReportGenerator.exec( - Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class), - Mockito.any(Duration.class))) + Mockito.any(SubprocessReportGenerator.RecordingDescriptor.class))) .thenThrow( new CompletionException( new SubprocessReportGenerator.ReportGenerationException( diff --git a/src/test/java/io/cryostat/net/reports/ArchivedRecordingReportCacheTest.java b/src/test/java/io/cryostat/net/reports/ArchivedRecordingReportCacheTest.java index 062b692857..e7fb4752b4 100644 --- a/src/test/java/io/cryostat/net/reports/ArchivedRecordingReportCacheTest.java +++ b/src/test/java/io/cryostat/net/reports/ArchivedRecordingReportCacheTest.java @@ -38,7 +38,6 @@ package io.cryostat.net.reports; import java.nio.file.Path; -import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; @@ -122,9 +121,7 @@ void getShouldGenerateAndCacheReport() throws Exception { Mockito.when(pathFuture.get()).thenReturn(destinationFile); Mockito.when( subprocessReportGenerator.exec( - Mockito.any(Path.class), - Mockito.any(Path.class), - Mockito.any(Duration.class))) + Mockito.any(Path.class), Mockito.any(Path.class))) .thenReturn(pathFuture); Future res = cache.get(recordingName); @@ -167,9 +164,7 @@ void shouldThrowErrorIfReportGenerationFails() throws Exception { Mockito.when( subprocessReportGenerator.exec( - Mockito.any(Path.class), - Mockito.any(Path.class), - Mockito.any(Duration.class))) + Mockito.any(Path.class), Mockito.any(Path.class))) .thenThrow( new CompletionException( new SubprocessReportGenerator.ReportGenerationException( diff --git a/src/test/java/io/cryostat/net/reports/SubprocessReportGeneratorTest.java b/src/test/java/io/cryostat/net/reports/SubprocessReportGeneratorTest.java index 3cf57d01ab..2af3892bd2 100644 --- a/src/test/java/io/cryostat/net/reports/SubprocessReportGeneratorTest.java +++ b/src/test/java/io/cryostat/net/reports/SubprocessReportGeneratorTest.java @@ -135,14 +135,13 @@ void setup() throws Exception { void shouldThrowIfRecordingPathIsNull() { Assertions.assertThrows( IllegalArgumentException.class, - () -> generator.exec(null, Mockito.mock(Path.class), Duration.ofSeconds(10))); + () -> generator.exec(null, Mockito.mock(Path.class))); } @Test void shouldThrowIfDestinationFileIsNull() { Assertions.assertThrows( - IllegalArgumentException.class, - () -> generator.exec(recordingFile, null, Duration.ofSeconds(10))); + IllegalArgumentException.class, () -> generator.exec(recordingFile, null)); } @Test @@ -151,7 +150,7 @@ void shouldWriteSerializedTransformersToFile() throws Exception { Mockito.when(dest.toAbsolutePath()).thenReturn(dest); Mockito.when(dest.toString()).thenReturn("/dest/somefile.tmp"); - generator.exec(recordingFile, dest, Duration.ofSeconds(10)); + generator.exec(recordingFile, dest); ArgumentCaptor captor = ArgumentCaptor.forClass(String.class); Mockito.verify(fs) @@ -173,7 +172,7 @@ void shouldUseSelfAsForkedProcess() throws Exception { Mockito.when(dest.toAbsolutePath()).thenReturn(dest); Mockito.when(dest.toString()).thenReturn("/dest/somefile.tmp"); - generator.exec(recordingFile, dest, Duration.ofSeconds(10)); + generator.exec(recordingFile, dest); Mockito.verify(javaProcessBuilder).klazz(SubprocessReportGenerator.class); } @@ -184,7 +183,7 @@ void shouldSetJvmArgs() throws Exception { Mockito.when(dest.toAbsolutePath()).thenReturn(dest); Mockito.when(dest.toString()).thenReturn("/dest/somefile.tmp"); - generator.exec(recordingFile, dest, Duration.ofSeconds(10)); + generator.exec(recordingFile, dest); ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); Mockito.verify(javaProcessBuilder).jvmArgs(captor.capture()); @@ -205,7 +204,7 @@ void shouldSetProcessArgs() throws Exception { Mockito.when(dest.toAbsolutePath()).thenReturn(dest); Mockito.when(dest.toString()).thenReturn("/dest/somefile.tmp"); - generator.exec(recordingFile, dest, Duration.ofSeconds(10)); + generator.exec(recordingFile, dest); ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); Mockito.verify(javaProcessBuilder).processArgs(captor.capture()); @@ -219,12 +218,12 @@ void shouldExecuteProcessAndReturnPathOnOkExit() throws Exception { Path dest = Mockito.mock(Path.class); Mockito.when(dest.toAbsolutePath()).thenReturn(dest); Mockito.when(dest.toString()).thenReturn("/dest/somefile.tmp"); - Mockito.when(proc.waitFor(10_000, TimeUnit.MILLISECONDS)).thenReturn(true); + Mockito.when(proc.waitFor(5, TimeUnit.MINUTES)).thenReturn(true); Assertions.assertTimeoutPreemptively( Duration.ofSeconds(2), () -> { - Future path = generator.exec(recordingFile, dest, Duration.ofSeconds(10)); + Future path = generator.exec(recordingFile, dest); MatcherAssert.assertThat(path.get(), Matchers.sameInstance(dest)); }); } @@ -234,7 +233,7 @@ void shouldExecuteProcessAndThrowExceptionOnNonOkExit() throws Exception { Path dest = Mockito.mock(Path.class); Mockito.when(dest.toAbsolutePath()).thenReturn(dest); Mockito.when(dest.toString()).thenReturn("/dest/somefile.tmp"); - Mockito.when(proc.waitFor(10_000, TimeUnit.MILLISECONDS)).thenReturn(false); + Mockito.when(proc.waitFor(5, TimeUnit.MINUTES)).thenReturn(false); Mockito.when(proc.exitValue()) .thenReturn(SubprocessReportGenerator.ExitStatus.NO_SUCH_RECORDING.code); @@ -244,13 +243,7 @@ void shouldExecuteProcessAndThrowExceptionOnNonOkExit() throws Exception { ExecutionException ex = Assertions.assertThrows( ExecutionException.class, - () -> - generator - .exec( - recordingFile, - dest, - Duration.ofSeconds(10)) - .get()); + () -> generator.exec(recordingFile, dest).get()); MatcherAssert.assertThat( ex.getMessage(), Matchers.containsString( @@ -260,7 +253,7 @@ void shouldExecuteProcessAndThrowExceptionOnNonOkExit() throws Exception { @Test void shouldExecuteProcessAndDeleteRecordingOnCompletion() throws Exception { - Mockito.when(proc.waitFor(10_000, TimeUnit.MILLISECONDS)).thenReturn(true); + Mockito.when(proc.waitFor(5, TimeUnit.MINUTES)).thenReturn(true); Mockito.when(proc.exitValue()).thenReturn(SubprocessReportGenerator.ExitStatus.OK.code); Mockito.when(targetConnectionManager.executeConnectedTask(Mockito.any(), Mockito.any())) @@ -272,7 +265,7 @@ public Path answer(InvocationOnMock invocation) throws Throwable { } }); - Path result = generator.exec(recordingDescriptor, Duration.ofSeconds(10)).get(); + Path result = generator.exec(recordingDescriptor).get(); MatcherAssert.assertThat(result, Matchers.sameInstance(tempFile2)); Mockito.verify(fs).deleteIfExists(tempFile1); @@ -280,7 +273,7 @@ public Path answer(InvocationOnMock invocation) throws Throwable { @Test void shouldExecuteProcessAndDeleteRecordingOnFailure() throws Exception { - Mockito.when(proc.waitFor(10_000, TimeUnit.MILLISECONDS)).thenReturn(true); + Mockito.when(proc.waitFor(5, TimeUnit.MINUTES)).thenReturn(true); Mockito.when(proc.exitValue()) .thenReturn(SubprocessReportGenerator.ExitStatus.NO_SUCH_RECORDING.code); @@ -296,7 +289,7 @@ public Path answer(InvocationOnMock invocation) throws Throwable { Assertions.assertThrows( ExecutionException.class, () -> { - generator.exec(recordingDescriptor, Duration.ofSeconds(10)).get(); + generator.exec(recordingDescriptor).get(); }); Mockito.verify(fs).deleteIfExists(tempFile1);