Package org.apache.solr.util
Class TestInjection
- java.lang.Object
-
- org.apache.solr.util.TestInjection
-
public class TestInjection extends Object
Allows random faults to be injected in running code during test runs.Set static strings to "true" or "false" or "true:60" for true 60% of the time.
All methods are No-Ops unless
LuceneTestCase
is loadable via the ClassLoader used to load this class.LuceneTestCase.random()
is used as the source of all entropy.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TestInjection.Hook
static class
TestInjection.TestShutdownFailError
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TestInjection()
-
Method Summary
-
-
-
Field Detail
-
nonGracefullClose
public static volatile String nonGracefullClose
-
failReplicaRequests
public static volatile String failReplicaRequests
-
failUpdateRequests
public static volatile String failUpdateRequests
-
leaderTragedy
public static volatile String leaderTragedy
-
nonExistentCoreExceptionAfterUnload
public static volatile String nonExistentCoreExceptionAfterUnload
-
updateLogReplayRandomPause
public static volatile String updateLogReplayRandomPause
-
updateRandomPause
public static volatile String updateRandomPause
-
prepRecoveryOpPauseForever
public static volatile String prepRecoveryOpPauseForever
-
randomDelayInCoreCreation
public static volatile String randomDelayInCoreCreation
-
randomDelayMaxInCoreCreationInSec
public static volatile int randomDelayMaxInCoreCreationInSec
-
splitFailureBeforeReplicaCreation
public static volatile String splitFailureBeforeReplicaCreation
-
splitFailureAfterReplicaCreation
public static volatile String splitFailureAfterReplicaCreation
-
splitLatch
public static volatile CountDownLatch splitLatch
-
directUpdateLatch
public static volatile CountDownLatch directUpdateLatch
-
reindexLatch
public static volatile CountDownLatch reindexLatch
-
reindexFailure
public static volatile String reindexFailure
-
failIndexFingerprintRequests
public static volatile String failIndexFingerprintRequests
-
wrongIndexFingerprint
public static volatile String wrongIndexFingerprint
-
delayBeforeFollowerCommitRefresh
public static volatile Integer delayBeforeFollowerCommitRefresh
-
delayInExecutePlanAction
public static volatile Integer delayInExecutePlanAction
-
delayBeforeCreatingNewDocSet
public static volatile Integer delayBeforeCreatingNewDocSet
-
countDocSetDelays
public static volatile AtomicInteger countDocSetDelays
-
queryTimeout
public static volatile org.apache.lucene.index.QueryTimeout queryTimeout
-
failInExecutePlanAction
public static volatile boolean failInExecutePlanAction
-
skipIndexWriterCommitOnClose
public static volatile boolean skipIndexWriterCommitOnClose
Defaults tofalse
, If set totrue
, theninjectSkipIndexWriterCommitOnClose(java.lang.Object)
will returntrue
-
uifOutOfMemoryError
public static volatile boolean uifOutOfMemoryError
-
-
Method Detail
-
notifyPauseForeverDone
public static void notifyPauseForeverDone()
-
reset
public static void reset()
-
injectWrongIndexFingerprint
public static boolean injectWrongIndexFingerprint()
-
injectFailIndexFingerprintRequests
public static boolean injectFailIndexFingerprintRequests()
-
injectRandomDelayInCoreCreation
public static boolean injectRandomDelayInCoreCreation()
-
injectNonGracefullClose
public static boolean injectNonGracefullClose(CoreContainer cc)
-
injectSkipIndexWriterCommitOnClose
public static boolean injectSkipIndexWriterCommitOnClose(Object indexWriter)
Returns the value ofskipIndexWriterCommitOnClose
.- Parameters:
indexWriter
- used only for logging- See Also:
skipIndexWriterCommitOnClose
,DirectUpdateHandler2.closeWriter(org.apache.lucene.index.IndexWriter)
-
injectFailReplicaRequests
public static boolean injectFailReplicaRequests()
-
injectFailUpdateRequests
public static boolean injectFailUpdateRequests()
-
injectLeaderTragedy
public static boolean injectLeaderTragedy(SolrCore core)
-
injectNonExistentCoreExceptionAfterUnload
public static boolean injectNonExistentCoreExceptionAfterUnload(String cname)
-
injectUpdateLogReplayRandomPause
public static boolean injectUpdateLogReplayRandomPause()
-
injectUpdateRandomPause
public static boolean injectUpdateRandomPause()
-
injectPrepRecoveryOpPauseForever
public static boolean injectPrepRecoveryOpPauseForever()
-
injectSplitFailureBeforeReplicaCreation
public static boolean injectSplitFailureBeforeReplicaCreation()
-
injectSplitFailureAfterReplicaCreation
public static boolean injectSplitFailureAfterReplicaCreation()
-
injectSplitLatch
public static boolean injectSplitLatch()
-
injectDirectUpdateLatch
public static boolean injectDirectUpdateLatch()
-
injectReindexFailure
public static boolean injectReindexFailure()
-
injectReindexLatch
public static boolean injectReindexLatch()
-
injectDelayBeforeFollowerCommitRefresh
public static boolean injectDelayBeforeFollowerCommitRefresh()
-
injectUIFOutOfMemoryError
public static boolean injectUIFOutOfMemoryError()
-
injectDocSetDelay
public static boolean injectDocSetDelay(Object query)
-
newSearcherHook
public static boolean newSearcherHook(TestInjection.Hook hook)
-
injectSearcherHooks
public static boolean injectSearcherHooks(String collectionName)
-
-