Skip to content

e2e: use a port-forward per router CONNECT tunnel - #3051

Merged
Haven Xia (HavenXia) merged 2 commits into
agent-substrate:mainfrom
BenTheElder:e2e-connect-portforward-per-conn
Oct 22, 2026
Merged

Haven Xia (HavenXia) merged 2 commits into
agent-substrate:mainfrom
BenTheElder:e2e-connect-portforward-per-conn

Conversation

@BenTheElder

Copy link
Copy Markdown
Collaborator

TestActorArbitraryPortAccess has been flaking in e2e since the router moved to static-mtls in #2390, e.g. https://github.com/agent-substrate/substrate/actions/runs/39549120410/job/119054007125

client-go closes the whole port-forward when any one connection on it errors:
https://github.com/kubernetes/client-go/blob/v0.37.0/tools/portforward/portforward.go#L549-L550

RouterClient shared one CONNECT port-forward for the life of the client. So one reset from the router failed the tunnel in flight and every Connect after it, which then got "connection refused" from the dead local port. #2961 fixed the same thing in ingressauth by forwarding per attempt.

Why is this needed? (Or link the issue. Open one first for features, API, install or CI changes.)

Fixes a trivial test flake bug, test only change. Spotted while reviewing PRs like #2502

AI use: AI-assisted, I reviewed it.

  • Tests pass
  • Docs updated

@dims Davanum Srinivas (dims) 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

@dberkov
Dmitry Berkovich (dberkov) added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@BenTheElder
Benjamin Elder (BenTheElder) added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@BenTheElder

Copy link
Copy Markdown
Collaborator Author

build started failing in the queue? must be a logical conflict in main, looking

client-go closes the whole port-forward when any connection on it errors, so a reset on one tunnel broke every Connect after it
@dims

Copy link
Copy Markdown
Collaborator

Benjamin Elder (@BenTheElder) build failure, you will see it if you rebase.

# go.ate.dev/substrate/internal/e2e
internal/e2e/router_client.go:127:14: c.ensureConnectPortForward undefined (type *RouterClient has no field or method ensureConnectPortForward)
internal/e2e/router_client.go:130:11: c.connectAddr undefined (type *RouterClient has no field or method connectAddr)

@BenTheElder

Copy link
Copy Markdown
Collaborator Author

should be fixed

@HavenXia
Haven Xia (HavenXia) added this pull request to the merge queue Oct 22, 2026
Merged via the queue into agent-substrate:main with commit ddbf83a Oct 22, 2026
15 checks passed
@BenTheElder
Benjamin Elder (BenTheElder) deleted the e2e-connect-portforward-per-conn branch October 24, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/network area/tests Enhancing / fixing test coverage.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants