Skip to content

chore(e2e): cleanup e2e framework#1268

Merged
manusa merged 2 commits into
containers:mainfrom
Cali0707:cleanup-e2e-framework-base
Jul 7, 2026
Merged

chore(e2e): cleanup e2e framework#1268
manusa merged 2 commits into
containers:mainfrom
Cali0707:cleanup-e2e-framework-base

Conversation

@Cali0707

@Cali0707 Cali0707 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Follow up on #1228

This addresses some final comments left by @manusa :

A few minor nits to fold in whenever you next touch this: _find_free_port has a TOCTOU race that'll flake once deployments run in parallel; _parse_image only handles the registry/repo:tag form (digests/registry-ports get mangled); config.pop("http") silently drops that section; and paths-ignore: '*.md' only matches top-level markdown.

Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Cali0707 requested a review from manusa as a code owner July 6, 2026 20:01
Send kubectl port-forward stdout to a temp file instead of an undrained
PIPE and poll it with a bounded deadline for the "Forwarding from" line.

kubectl writes "Handling connection for <port>" to stdout on every
forwarded connection, so the single readline() left the pipe undrained
for the life of the process; once the ~64 KB OS buffer fills kubectl
blocks on write and the forward stalls -- the exact deadlock the
stderr-to-file handling already avoids. The readline() was also an
unbounded blocking read that could hang the suite if kubectl wedged
during setup.

A temp file never blocks the writer and the 30s deadline bounds the
wait. Scanning the whole output also makes port parsing order-
independent on dual-stack hosts, and both stream files are closed on
teardown. Also wait() after every kill() so terminated port-forward
processes are reaped and returncode is populated in error messages.

Signed-off-by: Marc Nuri <marc@marcnuri.com>

@manusa manusa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

I also pushed a small fix directly to this branch (rather than a follow-up PR) to expedite merging, these are the changes (feel free to rollback if deemed unnecessary):

  • Port-forward stdout now goes to a temp file polled with a 30s deadline, instead of an undrained PIPE read with a single readline().
    kubectl port-forward writes Handling connection for to stdout on every connection, so the old approach could deadlock once the ~64 KB pipe buffer filled (and readline() could hang unbounded if kubectl wedged).
    It also makes local-port parsing dual-stack-safe.
  • proc.wait() after each kill() so the terminated port-forward is reaped (also fixes the "exit code None" diagnostic).

@manusa manusa added this to the 0.1.0 milestone Jul 7, 2026

@matzew matzew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@manusa
manusa merged commit 3d4a06d into containers:main Jul 7, 2026
12 checks passed
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.

3 participants