ember-exam icon indicating copy to clipboard operation
ember-exam copied to clipboard

Getting No moduleQueue was set when using load-balance

Open makepanic opened this issue 4 years ago • 5 comments

I've tried to use the load-balance option in our app, that's already using exam but got an execution error:

command:

ember exam --parallel=3 --load-balance

error:

throw new Error('No moduleQueue was set.')
    at TestemEvents.nextModuleResponse (/project/node_modules/ember-exam/lib/utils/testem-events.js:107:13)

packages:

    "ember-cli": "~3.12.0",
    "ember-exam": "^4.0.2",
    "ember-qunit": "^4.5.1",

test-helpers.ts:

// @ts-ignore
import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import start from 'ember-exam/test-support/start';
import 'qunit-dom';
import 'ember-cli-testdouble-qunit';

setApplication(Application.create(config.APP));

start();

I'm unsure how to debug this error.

makepanic avatar Sep 24 '19 12:09 makepanic

We're seeing this error intermittently as well. Has anyone found a solution?

elwayman02 avatar Aug 03 '20 21:08 elwayman02

The load-balance feature works really well when there are a large number of tests.. but in the case of small ember repo eg. one that has 27 unit tests across 3 test file.. these tests runs super fast, and in some cases the tests finish before some browsers are instantiated... causing the "No moduleQueue was set" error

A short term fix is to decrease the number of browsers for repos with a small number of tests/test files eg: ember exam --load-balance --parallel=1 instead of ember exam --load-balance --parallel=16

Long term, we need implement a flag on testem/ember-exam to ignore the browsers that no longer has tests to run.

step2yeung avatar Sep 25 '20 20:09 step2yeung

@step2yeung we also have this issue using [email protected] with a test suite having a lot of tests (more than 1100)

It happens randomly and we use the following command ember exam --split=2 --partition=1 --parallel=2 --load-balance

ndekeister-us avatar Nov 18 '20 14:11 ndekeister-us

Sorry for the double post, after investigating a little and regarding your answer i'm not sure we got this error because the tests finish before some browsers are instantiated, in our case we are also logging an execution file via --write-execution-file option and in this file, when it fails, we can see the following data ->

{
  "numberOfBrowsers": 2,
  "failedBrowsers": [
    "2"
  ],
  "executionMapping": {
    "1": [
      ...more than 50 modules
    ],
    "2": [
      ...more than 30 modules
    ]
  }
}

So it seems that some tests are already executed in the second browser (or the data in the execution file can be incorrect?)

ndekeister-us avatar Nov 18 '20 17:11 ndekeister-us

running into this quite often in a test suite with ~ 3.000 tests

ember exam --load-balance --parallel=7 --silent --reporter xunit --preserve-test-name > testem-alltests.xml.

ember-exam version 9.

It succeeds after a retry, so its very unfrequent and hard to reproduce.

pomm0 avatar Feb 19 '24 10:02 pomm0