Skip to content

ember-test never terminates with COVERAGE=true #81

Closed

Description

@lone-cloud

ember-cli: 2.10.0 ( also repro in previous version )
ember: 2.10.0
ember-cli-code-coverage: 0.38.0

ember t everything is good with no errors and proper termination. COVERAGE=true ember t everything succeeds and the coverage is generated as expected, but the process never terminates. When I run it in DEBUG="*" mode it seems to hang with:

  engine:ws writing "3" +0ms
  engine:ws received "2" +25s
  engine:socket packet +0ms
  engine:socket got ping +0ms
  engine:socket sending packet "pong" (undefined) +0ms
  engine:socket flushing buffer to transport +0ms
  engine:ws writing "3" +0ms
  engine:ws received "2" +25s
  engine:socket packet +0ms
  engine:socket got ping +0ms
  engine:socket sending packet "pong" (undefined) +0ms
  engine:socket flushing buffer to transport +0ms
  engine:ws writing "3" +0ms
  engine:ws received "2" +25s
  engine:socket packet +0ms
  engine:socket got ping +0ms
  engine:socket sending packet "pong" (undefined) +0ms
  engine:socket flushing buffer to transport +0ms
  engine:ws writing "3" +0ms

Looked into debugging phantom js but found no obvious errors.

Activity

  1. topaxi commented on Nov 30, 2016

    @topaxi

    My builds stopped working with the same behaviour, it seemed to appear randomly. I guess this might be a dependency issue?

  2. rox163 commented on Nov 30, 2016

    @rox163

    I've seen this as well but only with addons that have acceptance tests. If I skip the acceptance test then the run completes and reports coverage.

  3. lone-cloud commented on Nov 30, 2016

    @lone-cloud
    Author

    @rox163 Thank you! That was causing the freezing for me too.

  4. topaxi commented on Dec 2, 2016

    @topaxi

    Are you by any chance using ember-cli-mirage?

    I noticed that the request.onload callback never got called. This might be caused by pretenderjs (even though the request was made and I had a passthrough rule in mirage/config.js).

    In my codebase in tests/helpers/destroy-app.js there was a missing line server.shutdown();.

    Here the full file which solved the issue for me:

    tests/helpers/destroy-app.js

    import Ember from 'ember';
    
    export default function destroyApp(application) {
      Ember.run(application, 'destroy');
      server.shutdown();
    }
  5. lone-cloud commented on Dec 2, 2016

    @lone-cloud
    Author

    That was exactly my problem too. Thank you. 😲

  6. mdarmetko commented on Dec 24, 2016

    @mdarmetko

    Still having this issue with version 0.3.9 even with the above solution. Reverting to 0.2.2 fixed it for me.

  7. lone-cloud commented on Dec 27, 2016

    @lone-cloud
    Author

    The issue is back for me with 0.3.9 but 0.3.8 is still good

  8. kategengler commented on Jan 5, 2017

    @kategengler
    Collaborator

    Hopefully solved by #87

  9. kategengler commented on Jan 5, 2017

    @kategengler
    Collaborator

    #87 has been released in 0.3.10

  10. ming-codes commented on Jan 7, 2017

    @ming-codes
    Contributor

    Duplicates with #88?

  11. lone-cloud commented on Jan 10, 2017

    @lone-cloud
    Author

    I opened this ticket over a month before 88.
    Anyways, the hanging issue is fixed for me after upgrading to 0.3.10 ( and previously having applied topaxi's fix ).

  12. mdarmetko commented on Jan 10, 2017

    @mdarmetko

    Was still seeing this in 0.3.10. I'm using mostly default generated tests with ember 2.10 and ember-cli-mirage. It must have been a problem with a mirage instance never getting shutdown and hanging around. Resolved it by adding if(server !== undefined) { server.shutdown(); } to beforeEach and afterEach in each acceptance test file. As in,

    module('Acceptance: Metro', {
      beforeEach: function() {
        if(server !== undefined) { server.shutdown(); }
        application = startApp();
        originalConfirm = window.confirm;
        window.confirm = function() {
          confirmCalledWith = [].slice.call(arguments);
          return true;
        };
      },
      afterEach: function() {
        Ember.run(application, 'destroy');
        window.confirm = originalConfirm;
        confirmCalledWith = null;
        if(server !== undefined) { server.shutdown(); }
      }
    });
    

    Hope this helps someone else having the same problem.

  13. isaacaskew commented on Dec 27, 2017

    @isaacaskew

    @topaxi - that mirage server.shutdown() trick saved my ass. If you're ever in the Chicago area, your drink's on me.

  14. tniezurawski commented on Jun 19, 2018

    @tniezurawski

    I had the same problem. Because of Integration tests where I use New Testing API.

    I had to close mirage server (server.shutdown()) after every Integration tests. Here is quite neat solution for folks that will strugle with this in the future:

    https://gist.github.com/tniezurawski/907d0fa83a7a621146add3871d1827ca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions