Skip to content

Conversation

ShadowCurse
Copy link
Contributor

Changes

  • Simplify some logic in the rate limit tests.
  • Don't reuse iperf servers on the host or guest for mutliple tests. Run iperf with -1 flag.

Reason

There is an intermittent issue with guest iperf server becoming unresponsive. Attempt to fix it with using a fresh server for each test.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

@ShadowCurse ShadowCurse force-pushed the rate_limit_test_refactor branch from 76f6eeb to edd28fe Compare September 12, 2025 17:13
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.68%. Comparing base (46dee82) to head (1774e40).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5440   +/-   ##
=======================================
  Coverage   82.68%   82.68%           
=======================================
  Files         263      263           
  Lines       27478    27478           
=======================================
  Hits        22719    22719           
  Misses       4759     4759           
Flag Coverage Δ
5.10-m5n.metal 82.85% <ø> (ø)
5.10-m6a.metal 82.10% <ø> (+<0.01%) ⬆️
5.10-m6g.metal 79.47% <ø> (ø)
5.10-m6i.metal 82.85% <ø> (+<0.01%) ⬆️
5.10-m7a.metal-48xl 82.10% <ø> (ø)
5.10-m7g.metal 79.47% <ø> (ø)
5.10-m7i.metal-24xl 82.82% <ø> (ø)
5.10-m7i.metal-48xl 82.82% <ø> (+<0.01%) ⬆️
5.10-m8g.metal-24xl 79.46% <ø> (ø)
5.10-m8g.metal-48xl 79.47% <ø> (+<0.01%) ⬆️
6.1-m5n.metal 82.89% <ø> (+<0.01%) ⬆️
6.1-m6a.metal 82.14% <ø> (ø)
6.1-m6g.metal 79.46% <ø> (ø)
6.1-m6i.metal 82.88% <ø> (ø)
6.1-m7a.metal-48xl 82.13% <ø> (ø)
6.1-m7g.metal 79.46% <ø> (-0.01%) ⬇️
6.1-m7i.metal-24xl 82.89% <ø> (ø)
6.1-m7i.metal-48xl 82.89% <ø> (+<0.01%) ⬆️
6.1-m8g.metal-24xl 79.46% <ø> (ø)
6.1-m8g.metal-48xl 79.47% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ShadowCurse ShadowCurse force-pushed the rate_limit_test_refactor branch 2 times, most recently from 1e26883 to f89465f Compare September 15, 2025 10:52
Don't ask how it got that bad.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
There is no reason to do a single retry with specific time
multiplier. If retry is indeed is needed it can be implemented
with a simple loop inside or outside the function.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Don't reuse iperf in the guest for RX tests since
it was causing intermittent issues.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
With shorter name we can inline some functions in the next commit.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
The function is too small, so inline it.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
The duration was always the same, so no need to have it as an argument.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
The function is too small, so inline it.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
The duration was always the same, so no need to have it as an argument.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Similar to the RX tests, in TX tests we can just use
one shot servers on the host. This should prevent any
instability with host iperf caused by reuse.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
@ShadowCurse ShadowCurse force-pushed the rate_limit_test_refactor branch from f89465f to 90c31c3 Compare September 15, 2025 10:52
@ShadowCurse ShadowCurse marked this pull request as ready for review September 15, 2025 11:11
@ShadowCurse ShadowCurse self-assigned this Sep 15, 2025
@ShadowCurse ShadowCurse added Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests Type: Fix Indicates a fix to existing code labels Sep 15, 2025
roypat
roypat previously approved these changes Sep 15, 2025
Give a function more correct name and stop multiplying
resulting value by 100.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
@ShadowCurse ShadowCurse force-pushed the rate_limit_test_refactor branch from c6ea143 to dfd5113 Compare September 15, 2025 17:34
@roypat roypat merged commit 81c698a into firecracker-microvm:main Sep 16, 2025
7 checks passed
@ShadowCurse ShadowCurse deleted the rate_limit_test_refactor branch September 16, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests Type: Fix Indicates a fix to existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants