-
Notifications
You must be signed in to change notification settings - Fork 90
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
animationsSettled()
hanging forever
#226
Comments
I was having a similar problem. For me the finalizeAnimation function seemed not to stop. I wanted to have nice drag and drop mechanics for my kanban style application. I created a twiddle which showcases the problem: https://ember-twiddle.com/ca133bd34dd3cfabbd866b20667b1a32 |
Debugged this a little as well and in the specific case I'm debugging it seems that occasionally the first rAF call: https://github.com/ember-animation/ember-animated/blob/master/addon/services/motion.ts#L210 Debugging further to figure out why... |
So it's definitely the Sinon fake-timers interfering with ember-animated's clock which is used by i.e. the Tween's and some of the concurrency-helpers. Making an explicit ref to edit: does not seem to be enough. |
The cause in this specific case seemed to be Sinon fake-timers stubbing |
I found out how to fix my problem at least. ember-animated/addon/src/-private/scheduler.ts Lines 239 to 241 in 80551b2
In this snippet I added the following line after this.stopped = true; :
For me this always resolves the promise which allows me to do work after the animation is done. This looks like a solution to these problems to me. I'd like to contribute this back. Let me know. |
Apparently I did so long ago already. #492 @SergeAstapov Do you care to merge the PR? |
Describe the bug
We lately started seeing an issue in our test suite on CI where tests were sometimes running into QUnit timeouts (60s) and it appears to be related to
animationsSettled()
. It seems that callingawait animationsSettled()
never resolves for some reason.What appears to be related is that in some other test we are using
@sinon/fake-timers
to fake the system time, which is essentially overridingwindow.Date
. My suspicion is that this interacts with the internalclock
of ember-animated in some way that leaks between tests.To Reproduce
Unfortunately I have not been able to reproduce this issue yet locally 😞
Expected behavior
I expect
animationsSettled()
to resolve once the animations are done, instead of waiting forever and causing the test to time out.Desktop (please complete the following information):
The test suite is running in a Docker container with Google Chrome.
The text was updated successfully, but these errors were encountered: