Skip to content

test: allow for EG v1.9.2 shutdown time in TestRunExtprocStartFailure - #2794

Merged
nacx merged 1 commit into
theagentrouter:mainfrom
abdulaziz-dev-lab:test/aigw-extproc-failure-timeout
Oct 6, 2026
Merged

nacx merged 1 commit into
theagentrouter:mainfrom
abdulaziz-dev-lab:test/aigw-extproc-failure-timeout

Conversation

@abdulaziz-dev-lab

Copy link
Copy Markdown
Contributor

Description

TestRunExtprocStartFailure has been flaky on both ubuntu and macOS since the Envoy Gateway v1.9.2 bump (#2787). It fails with "expected extproc start to fail promptly" after its 10s timeout, on main and on PRs alike.

When the extproc fails, run cancels the Envoy Gateway server's context and returns once server.ExecuteContext returns. Since v1.9.2, EG's shutdown waits for every runner goroutine to exit [1][2]. That includes the file provider's Start, which runs the initial load of the resources even when the context was canceled before it began. With v1.9.0 nothing waited for it.

With the CI flags (-race, atomic coverage), pinned to 4 cores, the time from the cancel to ExecuteContext returning in this test went from 0.15s to 3.12s (median of 10 runs). The wait is mostly single-threaded, and on CI runners, which run several test packages at once, it often goes past 10s. Running the test on one core shared with two busy loops reproduces the failure on main (10.01s). With this change it passes (12.01s).

The timeout only needs to catch run hanging after the extproc fails, which is what #1134 fixed. This raises it to 60s and adds a comment explaining why.

Related Issues/PRs (if applicable)

Fixes #2793

Special notes for reviewers (if applicable)

Making run itself return faster would need EG to skip the initial load once the context is canceled, which is an upstream change.

1: https://github.com/envoyproxy/gateway/blob/v1.9.2/release-notes/v1.9.2.yaml
2: envoyproxy/gateway#10128

Since the EG v1.9.2 bump, Envoy Gateway's shutdown waits for the file
provider to finish its initial load of the resources, even when the
context was canceled before the load started. run returns only after
that, so TestRunExtprocStartFailure has been hitting its 10s timeout
on CI.

The timeout only needs to catch run hanging after the extproc fails,
so raise it to 60s.

Signed-off-by: Abdulaziz Alharbi <246710009+abdulaziz-dev-lab@users.noreply.github.com>
@abdulaziz-dev-lab
abdulaziz-dev-lab requested a review from a team as a code owner October 6, 2026 02:12
@netlify

netlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for theagentrouter canceled.

Name Link
🔨 Latest commit 3c05e65
🔍 Latest deploy log https://app.netlify.com/projects/theagentrouter/deploys/6ac4590a2d14710008eb0dc3

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@abdulaziz-dev-lab

Copy link
Copy Markdown
Contributor Author

/retest

@abdulaziz-dev-lab

Copy link
Copy Markdown
Contributor Author

A note on this PR's CI history.

The first Build and Test run passed everything except Data Plane Test (macos-latest). Both Unit Test jobs, where TestRunExtprocStartFailure runs, passed. The data-plane failure was in TestOtelOpenAIEmbeddings_metrics_modelNameOverride. Before any request was made, the extproc couldn't bind its admin port (listen tcp :49906: bind: address already in use), so the test environment never came up and the test failed after 60s. That's a port collision in the data-plane test setup, unrelated to this change, which only touches cmd/aigw/run_test.go.

https://github.com/theagentrouter/agent-router/actions/runs/37402998623/job/112074199353

I ran /retest once. It re-ran only that job, which passed, and ci-required is now green.

@siddharth1036 siddharth1036 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
minor nit, after timeout the t.Fatal still logs expected to fail promptly, worth aligning the log with 60s window

@nacx

nacx commented Oct 6, 2026

Copy link
Copy Markdown
Member

Great catch. Thank you!

@nacx
nacx enabled auto-merge (squash) October 6, 2026 06:32
@nacx
nacx disabled auto-merge October 6, 2026 06:32
@nacx
nacx merged commit 8a0bb69 into theagentrouter:main Oct 6, 2026
63 of 65 checks passed
@abdulaziz-dev-lab

Copy link
Copy Markdown
Contributor Author

@siddharth1036 Thanks for the review. Good point about "promptly". The message also blames the extproc startup even though the extproc fails right away. The timeout actually catches run not returning afterwards. The comment above the select explains this, and the FAIL line shows the elapsed time. So I'll leave it as merged.

@nacx Happy to send a one-line follow-up if you'd like one.

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.

flaky test: TestRunExtprocStartFailure

3 participants