Allow Running vmm
Unittests in Parallel
#4709
Labels
Good first issue
Indicates a good issue for first-time contributors
Priority: Low
Indicates that an issue or pull request should be resolved behind issues or pull requests labelled `
Status: Parked
Indicates that an issues or pull request will be revisited later
Currently, the unittests in the
vmm
package have to be run sequentially due to reliance on global state in some virtio device tests. More specifically, various tests in thevsock
andrng
modules use a globalMETRICS
object (see also #2899). This design using a global METRICS object is fine for production, because a VMM can have at most one vsock and rng device each, however multiple unit tests running in parallel can create multiple device objects, which then simultaneously update the global metrics. Since our tests contain assertions on the value of the metrics to validate functionality, this causes spurious failures.We can fix this by moving the vsock and rng device to a "per device metrics" model, as already adopted by net and block devices (see for example #4145).
As part of this issue, 3 things will need to be done
test_tap_name
test to no longer use a hardcoded value oftap0
(if multiple tests run in parallel and create tap devices, it is no longer guaranteed that the tap device created in this test will be called "tap0", it could be "tap1" or "tap43". Thus we probably just want some sort of regex match on the tap device name).These can all be addressed in individual PRs, or all in one, depending on how much of a task you want to tackle :)
The text was updated successfully, but these errors were encountered: