Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

De-flake CanCreateShellsWithMetalBackend#31343

Merged
bdero merged 1 commit intoflutter:mainfrom
bdero:bdero/fix-96807
Feb 9, 2022
Merged

De-flake CanCreateShellsWithMetalBackend#31343
bdero merged 1 commit intoflutter:mainfrom
bdero:bdero/fix-96807

Conversation

@bdero
Copy link
Contributor

@bdero bdero commented Feb 9, 2022

Fixes flutter/flutter#96807.

The race:

  • The RunConfiguration constructor assigns PersistentCache::asset_manager_ (global state).
  • For the Metal backend, the platform view create event reads PersistentCache::asset_manager_.
  • The test thread usually wins the race against the platform event loop, but occasionally it doesn't.

The behavior of the callback itself doesn't seem unreasonable to me, but we can probably add a seatbelt to this test harness to prevent this kind of thing in the future.

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

I don't have a good suggestion for erecting guardrails. I only have a so-so suggestion: Maybe require passing a RunConfiguration to PlatformViewNotifyCreated?

@bdero
Copy link
Contributor Author

bdero commented Feb 9, 2022

Hmm, it looks like there are some tests that call PlatformViewNotifyCreated without creating a RunConfiguration (like InitializeWithSingleThreadWhichIsTheCallingThread, which sends the event via ValidateShell). It probably wouldn't hurt to just pass around default ones in these cases, though.
Added a bug for this here: flutter/flutter#98095

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-submit Mac Host Engine is 15.95% flaky for past 30 days

2 participants