steveszc / ember-cli-memory-leak-detector

Automatic memory leak detection for ember apps
https://www.npmjs.com/package/ember-cli-memory-leak-detector
MIT License
38 stars 5 forks source link

Memory leak detector test doesn't run #47

Closed joshuaswift closed 3 years ago

joshuaswift commented 3 years ago

Hey! We can't get the detector to run in our tests locally or on CI, however we don't see any errors. The test to check for retained classes just never seems to run in the first place. If I run a small acceptance test module, the tests pass and there is no console output, from my understanding even if there is no retained classes there should be a console output, is that correct?

I did spot a QUnit warning which could potentially be related, which points to this line in the package.

Warning: Unexpected test after runEnd. This is unstable and will fail in QUnit 3.0.

This could well be something config related so here's our testem file, hopefully this helps:

Thanks!

const TimeReporter = require('testem-time-reporter');
const XunitReporter = require('testem/lib/reporters/xunit_reporter');

class Reporters {
  constructor(silent, out) {
    this.xunitReporter = new XunitReporter(silent, out, {get: () => false});
    this.timeReporter = new TimeReporter();
  }

  report(prefix, data) {
    this.xunitReporter.report(prefix, data);
    this.timeReporter.report(prefix, data);
  }

  finish() {
    this.xunitReporter.finish();
    this.timeReporter.finish();
  }
}

/* eslint-env node */
module.exports = {
  framework: 'qunit',
  test_page: 'tests/index.html',
  disable_watching: true,
  reporter: Reporters,
  report_file: './reports/test-results.xml',
  xunit_intermediate_output: true,
  launch_in_ci: ['Chrome'],
  launch_in_dev: ['Chrome'],
  parallel: 8,
  browser_args: {
    Chrome: {
      dev: ['--remote-debugging-port=9222'],
      ci: [
        '--disable-dev-shm-usage',
        '--disable-gpu',
        '--disable-software-rasterizer',
        '--disable-web-security',
        '--headless',
        '--incognito',
        '--mute-audio',
        '--no-sandbox',
        '--remote-debugging-address=0.0.0.0',
        '--remote-debugging-port=9222',
      ],
    },
  },
};
steveszc commented 3 years ago

@joshuaswift Thanks for reporting. This Qunit warning recently came to my attention and will require some pretty substantial changes to how we report memory leaks since we rely on adding a new test after all the other tests finish. I'm not sure I have a good answer for you now, but I suspect you may be out of luck unless you downgrade qunit or we can release a new version that uses a different approach.

What version of Qunit are you using?

steveszc commented 3 years ago

Context: Qunit changes introduced July 2021 here https://github.com/qunitjs/qunit/pull/1629

steveszc commented 3 years ago

Closing in favor of #49

joshuaswift commented 3 years ago

@steveszc Thanks for getting back to me! We're on ember-qunit 4.6.0 which appears to use qunit 2.9.3.

Sounds like a tricky obstacle to overcome! We can look into downgrading in the mean time.

steveszc commented 3 years ago

Fortunately it sounds like the qunit team agrees our use case should be supported, so it may end up being a straightforward change to whatever the new way to run a "final" test is.

joshuaswift commented 3 years ago

Awesome! I look forward to further updates.