Skip to content

Conversation

@gnprice
Copy link
Member

@gnprice gnprice commented Mar 30, 2023

Fixes part of #85160. This comes after #123751 as part of removing no-shuffle tags from all tests in the framework.

For render objects with the same depth, [paint] gets called in the order that [markNeedsPaint] was called, which is not necessarily the visual paint order. So having a test check the order of [paint] calls is brittle.

Here, it was breaking when an editable.foregroundPainter = null, intended to clean up a previous test, caused a [markNeedsPaint] on the composite foreground painter before the test could cause a [markNeedsPaint] on the background.

Instead, follow the pattern of the neighboring tests and use the paints matcher; remove the paintHistory static field.

For debugging this it was useful to have a toString on this test painter class, so add that too.

To be confident there weren't any remaining ordering-related flakes, I ran this test file with both the previously-failing seed in the comment and 308 other seeds, all of which passed. There are only 45 tests in this file, so an ordering-dependent flake would probably have a rate of at least 1/45 = 2.22% (the probability of a given test coming first, or of coming immediately after another given test), and the data is enough to reject that at p<.001, as well as to reject a 1% flake rate at p<.05.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

For render objects with the same depth, [paint] gets called
in the order that [markNeedsPaint] was called, which is not
necessarily the visual paint order.  So having a test check
the order of [paint] calls is brittle.

Here, it was breaking when an `editable.foregroundPainter = null`,
intended to clean up a previous test, caused a [markNeedsPaint]
on the composite foreground painter before the test could cause
a [markNeedsPaint] on the background.

Instead, follow the pattern of the neighboring tests and use
the `paints` matcher.

For debugging this it was useful to have a toString on this
test painter class, so add that too.
@gnprice gnprice requested a review from LongCatIsLooong March 30, 2023 19:30
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Mar 30, 2023
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

LGTM. @gspencergoog could you take a look?

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@gnprice gnprice added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 31, 2023
@auto-submit auto-submit bot merged commit 6a92b93 into flutter:master Mar 31, 2023
@gnprice gnprice deleted the pr-shuffle-editable branch March 31, 2023 00:13
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
…#123806)

Fix state leak in rendering/editable_test (framework shuffle-all 2/n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants