Class FilibusterInvocationInterceptorHelpers
- java.lang.Object
-
- cloud.filibuster.junit.interceptors.FilibusterInvocationInterceptorHelpers
-
public class FilibusterInvocationInterceptorHelpers extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
conditionallyMarkTeardownComplete(java.util.Map<java.lang.Integer,java.lang.Boolean> invocationCompletionMap, int currentIteration, com.linecorp.armeria.client.WebClient webClient)
Conditionally mark the teardown for a given test iteration complete.static void
proceedAndLogException(FilibusterInvocationInterceptor filibusterInvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void> invocation, int currentIteration, com.linecorp.armeria.client.WebClient webClient, FilibusterConfiguration filibusterConfiguration)
static void
proceedAndLogException(FilibusterInvocationInterceptor filibusterInvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void> invocation, int currentIteration, com.linecorp.armeria.client.WebClient webClient, FilibusterConfiguration filibusterConfiguration, boolean shouldWritePlaceholder, boolean shouldPrintRpcSummary)
static boolean
shouldBypassExecution(com.linecorp.armeria.client.WebClient webClient, int currentIteration, java.lang.String caller, boolean abortOnFirstFailure, boolean previousExecutionFailed)
-
-
-
Method Detail
-
shouldBypassExecution
public static boolean shouldBypassExecution(com.linecorp.armeria.client.WebClient webClient, int currentIteration, java.lang.String caller, boolean abortOnFirstFailure, boolean previousExecutionFailed)
-
proceedAndLogException
public static void proceedAndLogException(FilibusterInvocationInterceptor filibusterInvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void> invocation, int currentIteration, com.linecorp.armeria.client.WebClient webClient, FilibusterConfiguration filibusterConfiguration) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
proceedAndLogException
public static void proceedAndLogException(FilibusterInvocationInterceptor filibusterInvocationInterceptor, org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void> invocation, int currentIteration, com.linecorp.armeria.client.WebClient webClient, FilibusterConfiguration filibusterConfiguration, boolean shouldWritePlaceholder, boolean shouldPrintRpcSummary) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
conditionallyMarkTeardownComplete
public static void conditionallyMarkTeardownComplete(java.util.Map<java.lang.Integer,java.lang.Boolean> invocationCompletionMap, int currentIteration, com.linecorp.armeria.client.WebClient webClient)
Conditionally mark the teardown for a given test iteration complete.There is a significant amount of nuance in this function. The Filibuster server needs to know when a particular test iteration is done and all the teardown is complete. This is non-trivial because test functions might contain and arbitrary number of afterEach methods (or, none at all.) Therefore, the only way to ensure that we capture this is to do the following.
First, instrument the beforeEach and the testTemplate method. Record a boolean in a map to indicate that the previous test is complete when we reach the start of a new test. However, some tests might have a beforeEach executed in the first iteration, therefore, we also need to prevent notifying the server on the first iteration (iteration 0, the start of the first actual test.)
- Parameters:
invocationCompletionMap
- tracks the invocations that have completed and all teardowns have finished.currentIteration
- the iteration we are currently in, not the iteration that's been completed (current - 1).webClient
- a web client to use to talk to the Filibuster Server.
-
-