Skip to content

Throughput test: fail when the netem delay is missing - #182

Merged
compot-dev merged 2 commits into
masterfrom
throughput-netem-check
Nov 18, 2026
Merged

compot-dev merged 2 commits into
masterfrom
throughput-netem-check

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Follow-up to Qodo's finding on #181 ("The throughput test can pass without delay").

  • The container entrypoint no longer ignores a failed tc qdisc add: the container exits, and the test fails.
  • New check: the round trip through the tunnel must be at least twice DELAY_MS.

Tested locally in Docker:

  • Normal run passes (round trip 60.2 ms, TCP and UDP both ways).
  • When the test expects DELAY_MS=100 but only 30 ms is applied, the new check fails.

Test-only change, no release.

The container entrypoint ignored a failed 'tc qdisc add', so the test
could pass on a link without the delay it is meant to exercise. Now the
container exits if netem cannot be added, and the test checks that the
round trip through the tunnel is at least the two one-way delays.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fail throughput tests when the netem delay is missing

🐞 Bug fix 🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Exit test containers when netem cannot apply the configured link delay.
• Require the tunnel’s measured round trip to meet twice the configured one-way delay.
• Prevent throughput results from passing on an insufficiently delayed link.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • No production behavior changes identified.
Behavioral complexity 🟢 Low 🧩 Assessed behavior

  • No production behavior changes identified.
Potential damage 🟢 Low 🩹 Assessed behavior

  • No production behavior changes identified.
Assessed commit 3916d2f > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  A["Container entrypoint"] --> B{"Netem added?"} -->|yes| C["UDP tunnel ping"] --> D{"RTT sufficient?"} -->|yes| E["Throughput checks"] --> F["Test verdict"]
  B -->|no: exit| F
  D -->|no: fail| F
Loading
High-Level Assessment

Keep both checks: failing container startup catches tc errors, while the RTT assertion catches a link whose applied delay is lower than expected. Either check alone would leave one of those cases uncovered.

Files changed (1) +6 / -2

Tests (1) +6 / -2
test-e2e-throughput.shRequire the configured delay in throughput tests +6/-2

Require the configured delay in throughput tests

• The generated container entrypoint now exits if tc cannot add the netem delay. After the tunnel comes up, the test checks that its measured RTT is at least twice DELAY_MS and records a failure otherwise. A comment now describes the existing complete-transfer and minimum-rate requirement.

docker/test-e2e-throughput.sh

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Unreachable tunnel fails the run without a retry ✓ Resolved
Description
The new awk check reads rtt from a single ping -c 3 -q run made right after the tunnel
addresses appear, and an empty rtt becomes 0 and fails the check. Before this PR a ping failure
only left the round trip ? label in the output, but now it fails the whole throughput test if the
handshake or routes are not ready yet, even though the tunnel-up loop only waits for an address to
appear on each client.

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

…eads it (#182)

- test-e2e-throughput.sh: the round trip comes from a ping retried until the
  server answers (Qodo): the address appears before the session, and a
  first ping without a reply failed the delay check.
- test-e2e-nginx-map.sh: the 2 MB upload went to python's http.server, which
  answers 501 at once without reading the body; nginx, still sending it,
  then took the device for offline (503), now and then (CI on 3916d2f).
  The device's server (web.py) reads a POST to its end and answers with
  the byte count; the check wants all 2 MB and 200.
@compot-dev

Copy link
Copy Markdown
Collaborator Author

Handled in 40ec1e8:

  1. Unreachable tunnel fails the run without a retry: fixed as suggested. The ping is retried (up to 20 times, -W 2) until the server answers; the delay check itself is unchanged.

Also in 40ec1e8: the CI failure on 3916d2f was test-e2e-nginx-map.sh ("a 2 MB upload goes through nginx to the device (got 503)"), unrelated to this PR's change but flaky by design. The device was python's http.server, which answers 501 to a POST at once without reading the body; when nginx was still sending the 2 MB, it took the device for offline and served 503. The device's server (web.py in the test image) now reads the POST to its end and answers with the byte count; the check wants got 2097152 and 200.

Rerun locally in Docker: throughput passes (round trip 60.4 ms); nginx-map passes 3 times in a row.

/review

@compot-dev
compot-dev merged commit fb9367f into master Nov 18, 2026
18 checks passed
@compot-dev
compot-dev deleted the throughput-netem-check branch November 18, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant