Skip to content

fix: make IR map comparison deterministic in runner tests#7852

Closed
Aditya7880900936 wants to merge 5 commits intoenvoyproxy:mainfrom
Aditya7880900936:fix-ir-map-to-slice
Closed

fix: make IR map comparison deterministic in runner tests#7852
Aditya7880900936 wants to merge 5 commits intoenvoyproxy:mainfrom
Aditya7880900936:fix-ir-map-to-slice

Conversation

@Aditya7880900936
Copy link
Copy Markdown
Contributor

What type of PR is this?
fix(test): make IR map comparison deterministic in runner tests

What this PR does / why we need it:
This PR fixes nondeterministic test behavior caused by using reflect.DeepEqual
on maps returned from watchable.LoadAll() in runner tests.

It introduces deterministic ordering helpers for XdsIR and InfraIR maps and
updates the runner tests to compare sorted results instead of raw maps.
This ensures stable and reliable test outcomes without changing any
production logic.

Which issue(s) this PR fixes:
Fixes #7783

Release Notes: No

Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
@Aditya7880900936 Aditya7880900936 requested a review from a team as a code owner December 31, 2025 11:32
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.79%. Comparing base (dd2861f) to head (ff30b86).

Files with missing lines Patch % Lines
internal/message/types.go 92.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7852      +/-   ##
==========================================
+ Coverage   72.77%   72.79%   +0.02%     
==========================================
  Files         235      235              
  Lines       35165    35190      +25     
==========================================
+ Hits        25592    25618      +26     
+ Misses       7756     7755       -1     
  Partials     1817     1817              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 1, 2026

@Aditya7880900936 we want to eliminate maps from the IR and use a list of structs instead to ensure order

@Aditya7880900936
Copy link
Copy Markdown
Contributor Author

Aditya7880900936 commented Jan 2, 2026

Hi @arkodg @rudrakhp ,
Thanks for the clarification

That makes sense. This PR focuses on making the existing tests deterministic without changing the IR shape, but I agree the proper fix is to eliminate maps from the IR entirely and replace them with ordered slices of structs.

Happy to follow up with a separate PR that converts the relevant IR maps to slices, if that sounds good.

@Aditya7880900936
Copy link
Copy Markdown
Contributor Author

Hi @arkodg @rudrakhp , just a gentle follow-up in case this got buried.
Happy to make any further changes if needed. Thanks!

Signed-off-by: Aditya Sanskar Srivastav <161202916+Aditya7880900936@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 9, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit ac8834d
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6960c28cd0959a0008d58dd0
😎 Deploy Preview https://deploy-preview-7852--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 11, 2026

#7852 (comment)

@Aditya7880900936
Copy link
Copy Markdown
Contributor Author

Hi @arkodg ,
Got it, thanks for the clarification. This PR intentionally keeps scope limited to test determinism; happy to follow up with a separate IR refactor PR to replace maps with ordered slices.

Junnygram added a commit to Junnygram/gateway that referenced this pull request Jan 14, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Jan 17, 2026

closing in favor of #7953

@arkodg arkodg closed this Jan 17, 2026
@Aditya7880900936 Aditya7880900936 deleted the fix-ir-map-to-slice branch January 24, 2026 13:43
Junnygram added a commit to Junnygram/gateway that referenced this pull request Jan 25, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
zirain pushed a commit to Junnygram/gateway that referenced this pull request Jan 28, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
Junnygram added a commit to Junnygram/gateway that referenced this pull request Jan 30, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
Junnygram added a commit to Junnygram/gateway that referenced this pull request Jan 30, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
zirain pushed a commit to Junnygram/gateway that referenced this pull request Jan 31, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
Junnygram added a commit to Junnygram/gateway that referenced this pull request Jan 31, 2026
…pEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
arkodg pushed a commit that referenced this pull request Feb 1, 2026
#7953)

* refactor: convert IR map fields to slices to ensure deterministic DeepEqual

Addresses issue #7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
cnvergence pushed a commit to cnvergence/gateway that referenced this pull request Feb 3, 2026
envoyproxy#7953)

