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

if testem.js is imported multiple times within the same test page, it can cause the test run to half #1318

Open
step2yeung opened this issue Jan 14, 2019 · 1 comment

Comments

@step2yeung
Copy link
Member

step2yeung commented Jan 14, 2019

I saw a situation where an additional <script> for testem.js was added to the index.html that is used to run the tests.

This was unnecessary because this is added during the build for an ember app. The problem it cause is calling init() more than once (https://github.com/testem/testem/blob/master/public/testem/testem_connection.js#L147), which will send additional browser-login events (https://github.com/testem/testem/blob/master/public/testem/testem_connection.js#L179) for the same browser instance.

The additional browser-login events causes the testem server to account for two browserTestRunner instance, when there really should only be one.
Testem will wait for the two browserTestRunner instance to complete, but in reality, there is only one executing browser. When the browser finishes running tests, one of the browserTestRunner instance completes, while testem waits for the second browserRunnerInstance.
Testem will timeout after it reached the timeout of 3600seconds set in testem.js.

I feel testem should either:

  1. throw an error if init() is called more than once
    or
  2. recognize that init() should only be ran once even if testem.js gets imported more than once

I personally would go with (1). I can put up a PR for this

@johanneswuerbach
Copy link
Member

  1. sounds good to me 👍

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

No branches or pull requests

2 participants