Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Running vmm Unittests in Parallel #4709

Open
3 tasks
roypat opened this issue Jul 29, 2024 · 1 comment
Open
3 tasks

Allow Running vmm Unittests in Parallel #4709

roypat opened this issue Jul 29, 2024 · 1 comment
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

Comments

@roypat
Copy link
Contributor

roypat commented Jul 29, 2024

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 the vsock and rng modules use a global METRICS 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

  • Update the vsock device to use a "per device metrics" model
  • Update the rng device to use a "per device metrics" model
  • Fix the test_tap_name test to no longer use a hardcoded value of tap0 (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 :)

@roypat roypat added Good first issue Indicates a good issue for first-time contributors Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Status: Parked Indicates that an issues or pull request will be revisited later labels Jul 29, 2024
@roypat roypat changed the title Allow Running vmm unittests in parallel Allow Running vmm Unittests in Parallel Jul 29, 2024
@jackabald
Copy link
Contributor

@roypat

I can try to look at this. Will send PR if I get anywhere.

Thanks!

@ShadowCurse ShadowCurse added Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` and removed Priority: Medium Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants