The fault injection logic (delays and failures) in StrimziFaultInjectionSourceConnector and StrimziFaultInjectionSourceTask is currently inline Thread.sleep() calls and if + throw blocks mixed in with regular lifecycle code. This makes it hard to quickly identify where faults are being injected. We should extract the fault injection logic into dedicated methods (e.g. maybeInjectDelay(), maybeInjectFailure()) so that all injection points are self-documenting and easy to find.
Main injection points are:
- StrimziFaultInjectionSourceConnector.start() - delay and failure
- StrimziFaultInjectionSourceConnector.stop() - delay
- StrimziFaultInjectionSourceTask.start() - delay and failure
- StrimziFaultInjectionSourceTask.stop() - delay
- StrimziFaultInjectionSourceTask.poll() - delay
The fault injection logic (delays and failures) in
StrimziFaultInjectionSourceConnectorandStrimziFaultInjectionSourceTaskis currently inlineThread.sleep()calls and if + throw blocks mixed in with regular lifecycle code. This makes it hard to quickly identify where faults are being injected. We should extract the fault injection logic into dedicated methods (e.g.maybeInjectDelay(),maybeInjectFailure()) so that all injection points are self-documenting and easy to find.Main injection points are: