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

Fix Failing Tests resulting from ember-concurrency v2 bump #306

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

stefanpenner
Copy link
Member

@stefanpenner stefanpenner commented Aug 16, 2021

  1. treat continue() not as an idempotent function, but rather as a once time resource. This helps detect failures, specifically ones where we are cooperating with another co-routine. In-practice, this means continue() will throw if invoked twice for the same continuation

  2. continue() now returns a promise, which tests now await rather than Promise.resolve. This enables the generator itself to dictate when the the active continuation has come to an end.

After debugging, it really just came down to the fact that await Promise.resolve() and the yieldable used in this test implicitly depended on something they really should not have. Ember 3.16 and 3.20 had slightly different glimmer dirty-tracking behaviors, which resulted in the mixture of native promises and ember auto-run setTimeouts creating a situation where the precariousness of the relationship between the above mentioned operations was exposed.

The proper way to address this is to ensure the test code makes that relationship explicit. I suspect ember-concurrencies new yieldable may be the recommended approach, but this should suffice to get the tests green again.

I have also brain dumped all this on poor Steve, who may look into the yieldable stuff.

1) treat `continue()` not as an idempotent function, but rather as a once time resource. This helps detect failures, specifically ones where we are cooperating with another co-routine. In-practice, this means `continue()` will throw if invoked twice for the same continuation

2) `continue()` now returns a promise, which tests now await rather than Promise.resolve. This enables the generator itself to dictate when the the active continuation has come to an end.

—

After debugging, it really just came down to the fact that `await Promise.resolve()` and the `yieldable` used in this test implicitly depended on something they really should not have. Ember 3.16 and 3.20 had slightly different glimmer dirty-tracking behaviors, which resulted in the mixture of native promises and ember auto-run setTimeouts creating a situation where the precariousness of the relationship between the above mentioned operations was exposed.

The proper way to address this is to ensure the test code makes that relationship explicit. I suspect ember-concurrencies new yieldable may be the recommended approach, but this should suffice to get the tests green again.

I have also brain dumped all this on poor Steve, who may look into the yieldable stuff.
@stefanpenner stefanpenner changed the title Refactor Failing Test: Fix Failing Tests Aug 16, 2021
@stefanpenner stefanpenner marked this pull request as ready for review August 16, 2021 22:16
@scalvert
Copy link
Collaborator

cc/ @bendemboski for visibility into the test issue.

@scalvert scalvert changed the title Fix Failing Tests Fix Failing Tests resulting from ember-concurrency v2 bump Aug 16, 2021
@scalvert scalvert merged commit 7e837c8 into master Aug 16, 2021
@scalvert scalvert deleted the ember-concurrency-fun branch August 16, 2021 22:20
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.

2 participants