Use dynamic host ports in the E2E runner

Open
#2,395 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, rust
Domain
backend, devops

Research direction

Start with src/console/ci/e2e/runner.rs and the qBittorrent E2E runner's existing dynamic-port handling; the issue names both as reference points. Add unit tests for TCP/UDP port discovery and address translation, then run the E2E tests, including two concurrent runs. Done means the checker uses discovered host addresses and docs/self-hosted-runner.md no longer lists fixed host ports as a concurrency limit.

Written by the indexing model from the issue text.

Description

task Testing

Parent EPIC: #2392

Goal

Two e2e_tests_runner executions can run at the same time on one Docker host without colliding on host ports. The runner lets Docker choose free host ports and discovers them, instead of publishing fixed host ports.

Background

src/console/ci/e2e/runner.rs publishes fixed host ports 6969:6969/udp, 7070:7070/tcp, 1212:1212/tcp, and 1313:1313/tcp, parses the tracker's startup log for service addresses, and passes them to the tracker checker. This works only because host and container ports are identical; a second run on the same host cannot publish the ports. The runner already notes this in a code-review comment, and #2386 lists it as a reason for one runner instance per server.

Container names are already random, and the qBittorrent E2E runner already publishes host port 0 and reads the assigned port with docker compose port.

Tasks

  • T1: Reproduce the conflict with two concurrent runs.
  • T2: Add docker port discovery (TCP and UDP) with unit tests.
  • T3: Translate parsed container addresses to host addresses, with unit tests.
  • T4: Publish container ports only and run the checker on discovered host addresses.
  • T5: Verify two concurrent runs pass; remove fixed host ports from the concurrency limits in docs/self-hosted-runner.md.

Out of scope: the shared image tag (sibling subissue), the qBittorrent E2E runner, the shared Cargo target directory.

The full specification is added to docs/issues/open/ by a spec-only pull request.

Dominant language
Rust
Stars
532
Forks
56
Avg merge
11h 20m
Merged PRs (30d)
282

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from torrust/torrust-tracker

All issues in torrust/torrust-tracker

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.