Skip to content

router_check: add timeout route assertion to router_check_tool#46019

Open
varungandhi-databricks wants to merge 1 commit into
envoyproxy:mainfrom
varungandhi-databricks:varungandhi-databricks/router-check-timeout-assertion
Open

router_check: add timeout route assertion to router_check_tool#46019
varungandhi-databricks wants to merge 1 commit into
envoyproxy:mainfrom
varungandhi-databricks:varungandhi-databricks/router-check-timeout-assertion

Conversation

@varungandhi-databricks

@varungandhi-databricks varungandhi-databricks commented Jul 7, 2026

Copy link
Copy Markdown

Description

The router_check_tool can currently assert the selected cluster, virtual host, path rewrite, and header fields -- but not the matched route's per-route timeout. This means tests cannot distinguish two routes that share the same upstream cluster but carry different timeouts.

This PR adds a timeout field to ValidationAssert. compareTimeout reads routeEntry()->timeout() and compares in milliseconds, following the same pattern as compareCluster.


Commit Message: router_check: add timeout route assertion to router_check_tool
Additional Description: Adds google.protobuf.Duration timeout to ValidationAssert (field 14) and the corresponding expected_timeout/actual_timeout fields to ValidationFailure. compareTimeout is registered in the checkers[] array and returns true when has_timeout() is false, so existing tests are unaffected.
Risk Level: Low
Testing: Added Timeout.yaml + golden fixtures (two routes to the same cluster with different per-route timeouts, matched by prefix and regex) and a TimeoutFailures fixture asserting the mismatch error string via route_tests.sh.
Docs Changes: N/A
Release Notes: N/A

@repokitteh-read-only

Copy link
Copy Markdown

Hi @varungandhi-databricks, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #46019 was opened by varungandhi-databricks.

see: more, trace.

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46019 was opened by varungandhi-databricks.

see: more, trace.

@varungandhi-databricks varungandhi-databricks force-pushed the varungandhi-databricks/router-check-timeout-assertion branch from cb8e189 to 606eda5 Compare July 7, 2026 15:39
@varungandhi-databricks varungandhi-databricks force-pushed the varungandhi-databricks/router-check-timeout-assertion branch from 606eda5 to 3555c91 Compare July 9, 2026 08:51
@varungandhi-databricks varungandhi-databricks marked this pull request as ready for review July 9, 2026 08:53
@agrawroh agrawroh self-assigned this Jul 9, 2026
exit 1
fi

# Timeout assertion failure output (route selected correctly by cluster, but wrong timeout)

@agrawroh agrawroh Jul 9, 2026

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.

Please rephrase this. It can never happen that you "select" a correct route but then we apply a different timeout. You can give an example of RegEx route with a fallback where the fallback with a different timeout gets picked in case nothing RegEx is not matched.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed this. The test now asserts a more realistic case similar to the one I had in mind earlier with regexes. PTAL.

@varungandhi-databricks varungandhi-databricks force-pushed the varungandhi-databricks/router-check-timeout-assertion branch from 3555c91 to c88238e Compare July 9, 2026 09:20
Add a `timeout` field to ValidationAssert so tests can assert the matched
route's per-route request timeout (RouteEntry::timeout()), not just the
selected cluster.

compareTimeout reads routeEntry()->timeout() and compares in milliseconds.
Useful when two routes share the same upstream cluster but carry different
per-route timeouts -- cluster_name alone cannot distinguish which was selected.

Adds Timeout.yaml + golden fixtures and a TimeoutFailures fixture asserting
the mismatch error string via route_tests.sh.

Signed-off-by: Varun Gandhi <varun.gandhi@databricks.com>
@varungandhi-databricks varungandhi-databricks force-pushed the varungandhi-databricks/router-check-timeout-assertion branch from c88238e to a273935 Compare July 9, 2026 09:44

@agrawroh agrawroh 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, Thanks!

@agrawroh agrawroh enabled auto-merge (squash) July 9, 2026 10:07
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.

2 participants