mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 09:13:01 +02:00
Due to the salting being applied to Python's `hash()` (see [1]), the hash of an object is not stable across different Python processes. As a result, neither are the topology mappings generated by networkx. The upside of this is randomness that we get better test coverage over time, especially on physical devices where the underlying hardware could differ between ports, for example. On the other hand, it can be very frustrating to track down a bug when locial nodes are suffled around between phyical nodes on each invocation of a test case. Therefore, use a random seed by default, but allow the user to specify a fixed value if they so choose. We then add a meta test that logs the seed being used for the current suite - which means we can simply copy&paste that value to rerun the suite (or single test) with the same topology mappings. [1]: https://docs.python.org/3/reference/datamodel.html#object.__hash__