The current implementation of RandomBug is not well done. For instance, the "STRICT" mode does not work.
As we are using pytest, we should create a plugin that does this one thing the right way.
The annotation could be:
@pytest.mark.random('Reason, ticket, ... ', **kwargs) def test_foo(): pass
Where possible arguments are:
- condition (bool): the condition to use the random, if False run the test normally. Default is True.
- repeat (int): how many times should we repeat the test. Default is 10.
- mode (str):
- "RELAX": will retry as repeat times until it succeeds. Default value.
- "STRICT": will repeat it until it fails or hits the repeat limit.
- "BYPASS": skip the test.
Also, it should be possible to set the mode from the envar RANDOM_BUG_MODE.
- is related to
-
NXDRIVE-1246 Fix pytest randombug plugin STRICT mode
- Resolved
- is required by
-
NXDRIVE-764 Refactor the tests suite to speed up execution
- Resolved
-
NXDRIVE-808 Fix Random Bugs
- Resolved