random_fail
Randomly fail pipeline runs for testing purposes
File |
utility/random_fail/random_fail.py |
Attribution |
CosmoSIS Team |
URL |
This utility module randomly fails pipeline runs with a specified probability. This is useful for testing the robustness of sampling algorithms and pipeline error handling.
The module generates a random number and compares it to the specified failure fraction. If the random number is below the threshold, the module returns an error code causing the pipeline to fail.
Assumptions
Used for testing pipeline robustness
Setup Parameters
Name |
Type |
Default |
Description |
|---|---|---|---|
fraction |
real |
0.1 |
Probability of random failure (0.0 = never fail, 1.0 = always fail) |
seed |
int |
6789 |
Random seed for reproducible failure patterns |
verbose |
bool |
False |
Whether to print when randomly failing |
Input values
None
Output values
None