Skip to content

test: a real round trip in the tunnel e2e (#281) - #283

Merged
compot-dev merged 1 commit into
v2from
test/e2e-rtt-281
Nov 18, 2026
Merged

compot-dev merged 1 commit into
v2from
test/e2e-rtt-281

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #281.

tests/e2e.sh puts a netem delay on the links of the emulator, the hub and the Linux edge: DELAY_MS each way, default 30 ms, so 60 ms between the box and the hub (as camex's docker/test-e2e-throughput.sh); DELAY_MS=0 turns it off. compot/cross has no tc, so it comes from a small image of its own: tests/netem/Dockerfile (alpine:3.22 + iproute2), built as decoder-netem on the first run and cached; NETEM_IMAGE overrides it. The emulator's own -netdelay was tried first and had no effect.

With the delay the video rate check (100 KB/s or more through tun0) tells the camex versions apart. docs/testing.md describes the delay. Tests and docs only: no version bump.

Tests (local, Docker; the ping through the tunnel to the edge shows ~121 ms):

camex run result video through the tunnel
4.0.0 TRANSPORT=TCP tests/e2e.sh 34 15 passed, 1 failed 14 KB/s
4.0.1 TRANSPORT=TCP tests/e2e.sh 34 16 passed 974 KB/s
4.0.1 TRANSPORT=TCP tests/e2e.sh 21 16 passed 895 KB/s
4.0.1 tests/e2e.sh 34 (UDP) 15 passed 896 KB/s

tests/e2e.sh puts a netem delay of DELAY_MS (default 30 ms each way) on the
links of the emulator, the hub and the Linux edge: 60 ms between the box and
the hub, as camex's throughput test. tc comes from a small image of its own
(tests/netem, decoder-netem, built on the first run).

With the delay the video rate check tells the camex versions apart: camex
4.0.0 over TCP got 14 KB/s and failed, 4.0.1 passes (974 KB/s on API 34).

Closes #281
@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

Add realistic network delay to tunnel end-to-end tests

🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Add configurable link delay so tunnel tests exercise a realistic round trip.
• Make the existing video-rate check detect slow TCP tunnel regressions.
• Provide a cached tc image and document the new test setting.
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 6486945 > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  S["E2E script"] --> N["Netem image"] --> E["Android emulator"]
  C["RTSP camera"] --> P["Linux edge"] --> H["Camex hub"] --> E --> R["Video rate check"]
  N --> P
  N --> H
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Add tc to the existing test images
  • ➕ Avoids building and running a separate helper image.
  • ➖ Requires maintaining networking tools in images used for other purposes.
2. Configure netem from the Docker host
  • ➕ Avoids a helper image.
  • ➖ Depends on host-installed tc and access to container network namespaces.

Recommendation: Keep the dedicated netem image: it supplies the missing tool without changing existing images or imposing host tooling requirements. The emulator's built-in delay was also tried and reportedly had no effect.

Files changed (3) +25 / -4

Tests (2) +24 / -3
e2e.shApply configurable netem delay across the test network +20/-3

Apply configurable netem delay across the test network

• Adds 'DELAY_MS' and 'NETEM_IMAGE', builds the helper image when needed, and applies egress delay in the emulator, hub, and edge network namespaces. Updates test output and comments to describe the resulting round trip and video-rate check.

tests/e2e.sh

DockerfileProvide a small image containing tc +4/-0

Provide a small image containing tc

• Adds an Alpine-based image with iproute2 so the test can configure netem without changing its existing container images.

tests/netem/Dockerfile

Documentation (1) +1 / -1
testing.mdDocument delayed tunnel end-to-end tests +1/-1

Document delayed tunnel end-to-end tests

• Explains the default link delay, its helper image, and why realistic latency makes the video-rate check useful for detecting slow TCP tunnels.

docs/testing.md

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

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

@compot-dev
compot-dev merged commit 00a8f09 into v2 Nov 18, 2026
7 checks passed
@compot-dev
compot-dev deleted the test/e2e-rtt-281 branch November 18, 2026 06:43
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.

e2e: a real round trip in the tunnel test (catch camex#180-like TCP stalls)

1 participant