On a machine with lots of CPUs, it's is very possible to generate port collision by simply running to many tests. The port computation will wrap up and collide with a test which is still running. To avoid this, we change to strategy to use port skips by range depending on the CPU count.
While at it, I also removed the global and renamed it for clarity, wrapping it into a class to make mypy happy (function attributes are not supported but class attributes are).
Details
Details
- Reviewers
roqqit PiRK - Group Reviewers
Restricted Project - Commits
- rABC87480fe74d5d: Better port collision management for the functional tests
On a 32 core machine:
./test/functional/test_runner.py
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
test/functional/test_framework/util.py | ||
---|---|---|
336 ↗ | (On Diff #52628) | That a python 3.10 union syntax https://peps.python.org/pep-0604/ |
378 ↗ | (On Diff #52628) | but as of python 3.9 you can now use dict[PortName, int] https://peps.python.org/pep-0585/ |