* refactor: convert IR map fields to slices to ensure deterministic DeepEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>
cnvergence added a commit that referenced this pull request Feb 3, 2026
* e2e: speed tracing tests (#8124)

* e2e: speed tracing tests

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix(translator): allow single-label backends in host mode (#8123)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* ci: release json report (#8107)

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix oidc flakiness (#8119)

* fix oidc flakiness

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: skip_test_workflow doesn't exist (#8116)

This also uses grouped redirects to satisfy shellcheck SC2129.

Signed-off-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix e2e test panic (#8109)

fix e2e test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* chore: bump func-e to v1.4.0 (#8105)

bump func-e to v1.4.0

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: route idle timeout (#8058)

* fix: route idle timeout

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* address comments

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* add test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

---------

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* docs: add Mirakl to adopters list (#8138)

Signed-off-by: Thierry Wandja <thierry.wandja@mirakl.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* docs: add security warning to control plane extensions (#7967)

chore(docs): add warnings about control plane extensions

Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* chore: add lint for release notes filenames (#8137)

* chore: add lint for release notes filenames

Signed-off-by: zirain <zirain2009@gmail.com>

* remove 1.7.0

Signed-off-by: zirain <zirain2009@gmail.com>

* fix lint

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: remove global logger in message package (#8131)

* fix: remove global logger in message package

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* docs: fix url result of regex rewrite (#7864)

* Update http-urlrewrite.md

Signed-off-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* chore: log skipped xds (#8132)

log skipped xds

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* docs: fixes for OPA sidecar + Unix Domain Socket task (#8142)

Signed-off-by: Matt Miller <millermatt@outlook.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: basic auth validation (#8053)

* fix basic auth validation

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: controller cache-sync readiness check (#7430)

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: replace context.TODO with timeout context in config dump (#8122)

* fix: replace context.TODO with timeout context in config dump

Uses context.WithTimeout instead of context.TODO() to enable
proper cancellation and prevent indefinite hangs when Kubernetes
API is slow or unavailable.

Fixes #8121

Signed-off-by: jaffar <keikei.jaffar@mail.utoronto.ca>

* Make config dump timeout configurable with 30s default

- Add Timeout field to ConfigDump struct
- Add DefaultConfigDumpTimeout constant (30s)
- Add getTimeout() helper that returns configured timeout or default
- Update Collect() to use cd.getTimeout() instead of hardcoded value

Signed-off-by: jaffar <keikei.jaffar@mail.utoronto.ca>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* refactor: convert IR map fields to slices to ensure deterministic Dee… (#7953)

* refactor: convert IR map fields to slices to ensure deterministic DeepEqual

Addresses issue #7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix links in releasing and develop docs (#8141)

* fix links in releasing and develop docs

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* update quickstart link

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

---------

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* docs: add provider guide for entra (#7977)

* docs: add provider guide for entra

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* chore: clean up test output files (#8154)

clean up test output files

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix: TCPRoute mTLS didn't work (#8152)

* fix: remove auto HTTP config on TCP cluster

Signed-off-by: zirain <zirain2009@gmail.com>

* fix lint

Signed-off-by: zirain <zirain2009@gmail.com>

* add e2e

Signed-off-by: zirain <zirain2009@gmail.com>

* fix e2e

Signed-off-by: zirain <zirain2009@gmail.com>

* fix comment

Signed-off-by: zirain <zirain2009@gmail.com>

* fix

Signed-off-by: zirain <zirain2009@gmail.com>

* fix resource name

Signed-off-by: zirain <zirain2009@gmail.com>

* address Arko's comment

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* v1.7.0-rc2 release notes (#8163)

* v1.7.0-rc2 release notes

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

* fix the date

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

---------

Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>

---------

Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Signed-off-by: Thierry Wandja <thierry.wandja@mirakl.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
Signed-off-by: Matt Miller <millermatt@outlook.com>
Signed-off-by: jaffar <keikei.jaffar@mail.utoronto.ca>
Signed-off-by: Junnygram <junnexclusive@gmail.com>
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
Co-authored-by: zirain <zirain2009@gmail.com>
Co-authored-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com>
Co-authored-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Co-authored-by: Thierry Wandja <thierry.wandja@mirakl.com>
Co-authored-by: Guy Daich <guy.daich@sap.com>
Co-authored-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
Co-authored-by: Matt Miller <millermatt@outlook.com>
Co-authored-by: Isaac Wilson <10012479+jukie@users.noreply.github.com>
Co-authored-by: jaffar keikei <keikei.jaffar@mail.utoronto.ca>
Co-authored-by: Olaleye <90139191+Junnygram@users.noreply.github.com>
Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com>
Inode1 pushed a commit to Inode1/gateway that referenced this pull request Feb 23, 2026
envoyproxy#7953)

* refactor: convert IR map fields to slices to ensure deterministic DeepEqual

Addresses issue envoyproxy#7852.

Signed-off-by: Junnygram <junnexclusive@gmail.com>
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.

Convert IR maps into a Slice of Structs

4 participants