Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flaky test #968

Merged
merged 1 commit into from
Jan 28, 2025
Merged

fix: flaky test #968

merged 1 commit into from
Jan 28, 2025

Conversation

ryepup
Copy link
Contributor

@ryepup ryepup commented Jan 27, 2025

Proposed changes

TestConvertToStructs was occasionally failing because it was expecting range over a map to be a consistent order, but per spec:

The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next.

Uses ElementsMatch so the test passes even when the order of elements is different.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

`TestConvertToStructs` was occasionally failing because it was expecting `range` over a `map` to be a consistent order, but per [spec]:

> The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next.

Uses `ElementsMatch` so the test passes even when the order of elements is different.

[spec]: https://go.dev/ref/spec#RangeClause
@ryepup ryepup requested a review from a team as a code owner January 27, 2025 23:04
@github-actions github-actions bot added bug Something isn't working chore Pull requests for routine tasks labels Jan 27, 2025
@aphralG aphralG merged commit 20ee486 into nginx:v3 Jan 28, 2025
14 checks passed
@ryepup ryepup deleted the convert-to-structs-flake branch January 28, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants