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

Creating videos creates memory-leak warning on the 11th test in testcafe docker image testcafe:1.20.0 #7188

Closed
GeorgZentgraf opened this issue Jul 22, 2022 · 7 comments · Fixed by #7199 or #7271
Assignees
Labels
BROWSER: Chrome TYPE: bug The described behavior is considered as wrong (bug).

Comments

@GeorgZentgraf
Copy link

GeorgZentgraf commented Jul 22, 2022

What is your Scenario?

Running multiple tests and recording videos for each

What is the Current behavior?

the 11th test throws a MaxListenersExceededWarning

(node:19) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 Page.screencastFrame listeners added to [Chrome]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)

What is the Expected behavior?

there should be no MaxListenersExceededWarning, after any number of tests

as of docker image version 1.19.0 no warning was thrown, so something might have changed in the amount of Page.screencastFrame listener that are registered

What is your public website URL? (or attach your complete example)

https://github.com/GeorgZentgraf/testcafe-bug

What is your TestCafe test code?

see test.spec.ts

Your complete configuration file

.testcaferc.json

Your complete test report

docker run test
Running tests in:

  • Chrome 103.0.5060.114 / Alpine Linux 3.17_alpha20220715

Getting Started
✓ 1
✓ 2
✓ 3
✓ 4
✓ 5
✓ 6
✓ 7
✓ 8
✓ 9
✓ 10
(node:19) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 Page.screencastFrame listeners added to [Chrome]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
✓ 11
✓ 12

Screenshots

No response

Steps to Reproduce

  1. (install docker desktop)
  2. clone repo
  3. run docker build . -t test
  4. run docker run test

TestCafe version

docker image testcafe/testcafe:1.20.0

Node.js version

No response

Command-line arguments

default from testcafe docker image

Browser name(s) and version(s)

Chrome 103.0.5060.114

Platform(s) and version(s)

No response

Other

The warning doen't show, when using the testcafe image version 1.19.0
Might be related to #7047

@GeorgZentgraf GeorgZentgraf added the TYPE: bug The described behavior is considered as wrong (bug). label Jul 22, 2022
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 22, 2022
@miherlosev
Copy link
Collaborator

Hi @GeorgZentgraf

Thank you for the shared information. I've reproduced the issue.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jul 25, 2022
@miherlosev miherlosev self-assigned this Jul 25, 2022
miherlosev added a commit to miherlosev/testcafe that referenced this issue Jul 27, 2022
miherlosev added a commit that referenced this issue Jul 28, 2022
* fix 'Memory leak on running more than 11 tests' (close #7188)

* fix tests in firefox
@github-actions
Copy link

github-actions bot commented Aug 4, 2022

Release v1.20.1-rc.2 addresses this.

@pschmolke
Copy link

I still get this warning / memory leak on 10 concurrent tests inside a custom docker container

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Aug 29, 2022
@Artem-Babich
Copy link
Contributor

Hi, @pschmolke !
The memory leak issue should already be fixed. Would you please share an example that illustrates the behavior on your side?

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Aug 30, 2022
@pschmolke
Copy link

pschmolke commented Sep 1, 2022

Yes sure,
I have created my own docker image to test the current projects frontend. It is based on alpine linux.
The installed testcafe version is 1.20.1, node version v14.17.6 is used.

I have a directory for tests that can run concurrently and ones that cannot.
I use job control to launch the tests in both directories simultaneously.

The output and cli param can be seen below:

+ npx testcafe --no-color 'chromium:headless:width=1800;height=1000' src/tests/smoke/parallel/ --concurrency 9 --quarantine-mode attemptLimit=3,successThreshold=1 --reporter xunit-gitlab-fork:xunit_smoke_parallel_report.xml,spec
+ npx testcafe --no-color 'chromium:headless:width=1800;height=1000' src/tests/smoke/sequential/ --concurrency 1 --reporter xunit-gitlab-fork:xunit_smoke_sequential_report.xml,spec
+ wait
⠹
The "browsers" option from the configuration file will be ignored.
(node:86) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [BrowserSet]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
 Running tests in:
 - Chrome 102.0.5005.173 / Alpine Linux 3.16.0

Edit: Continues to exists in TestCafe version 2.0.0 of latest release.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 1, 2022
@miherlosev
Copy link
Collaborator

Hi @pschmolke

Thank you for the information. I reproduced the issue.

For the team: use the example from the description to reproduce the issue by adding the concurrency 4 option.

@miherlosev miherlosev reopened this Sep 2, 2022
@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 2, 2022
@github-actions
Copy link

github-actions bot commented Sep 6, 2022

Release v2.0.1-alpha.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BROWSER: Chrome TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
4 participants