Annotation Type TestWithFilibuster
-
@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=STABLE, since="5.0") @ExtendWith(FilibusterTestExtension.class) @TestTemplate public @interface TestWithFilibusterFilibuster test annotation for JUnit 5.This annotation can be used to automatically enable a JUnit5 test, annotated with a
Testannotation for use with Filibuster.Performs the following lifecycle operations:
- Start the Filibuster server process (using the Filibuster Python server.)
- Communicate with the server to provide conditional assertions and test generation automatically with JUnit.
- Terminate the Filibuster server after execution of the test.
-
-
Field Summary
Fields Modifier and Type Fields Description static java.lang.StringCURRENT_ITERATION_PLACEHOLDERPlaceholder variable for current iteration.static java.lang.StringDISPLAY_NAME_PLACEHOLDERPlaceholder variable for the test name.static java.lang.StringINITIAL_SHORT_DISPLAY_NAMEPlaceholder name used for the initial generated test.static java.lang.StringSHORT_DISPLAY_NAMEPlaceholder name used for generated tests.static java.lang.StringTOTAL_ITERATIONS_PLACEHOLDERPlaceholder variable for total (max) iterations.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanabortOnFirstFailureShould we abort on first failure?java.lang.Class<? extends FilibusterAnalysisConfigurationFile>analysisConfigurationFileAnalysis configuration file for Filibuster.java.lang.StringanalysisFileAnalysis file that should be used for this configuration of Filibuster.java.lang.StringanalysisResourceFileAnalysis resource file that should be used for this configuration of Filibuster.booleanavoidInjectionsOnOrganicFailuresShould we avoid fault injections where RPCs have failed without fault injection?booleanavoidRedundantInjectionsShould we avoid redundant fault injections?booleandataNondeterminismDoes this test configuration contain data nondeterminism?booleandegradeWhenServerInitializationFailsIf the Filibuster server is unavailable, should the system degrade to just running fault-free tests?java.lang.StringdockerImageNameDocker image to use for the Docker server backend.booleandynamicReductionShould this configuration use dynamic reduction?java.lang.Class<? extends java.lang.Throwable>expectedWhether we expect this all generated tests to throw this exception.booleanfailIfFaultInjectionMismatchFail the test if the fault at the callsite was not the fault that was injected.booleanfailIfFaultNotInjectedFail the test if a fault is not injected.booleanfailIfFaultNotInjectedAndATrackedMethodIsInvokedFail the test if a fault is not injected and a tracked method is invoked.booleanfailOnOrganicFailuresShould we fail the test when RPCs have failed without fault injection?java.lang.Class<? extends FilibusterFaultInjectionFilter>faultInjectionFilterFault injection filter.java.lang.StringinitialNameName of the generated test.java.lang.Class<? extends FilibusterLatencyProfile>latencyProfileLatency profile for the execution.intmaxIterationsMaximum number of tests that will be run by Filibuster.java.lang.StringnameName of the generated test.FilibusterSearchStrategysearchStrategyWhich search strategy should Filibuster use?java.lang.Class<? extends FilibusterServerBackend>serverBackendServer backend to use for Filibuster.ServiceProfileBehaviorserviceProfileBehaviorHow service profiles should be used.java.lang.StringserviceProfilesPathDirectory containing service profiles.booleansuppressCombinationsShould this configuration avoid exploring combinations of faults?
-
-
-
-
maxIterations
int maxIterations
Maximum number of tests that will be run by Filibuster.JUnit5 doesn't allow for the dynamic generation of tests as tests are executed: the stream of test executions must be materialized before execution starts. Therefore, set an upper bound on the number of tests that will be run.
Details:
- Test execution 1 always runs: this is the fault-free execution.
- Test execution n conditionally runs, if necessary, based on communication with Filibuster server. It will conditionally invoke the beforeEach/afterEach *only* if the test is necessary.
- Test execution (maxIteration + 1) runs to perform finalization of the test process, but bypasses beforeEach/afterEach, and test body. Therefore, it appears to run, is shown as a test in IntelliJ, but doesn't execute the test.
Caveats:
- If maxIteration is not set large enough, Filibuster will fail to explore the entire failure space.
- Returns:
- upper bound on possible Filibuster tests that will be run.
- Default:
- 99
-
-
-
dynamicReduction
boolean dynamicReduction
Should this configuration use dynamic reduction?Dynamic reduction incurs overhead and is useless unless testing graphs where depth greater than 2 will be explored. This probably is not the case for most functional tests that use mocks, stubs, or similar and is only useful when standing up deep graphs of multiple services.
- Returns:
- whether dynamic reduction should be used.
- Default:
- false
-
-
-
dataNondeterminism
boolean dataNondeterminism
Does this test configuration contain data nondeterminism?Specifically, this only refers to whether the RPC messages can be affected across executions from data nondeterminism.
Use of this option prevents optimizations for dealing with scheduling nondeterminism, as accounting for data nondeterminism effectively prevents dealing with scheduling nondeterminism by omitting invocation details specific to a particular invocation of an RPC.
For reference:
- Data nondeterminism: use of timestamps, unique identifiers that differ each time the test is run.
- Scheduling nondeterminism: loops that issue multiple RPCs to the same RPC method on the same service that differ only by message contents.
- Returns:
- whether data nondeterminism is present in the test.
- Default:
- false
-
-
-
avoidRedundantInjections
boolean avoidRedundantInjections
Should we avoid redundant fault injections?If so, repeated execution of the same RPC method with the same RPC arguments will be skipped for fault injection.
Option will still show RPCs as redundant in the UX, to avoid set the system property instead.
- Returns:
- whether we should avoid redundant injections
- Default:
- false
-
-
-
analysisFile
java.lang.String analysisFile
Analysis file that should be used for this configuration of Filibuster.When supplied,
analysisConfigurationFile()is ignored.When not specified, a default analysis file will be generated to test common faults for Google's gRPC. (i.e., DEADLINE_EXCEEDED, UNAVAILABLE)
- Returns:
- absolute path of the analysis file to use.
- Default:
- ""
-
-
-
analysisResourceFile
java.lang.String analysisResourceFile
Analysis resource file that should be used for this configuration of Filibuster.When supplied,
analysisConfigurationFile()andanalysisFile()is ignored.When not specified, a default analysis file will be generated to test common faults for Google's gRPC. (i.e., DEADLINE_EXCEEDED, UNAVAILABLE)
- Returns:
- absolute path of the analysis file to use.
- Default:
- ""
-
-
-
analysisConfigurationFile
java.lang.Class<? extends FilibusterAnalysisConfigurationFile> analysisConfigurationFile
Analysis configuration file for Filibuster.Will be written out to a file and supplied as a command line argument to the Filibuster server.
When supplied, will be used to override the default analysis. When
analysisFile()used, it is ignored.- Returns:
- custom analysis configuration file.
- Default:
- cloud.filibuster.junit.configuration.examples.FilibusterDefaultAnalysisConfigurationFile.class
-
-
-
serverBackend
java.lang.Class<? extends FilibusterServerBackend> serverBackend
Server backend to use for Filibuster.- Returns:
- server backend module.
- Default:
- cloud.filibuster.junit.server.backends.FilibusterLocalServerBackend.class
-
-
-
searchStrategy
FilibusterSearchStrategy searchStrategy
Which search strategy should Filibuster use?- Returns:
- search strategy
- Default:
- cloud.filibuster.junit.FilibusterSearchStrategy.DEFAULT
-
-
-
latencyProfile
java.lang.Class<? extends FilibusterLatencyProfile> latencyProfile
Latency profile for the execution.- Returns:
- latency profile implementing class.
- Default:
- cloud.filibuster.junit.server.latency.FilibusterNoLatencyProfile.class
-
-
-
serviceProfileBehavior
ServiceProfileBehavior serviceProfileBehavior
How service profiles should be used.- Returns:
- service profile behavior
- Default:
- cloud.filibuster.junit.server.core.profiles.ServiceProfileBehavior.NONE
-
-
-
faultInjectionFilter
java.lang.Class<? extends FilibusterFaultInjectionFilter> faultInjectionFilter
Fault injection filter.- Returns:
- filter
- Default:
- cloud.filibuster.junit.filters.NoopFilter.class
-
-