Skip to content

test: Increase transform2D op count in flaky test#3709

Merged
spydon merged 3 commits intoflame-engine:mainfrom
zeyus-research:feature/fix-3692-test-precision-fail
Aug 28, 2025
Merged

test: Increase transform2D op count in flaky test#3709
spydon merged 3 commits intoflame-engine:mainfrom
zeyus-research:feature/fix-3692-test-precision-fail

Conversation

@zeyus
Copy link
Copy Markdown
Contributor

@zeyus zeyus commented Aug 28, 2025

Description

In the initial implementation of the transform2dRoundTripUncertainty I tried to approximately figure out how many ops happen in the round trip transform, but it was just an educated guess. Just bumping it by 1 makes the test pass with the given seed 2021996283,

This also adds a helper to run tests with a specific random seed without modifying the tests, e.g. for this one:
flutter test --dart-define=RANDOM_SEED=2021996283 packages/flame/test/game/transform2d_test.dart

And for other tests:
RANDOM_SEED=2021996283 melos test:seeded

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #3692

Copy link
Copy Markdown
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Lgtm! Thanks, again 😃

@spydon spydon changed the title fix: Increase transform2D op count in flaky test test: Increase transform2D op count in flaky test Aug 28, 2025
@spydon spydon enabled auto-merge (squash) August 28, 2025 12:07
@zeyus
Copy link
Copy Markdown
Contributor Author

zeyus commented Aug 28, 2025

Lgtm! Thanks, again 😃

No probs at all, I'm fine with the "You break it, you buy it" policy ;)

@spydon
Copy link
Copy Markdown
Member

spydon commented Aug 28, 2025

@zeyus can you rebase this branch on main? For some reason it doesn't work to do that from the GitHub UI today...

@zeyus
Copy link
Copy Markdown
Contributor Author

zeyus commented Aug 28, 2025

@zeyus can you rebase this branch on main? For some reason it doesn't work to do that from the GitHub UI today...

Oh, it worked just now, maybe I forgot to check the "maintainers can commit" or whatever checkbox...I can't see it anywhere on mobile at the moment though.

@spydon spydon merged commit 575526d into flame-engine:main Aug 28, 2025
8 checks passed
nickf2k pushed a commit to nickf2k/flame that referenced this pull request Nov 16, 2025
In the initial implementation of the `transform2dRoundTripUncertainty` I
tried to approximately figure out how many ops happen in the round trip
transform, but it was just an educated guess. Just bumping it by 1 makes
the test pass with the given seed `2021996283`,

This also adds a helper to run tests with a specific random seed without
modifying the tests, e.g. for this one:
`flutter test --dart-define=RANDOM_SEED=2021996283
packages/flame/test/game/transform2d_test.dart`

And for other tests:
`RANDOM_SEED=2021996283 melos test:seeded`
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 random test for specific seed

2 participants