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

The concurrency limit is passed when a timeout occurs and the browser restarts #2280

Closed
SteveVanOpstal opened this issue Jul 27, 2016 · 2 comments · Fixed by karronoli/redpen#10 · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132

Comments

@SteveVanOpstal
Copy link
Contributor

SteveVanOpstal commented Jul 27, 2016

Expected behavior

With a concurrency limit specified the concurrently run browsers should be limited to that value.

Actual behavior

When a browser passes one of the timeouts specified in the configuration below, that browser restarts. The next browser is also allowed to start, setting the amount of concurrent browsers to 2. Even though the concurrency limit is set to 1.

Environment Details

Karma 1.1.1

config.set({
  ...
  concurrency: 1,
  captureTimeout: 60000,
  browserDisconnectTimeout: 60000,
  browserDisconnectTolerance: 3,
  browserNoActivityTimeout: 60000
});

Steps to reproduce the behaviour

  1. Use the above configuration
  2. Let a browser timeout
  3. Check the amount of active browsers
@SteveVanOpstal
Copy link
Contributor Author

The issue occurs on a travis-saucelabs setup and I can't seem reproduce the issue locally. I'll give it another try tomorrow.

@SteveVanOpstal
Copy link
Contributor Author

I found the bug that is causing this behavior.
When a disconnect occurs the launcher is not considered to be in a error state (lib/launchers/base.js). Which is understandable as this is not an issue of the launcher. However, when handling the 'done' event (lib/launcher.js) the error state will be used to determine whether the next queued job (the next browser) needs to start. An extra check needs to be added where the launcher state is checked if it's restarting.

Conclusion:
A disconnect occurs, that browser restarts and the next browser will also start. An extra concurrent browser will spawn for every browser that fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant