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

docs aren't clear server needs to be shutdown #226

Closed
stefanpenner opened this issue Aug 4, 2015 · 6 comments · Fixed by #281
Closed

docs aren't clear server needs to be shutdown #226

stefanpenner opened this issue Aug 4, 2015 · 6 comments · Fixed by #281

Comments

@stefanpenner
Copy link
Collaborator

Either the docs need to be adjusted, or a mechanism of automatic shutdown (after run(app, 'destroy')) is needed

cc @cibernox

@cibernox
Copy link
Collaborator

cibernox commented Aug 4, 2015

I'll add some context to this.

Chasing some memory leaks, we saw that pretender instances were leaking all over the place, once per test.

There is (was, actually) a memory leak in pretender itself, but also seems that unless you explicitly shutdown the server, that also keeps some references, but once @trek cuts a new release we'll see if this is really necessary. I'd say that after the fix in pretender the the only leaked variable will be the global server, and if that's the case I wouldn't care, it's only one.

@blimmer blimmer added the docs label Aug 15, 2015
@blimmer blimmer removed the docs label Aug 27, 2015
@blimmer
Copy link
Contributor

blimmer commented Aug 27, 2015

@stefanpenner do you have any ideas how to fix this? Is there a way to hook into the app destroy event to clean up the server?

@blimmer
Copy link
Contributor

blimmer commented Aug 27, 2015

Also, for those running into this, you need to call window.server.shutdown(); after you run(app, 'destroy') for the time being.

@stefanpenner
Copy link
Collaborator Author

app destroy event to clean up the server?

i think you want to hook into the test runner after hooks

@blimmer
Copy link
Contributor

blimmer commented Aug 27, 2015

I wonder if there's a way to do that in a generic way that would work for people using Qunit, Mocha, etc.

@blimmer
Copy link
Contributor

blimmer commented Aug 30, 2015

I just wrote a PR to ember-cli that would make this a very simple fix. We'll see how it goes.

blimmer added a commit to blimmer/ember-cli-mirage that referenced this issue Sep 20, 2015
Ember-CLI 1.13.9 and beyond will have a destroy-app helper that we can shutdown the server in.
This patch automatically inserts this behavior, or shows a message if the user doesn't have a destroy-app helper explaining how to fix the problem.
Fixes miragejs#226.
blimmer added a commit to blimmer/ember-cli-mirage that referenced this issue Nov 8, 2015
Ember-CLI 1.13.9 and beyond will have a destroy-app helper that we can shutdown the server in.
This patch automatically inserts this behavior, or shows a message if the user doesn't have a destroy-app helper explaining how to fix the problem.
Fixes miragejs#226.
blimmer added a commit to blimmer/ember-cli-mirage that referenced this issue Dec 15, 2015
Ember-CLI 1.13.9 and beyond will have a destroy-app helper that we can shutdown the server in.
This patch automatically inserts this behavior, or shows a message if the user doesn't have a destroy-app helper explaining how to fix the problem.
Fixes miragejs#226.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants