1
votes

I have an older Ember-cli app that I've just updated to all the latest dependencies and file formats, I've run ember init with [email protected], but when I try to write an acceptance test with the visit() helper, the internal wait function never resolves.

The furthest I've been able to trace the problem is into the wait function in the bower_components/ember/ember.js file, at the line if (run.hasScheduledTimers() || run.currentRunLoop) { return; }

There is a timer on backburner, but time and time again, the loop returns here, and it never seems to have a chance to clear the timer.

I'm pretty sure the timer is supposed to make sure the wait helper waits after an ajax request, but the ajax request has long since resolved. Heck, if there were still pending requests, we would have exited this function.

Any insights into this process would be greatly appreciated!!

1
I am using an Ember.run.later() in my application, which looks like I may be duplicating this issue: discuss.emberjs.com/t/…DanF

1 Answers

4
votes

I had an instance of Em.run.later in my application in a loop, to recursively check for timeouts. This is not uncommon, it turns out!

My solution was to put the run.later block in a conditional check for the current environment, and disable it in testing.