Skip to content

Conversation

@simonpasquier
Copy link
Contributor

This change ensures that the JSON payload is generated in a predictable way. In particular it avoids random test failures because the expected output wasn't always matching.

I leaned towards using the reflectpackage because I found no other alternative that wouldn't imply importing another library (like https://pkg.go.dev/github.com/google/btree or https://pkg.go.dev/rsc.io/omap) and a big refactoring.

This change ensures that the JSON payload is generated in a predictable
way. In particular it avoids random test failures because the expected
output wasn't always matching.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Copy link
Member

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

I guess until we are adding something else than a string, we should be fine.
Thank you for this improvement @simonpasquier !

@Nexucis Nexucis merged commit ca46c79 into perses:main Aug 13, 2025
7 checks passed
@simonpasquier simonpasquier deleted the fix-flaky-test branch August 13, 2025 14:20
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