Ember3 is more picky about having a container being destroyed and it's easier to cause exceptions, especially in tests.
This fix has been initially created for an exception occuring in tests when running discourse-code-review and discourse-polls tests at the same time. `getCurrentUser` method body was failing as the container was destroyed.
Original stacktrace:
```
"Error: Assertion Failed: expected container not to be destroyed
at new EmberError (ember:2929:31)
at assert (ember:1793:23)
at Container.lookup (ember:17736:64)
at PluginApi.getCurrentUser (discourse/lib/plugin-api:56:31)
at allowUser (javascripts/discourse/initializers/init-code-review:38:29)
at eval (javascripts/discourse/initializers/init-code-review:78:11)
at eval (select-kit/mixins/plugin-api:86:19)
at Array.forEach (<anonymous>)
at eval (select-kit/mixins/plugin-api:85:44)
at Array.forEach (<anonymous>)"
```
|
||
|---|---|---|
| .. | ||
| admin | ||
| discourse | ||
| discourse-common | ||
| docs | ||
| ember-addons | ||
| locales | ||
| pretty-text | ||
| select-kit | ||
| wizard | ||
| activate-account.js.no-module.es6 | ||
| admin.js.erb | ||
| application.js | ||
| auto-redirect.js.no-module.es6 | ||
| deprecated.js | ||
| discourse-loader.js | ||
| discourse-objects.js | ||
| discourse.js.es6 | ||
| embed-application.js.no-module.es6 | ||
| ember_include.js.erb | ||
| ember_jquery.js | ||
| ember-shim.js | ||
| env.js | ||
| google-tag-manager.js.no-module.es6 | ||
| google-universal-analytics.js.no-module.es6 | ||
| main_include_admin.js | ||
| markdown-it-bundle.js | ||
| omniauth-complete.js.no-module.es6 | ||
| onpopstate-handler.js.no-module.es6 | ||
| plugin-third-party.js.erb | ||
| plugin.js.erb | ||
| polyfills.js | ||
| preload-application-data.js.no-module.es6 | ||
| preload-store.js.es6 | ||
| pretty-text-bundle.js | ||
| print-page.js | ||
| service-worker.js.erb | ||
| set-prototype-polyfill.js | ||
| template_include.js.erb | ||
| vendor.js | ||
| wizard-application.js | ||
| wizard-start.js.no-module.es6 | ||
| wizard-vendor.js | ||