-
Couldn't load subscription status.
- Fork 53
Description
Some time ago I added custom_topology support for libpdb.sanitize - 5dbeca5
The way it was implemented was by extending the global _to_keep:
haddock3/src/haddock/libs/libpdb.py
Lines 112 to 113 in daffcae
| # Get list of supported residues to keep when pre-processing | |
| _to_keep = list(supported_residues) |
haddock3/src/haddock/libs/libpdb.py
Lines 172 to 174 in daffcae
| if custom_topology: | |
| custom_res_to_keep = get_supported_residues(custom_topology) | |
| _to_keep.extend(custom_res_to_keep) |
While this is not an issue for normal execution, it introduces an edge case in testing in which the order of the tests can affect this global variable and thus cause tests to fail.
Say we have a Test A which uses this list and Test B which has a side-effect of extending this global list:
Case 1:
Test A: Pass
Test B: Pass (extend the global)
=== Pass
Case 2:
Test B: Pass (extend the global)
Test A: Fail
=== Fail
Found it when debugging #1412 which was showing flaky tests and luckily this was identified because we added random order to the tests (f55ce6e)