-
Notifications
You must be signed in to change notification settings - Fork 263
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
Error Running Acceptance Tests #312
Comments
Seeing the same error message inside an acceptance test for authentication. Not mocking; just trying to hit the Firebase API: test('a user signs in with the correct password', function(assert) {
visit('/signin');
fillIn("input[type='email']", "[email protected]");
fillIn("input[type='password']", "validpassword");
click("button[type='submit']");
andThen(function() {
assert.equal(currentURL(), '/projects');
});
}); Signing in and out works fine in development when accessing localhost:4200, but it fails with with the error message above in test. |
Might it be related to #251 ? |
Can someone make a MCVE for this? |
I created a repo that should be able to reproduce the "Called stop() outside of test context" error message: https://github.com/RayMangum/empty. The README explains how to reproduce the behavior. The easiest way to see the error is to run |
Thanks @RayMangum ! really appreciate you taking the time to make a minimal example. |
I was getting this error, as well as In both cases, it seems the root cause is that the ember testing system doesn't know how to handle Firebase's asynchronicity. With most adapters, this isn't a problem, because the testing system instruments AJAX calls and ensures they have completed before proceeding, but this obviously doesn't work with Firebase's websockets communication. To work around the issue, I've been using a custom test waiter. You can install it with I've just submitted a pull request to explain this in the README |
@RayMangum it actually looks like the problem you're seeing with login/logout won't be fixed with I've just pushed a kludgy fix of tracking the login process manually, but this should really be rolled into emberfire @tstirrat is there any straightforward way of tracking outstanding Firebase requests explicitly? If so, putting that into the firebase Ember service is probably the best way to fix all these issues (and avoid other problems if people access the service directly). But if not, wrapping the login process (possibly as a generic wrapper for non-ajax-based torii logins) and using the model waiter should at least fix this issue for the public emberfire API. |
Just submitted a PR to address the login issue. @RayMangum's example passes the test suite with this updated version of emberfire. |
I have been banging my head on my desk trying to get Emberfire to run acceptance tests. I understand there are a few hacks floating around, and I've tried all of them, along with manually inserting test waiters, wrapping calls in Ember.run, and more. Super frustrating. Eventually, I'm sure I'll find something that works, but this is going to continuously be causing me pain, I can see it. I think this has to be looked at as a major failing of the library, and hence the service itself if you are trying to use it with Ember. |
I also tried a version of http://spin.atomicobject.com/2015/07/23/testing-asynchronous-behavior-ember/, but I'm still running into I think parts of the firebase adapter itself need to be wrapped in explicit |
I had considered baking test waiters in to the adapter code -- thanks for the liquid-fire example -- I'll work on something like that. |
release 1.6.4 includes the test waiters |
Hello there,
I'm trying emberfire out, but I've run into a problem: I get an error every time I run an acceptance test. I'e pasted the error below. Any ideas?
Thank you!
FIREBASE WARNING: Exception was thrown by user callback. Error: Called stop() outside of a test context at Object.extend.stop (http://localhost:4200/assets/test-support.js:3000:10) at exports.default._emberTestingAdaptersAdapter.default.extend.asyncStart (http://localhost:4200/assets/vendor.js:52454:13) at asyncStart (http://localhost:4200/assets/vendor.js:43110:47) at Object.async (http://localhost:4200/assets/vendor.js:43124:7) at fulfill (http://localhost:4200/assets/vendor.js:66638:22) at handleMaybeThenable (http://localhost:4200/assets/vendor.js:66598:9) at resolve (http://localhost:4200/assets/vendor.js:66611:7) at resolvePromise (http://localhost:4200/assets/vendor.js:66755:9) at http://localhost:4200/assets/vendor.js:99926:11 at ns.wrapper.fb.api.Query.goog.defineClass.once.onceCallback (http://localhost:4200/assets/vendor.js:99115:43) firebase-debug.js:4798 Uncaught Error: Called stop() outside of a test contextextend.stop @ qunit.js:329exports.default._emberTestingAdaptersAdapter.default.extend.asyncStart @ ember.debug.js:41900asyncStart @ ember.debug.js:32556(anonymous function) @ ember.debug.js:32570fulfill @ ember.debug.js:56084handleMaybeThenable @ ember.debug.js:56044resolve @ ember.debug.js:56057resolvePromise @ ember.debug.js:56201(anonymous function) @ firebase.js:193ns.wrapper.fb.api.Query.goog.defineClass.once.onceCallback @ firebase-debug.js:12452ns.wrapper.fb.core.view.ValueEventRegistration.getEventRunner @ firebase-debug.js:5053ns.wrapper.fb.core.util.exceptionGuard @ firebase-debug.js:4793ns.wrapper.fb.core.view.EventList.raise @ firebase-debug.js:3407ns.wrapper.fb.core.view.EventQueue.raiseQueuedEventsMatchingPredicate_ @ firebase-debug.js:3379ns.wrapper.fb.core.view.EventQueue.raiseEventsForChangedPath @ firebase-debug.js:3367(anonymous function) @ firebase-debug.js:11666(anonymous function) @ firebase-debug.js:11094ns.wrapper.fb.core.PersistentConnection.goog.defineClass.onDataMessage_ @ firebase-debug.js:11250ns.wrapper.fb.realtime.Connection.onDataMessage_ @ firebase-debug.js:10821ns.wrapper.fb.realtime.Connection.onPrimaryMessageReceived_ @ firebase-debug.js:10815ns.wrapper.fb.realtime.Connection.connReceiver_ @ firebase-debug.js:10731ns.wrapper.fb.realtime.WebSocketConnection.appendFrame_ @ firebase-debug.js:10507ns.wrapper.fb.realtime.WebSocketConnection.handleIncomingFrame @ firebase-debug.js:10539ns.wrapper.fb.realtime.WebSocketConnection.open.mySock.onmessage @ firebase-debug.js:10464
Uncaught Error: Called stop() outside of a test contextextend.stop @ qunit.js:329exports.default._emberTestingAdaptersAdapter.default.extend.asyncStart @ ember.debug.js:41900asyncStart @ ember.debug.js:32556(anonymous function) @ ember.debug.js:32570fulfill @ ember.debug.js:56084handleMaybeThenable @ ember.debug.js:56044resolve @ ember.debug.js:56057resolvePromise @ ember.debug.js:56201(anonymous function) @ firebase.js:193ns.wrapper.fb.api.Query.goog.defineClass.once.onceCallback @ firebase-debug.js:12452ns.wrapper.fb.core.view.ValueEventRegistration.getEventRunner @ firebase-debug.js:5053ns.wrapper.fb.core.util.exceptionGuard @ firebase-debug.js:4793ns.wrapper.fb.core.view.EventList.raise @ firebase-debug.js:3407ns.wrapper.fb.core.view.EventQueue.raiseQueuedEventsMatchingPredicate_ @ firebase-debug.js:3379ns.wrapper.fb.core.view.EventQueue.raiseEventsForChangedPath @ firebase-debug.js:3367(anonymous function) @ firebase-debug.js:11666(anonymous function) @ firebase-debug.js:11094ns.wrapper.fb.core.PersistentConnection.goog.defineClass.onDataMessage_ @ firebase-debug.js:11250ns.wrapper.fb.realtime.Connection.onDataMessage_ @ firebase-debug.js:10821ns.wrapper.fb.realtime.Connection.onPrimaryMessageReceived_ @ firebase-debug.js:10815ns.wrapper.fb.realtime.Connection.connReceiver_ @ firebase-debug.js:10731ns.wrapper.fb.realtime.WebSocketConnection.appendFrame_ @ firebase-debug.js:10507ns.wrapper.fb.realtime.WebSocketConnection.handleIncomingFrame @ firebase-debug.js:10539ns.wrapper.fb.realtime.WebSocketConnection.open.mySock.onmessage @ firebase-debug.js:10464
The text was updated successfully, but these errors were encountered: