-
Notifications
You must be signed in to change notification settings - Fork 440
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
Container still left in memory after test run #2129
Comments
I too am seeing this issue. What I've found is that by adding Then, if I call the Finally, if I modify my application route to request the model from the store and create the model in my acceptance test, I see an ember Container leak: Including the model, application route and router: |
Anyone found a solution for this? I am experiencing the same problem 😞 |
I believe Mirage is getting started automatically in your tests here https://github.com/miragejs/ember-cli-mirage/blob/master/packages/ember-cli-mirage/app/initializers/ember-cli-mirage.js#L32 because of this https://github.com/miragejs/ember-cli-mirage/blob/master/packages/ember-cli-mirage/app/initializers/ember-cli-mirage.js#L55 I note that when it starts the server for running in development here https://github.com/miragejs/ember-cli-mirage/blob/master/packages/ember-cli-mirage/addon/instance-initializers/ember-cli-mirage-autostart.js#L22 it also registers the server to be destroyed. Thats because there is one start and one end. In tests there are many. SetupMirage starts the server https://github.com/miragejs/ember-cli-mirage/blob/master/packages/ember-cli-mirage/addon-test-support/setup-mirage.js#L23 and destroys it https://github.com/miragejs/ember-cli-mirage/blob/master/packages/ember-cli-mirage/addon-test-support/setup-mirage.js#L29 for each test. I wonder why it starts the server and then starts it again during SetupMirage. Setting up Mirage also sets up pretender, if you call SetupMirage twice you usually get an error stating you cant create a second pretender. Just observations. I dont know why you have a container left over. This addon is really just a convenience for adding MirageJS (since it was extracted). For your test, we could NOT use ember-cli-mirage and use MirageJS hard, then we could see if the container left over is MirageJS responsibility or ember-cli-mirage responsibility |
any solutions for this? |
I've just begun the journey to identify memory leaks in my ember application. I'm getting started with the steps outlined on ember-map. Basically, run tests, take heap snapshot, and look for the existence of
Container
.I generally have two different types of
Container
left after a test, my application container, and a container coming frommirage-esm.js
. Even if I am not using mirage in the test, or have skipped the test completely, the mIrage container still shows up.Am I leaking memory in my test run due to multiple mirage containers?
To reproduce, install ember-cli-mirage to a new ember app.
npm i -g ember-cli
ember init
ember install ember-cli-mirage
ember test --server
The text was updated successfully, but these errors were encountered: