Skip to content

taps.apps.configs.failures

FailureInjectionConfig

Bases: AppConfig

Failure injection configuration.

Parameters:

  • name (Literal[str], default: 'failures' ) –

    Application name.

  • base (str) –

    Base app to inject failures into.

  • config (Dict[str, Any], default: {} ) –

    Base app configuration.

  • failure_rate (float, default: 1 ) –

    Task failure rate.

  • failure_type (FailureType, default: <FailureType.DEPENDENCY: 'dependency'> ) –

    Task failure type.

get_app

get_app() -> App

Create an application instance from the config.

Source code in taps/apps/configs/failures.py
def get_app(self) -> App:
    """Create an application instance from the config."""
    from taps.apps.failures.app import FailureInjectionApp

    return FailureInjectionApp(
        base_config=self._get_app_config(),
        failure_rate=self.failure_rate,
        # Because use_enum_values=True, self.failure_type is actually
        # a string and we need to convert it back.
        failure_type=FailureType(self.failure_type),
    )