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

One extra session is created when running tests on cloud browser providers. #452

Closed
Ankit098 opened this issue Nov 22, 2021 · 4 comments
Closed

Comments

@Ankit098
Copy link
Contributor

🐛 Bug Report

When using the connect method to run tests, one additional blank session is getting created per run on cloud browser providers, for example, 5 sessions for a 4 test suite. When openBrowser method in global.js gets called during setup, it creates a session which is not used to run any tests.

To Reproduce

Run a basic test on BrowserStack, with say 2 tests.
Sample

Expected behavior

Ideally 2 sessions should be seen on the BrowserStack dashboard but currently you'd see three sessions two corresponding to the two tests but an extra third one as a blank session.

Link to repl or repo (highly encouraged)

Repo
Docs

Issues without a reproduction link are likely to stall.

Run npx envinfo --system --binaries --npmPackages expect-puppeteer,jest-dev-server,jest-environment-puppeteer,jest-puppeteer,spawnd --markdown --clipboard

Paste the results here:

## System:
 - OS: macOS 11.1
 - CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
 - Memory: 229.95 MB / 8.00 GB
 - Shell: 5.8 - /bin/zsh
## Binaries:
 - Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
 - Yarn: 1.22.10 - ~/.nvm/versions/node/v12.13.0/bin/yarn
 - npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
## npmPackages:
 - jest-puppeteer: 6.0.0 => 6.0.0
@UziTech
Copy link
Contributor

UziTech commented Nov 22, 2021

How do you propose this is fixed? I don't think there is anything we can change in jest-puppeteer to fix this. This seems like an issue with browser stack.

@Ankit098
Copy link
Contributor Author

Could have a flag/config option to avoid the connect call inside global.js and here use the wsEndPoint provided in config. This would use the connect method here to run the tests.

@UziTech
Copy link
Contributor

UziTech commented Nov 22, 2021

if you want to create a PR I would be happy to review it. 😁👍

@UziTech
Copy link
Contributor

UziTech commented Dec 14, 2021

should be fixed in v6.0.3

@UziTech UziTech closed this as completed Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants