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

Add a small configurable delay to test isolation validation assertion. #528

Merged

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 2, 2019

Recent changes to Ember (for the @tracked feature in Octane) make it so that an autorun is much more commonly present. In those cases any operation using run.join that would have previously been sync (because no autorun existed when run.join was invoked) will now flush asynchronously. In this case we will only have a single autorun scheduled (which would resolve on the next microtask queue flush), but it would be enough to "trip up" the test isolation validation system.

With this change to the test isolation validation infrastructure we allow a small delay for the test to "settle" before doing the assertion. This change makes it possible for many more applications and addons to take advantage of the protections that test isolation validation provides without incurring frustrating to track down timing issues outside of the applications own control.

Closes #478.

Recent changes to Ember (for the `@tracked` feature in Octane) make it
so that an autorun is much more commonly present. In those cases any
operation using `run.join` that would have previously been sync (because
no autorun existed when `run.join` was invoked) will now flush
asynchronously. In this case we will only have a single autorun
scheduled (which would resolve on the next microtask queue flush), but
it would be enough to "trip up" the test isolation validation system.

With this change to the test isolation validation infrastructure we
allow a small delay for the test to "settle" before doing the assertion.
This change makes it possible for many more applications and addons to
take advantage of the protections that test isolation validation
provides without incurring frustrating to track down timing issues
outside of the applications own control.
@scalvert
Copy link
Contributor

scalvert commented Aug 2, 2019

Good catch. This looks good.

@rwjblue rwjblue merged commit e808fb7 into emberjs:master Aug 2, 2019
@rwjblue rwjblue deleted the allow-small-isolation-validation-window branch August 2, 2019 16:46
@rwjblue rwjblue added bug and removed enhancement labels Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants