mrob95 / Breathe

High-level API for creating dragonfly grammars
GNU Lesser General Public License v3.0
13 stars 8 forks source link

Potential Flaky Test fix. #10

Closed Jiaming1999 closed 3 years ago

Jiaming1999 commented 3 years ago

The result is genearted by: pytest flakefinder: https://github.com/dropbox/pytest-flakefinder The fix is aiming at test_loading.py, several flaky tests detected due to Breathe module pollution. (Order dependent) My fix: calling test_clear() in loading_failure to prevent pollution. Original report:(partial)

>       assert len(Breathe.modules) == 1
E       AssertionError: assert 50 == 1
E        +  where 50 = len(['tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', ...])
E        +    where ['tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', 'tests.my_grammar.fruit', ...] = Master(Merger).modules

test_loading.py:72: AssertionError

After fixing: passed normal pytest runs, 200 runs of flake-finder by default and 4000 runs of flake-finder