question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MaxListenersExceededWarning: Possible EventEmitter memory leak detected.

See original GitHub issue

Thanks for this wonderful repo. first

When I run codeceptjs test and see the following warnings in console, which bothers me. However the test runs successfully.

Expected

$ codeceptjs run demo/acceptance-footer-test.js
CodeceptJS v1.4.2
Using test root "/Users/allen.kim/github/rci-components"
Acceptance test --
  ✔ Test Agent Footer in 4173ms

What do you get instead?

$ (dev) codeceptjs run demo/acceptance-footer-test.js
CodeceptJS v1.4.2
Using test root "/Users/allen.kim/github/rci-components"

Acceptance test --
(node:4147) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 framedetached listeners added. Use emitter.setMaxListeners() to increase limit
(node:4147) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 response listeners added. Use emitter.setMaxListeners() to increase limit
(node:4147) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 lifecycleevent listeners added. Use emitter.setMaxListeners() to increase limit
(node:4147) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 framenavigatedwithindocument listeners added. Use emitter.setMaxListeners() to increase limit
  ✔ Test Agent Footer in 4128ms

Provide console output if related. Use --verbose mode for more details.

$ codeceptjs run --verbose demo/acceptance-footer-test.js
CodeceptJS v1.4.2
Using test root "/Users/allen.kim/github/rci-components"
Helpers: puppeteer
Plugins: screenshotOnFail

Acceptance test --
    [1] Starting recording promises
    Emitted | suite.before ([object Object])
  Test Agent Footer
    Emitted | test.before ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I resize window 763, 860)
    Emitted | step.after (I resize window 763, 860)
    Emitted | step.before (I am on page "/#/components/agent-footer")
    Emitted | step.after (I am on page "/#/components/agent-footer")
    Emitted | step.before (I wait 1)
    Emitted | step.after (I wait 1)
    Emitted | step.before (I click ".mce-page-blocker")
    Emitted | step.after (I click ".mce-page-blocker")
    Emitted | step.before (I see "Allen Kim")
    Emitted | step.after (I see "Allen Kim")
    Emitted | step.before (I click "Sign Out")
    Emitted | step.after (I click "Sign Out")
    Emitted | step.before (I see "Do you want to continue?")
    Emitted | step.after (I see "Do you want to continue?")
    Emitted | step.before (I see "Stay signed in")
    Emitted | step.after (I see "Stay signed in")
    Emitted | step.before (I click ".signout-link")
    Emitted | step.after (I click ".signout-link")
    Emitted | step.before (I see "Message: CustomEvent fired. type is "logout"")
    Emitted | step.after (I see "Message: CustomEvent fired. type is "logout"")
    Emitted | step.before (I click "Stay signed in")
    Emitted | step.after (I click "Stay signed in")
    Emitted | step.before (I dont see "Do you want to continue?")
    Emitted | step.after (I dont see "Do you want to continue?")
    Emitted | step.before (I click "Report Issue")
    Emitted | step.after (I click "Report Issue")
    Emitted | step.before (I see "CustomEvent fired. type is "report-issue-clicked"")
    Emitted | step.after (I see "CustomEvent fired. type is "report-issue-clicked"")
    Emitted | step.before (I click "SSP")
    Emitted | step.after (I click "SSP")
    Emitted | step.before (I see "CustomEvent fired. type is "ssp-clicked"")
    Emitted | step.after (I see "CustomEvent fired. type is "ssp-clicked"")
    Emitted | step.before (I click "Français")
    Emitted | step.after (I click "Français")
    Emitted | step.before (I see "CustomEvent fired. type is "language-changed"")
    Emitted | step.after (I see "CustomEvent fired. type is "language-changed"")
    Emitted | step.before (I click ".rui-icon-chevron-up")
    Emitted | step.after (I click ".rui-icon-chevron-up")
    Emitted | step.before (I click "Add links to footer")
    Emitted | step.after (I click "Add links to footer")
    Emitted | step.before (I click "Oasys")
    Emitted | step.after (I click "Oasys")
    Emitted | step.before (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "oasys"")
    Emitted | step.after (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "oasys"")
    Emitted | step.before (I see "Sales Assist")
    Emitted | step.after (I see "Sales Assist")
    Emitted | step.before (I click "Sales Assist")
    Emitted | step.after (I click "Sales Assist")
    Emitted | step.before (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist"")
    Emitted | step.after (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist"")
    Emitted | step.before (I click ".rui-icon-chevron-up")
    Emitted | step.after (I click ".rui-icon-chevron-up")
    Emitted | step.before (I dont see "Live chat")
    Emitted | step.after (I dont see "Live chat")
    Emitted | step.before (I click ".agent-live-chat-indicator")
    Emitted | step.after (I click ".agent-live-chat-indicator")
    Emitted | step.before (I see "Live chat")
    Emitted | step.after (I see "Live chat")
    Emitted | step.before (I click ".agent-live-chat-indicator")
    Emitted | step.after (I click ".agent-live-chat-indicator")
    Emitted | step.before (I dont see "Live chat")
    Emitted | step.after (I dont see "Live chat")
    Emitted | step.before (I am on page "/#/components/agent-session-detail")
    Emitted | step.after (I am on page "/#/components/agent-session-detail")
    Emitted | step.before (I wait for element "agent-session-detail")
    Emitted | step.after (I wait for element "agent-session-detail")
    Emitted | step.before (I am on page "/#/components/agent-preferred-links")
    Emitted | step.after (I am on page "/#/components/agent-preferred-links")
    Emitted | step.before (I wait for element "agent-preferred-links")
    Emitted | step.after (I wait for element "agent-preferred-links")
    Emitted | step.before (I am on page "/#/components/agent-quick-links")
    Emitted | step.after (I am on page "/#/components/agent-quick-links")
    Emitted | step.before (I wait for element "agent-quick-links")
    Emitted | step.after (I wait for element "agent-quick-links")
    Emitted | step.before (I am on page "/#/components/agent-live-chat")
    Emitted | step.after (I am on page "/#/components/agent-live-chat")
    Emitted | step.before (I wait for element "agent-live-chat")
    Emitted | step.after (I wait for element "agent-live-chat")
    Emitted | step.start (I resize window 763, 860)
    Test: I
      I resize window 763, 860
    Emitted | step.passed (I resize window 763, 860)
    Emitted | step.finish (I resize window 763, 860)
    Emitted | step.start (I am on page "/#/components/agent-footer")
      I am on page "/#/components/agent-footer"
      › [Url] http://localhost:4200/#/components/agent-footer
      › [Browser:Log] Angular is running in the development mode. Call enableProdMode() to enable the production mode.JSHandle:Angular is running in the development m…
    Emitted | step.passed (I am on page "/#/components/agent-footer")
    Emitted | step.finish (I am on page "/#/components/agent-footer")
    Emitted | step.start (I wait 1)
      I wait 1
      › [Browser:Error] Failed to load resource: the server responded with a status of 404 (Not Found)
    Emitted | step.passed (I wait 1)
    Emitted | step.finish (I wait 1)
    Emitted | step.start (I click ".mce-page-blocker")
      I click ".mce-page-blocker"
    Emitted | step.passed (I click ".mce-page-blocker")
    Emitted | step.finish (I click ".mce-page-blocker")
    Emitted | step.start (I see "Allen Kim")
      I see "Allen Kim"
    Emitted | step.passed (I see "Allen Kim")
    Emitted | step.finish (I see "Allen Kim")
    Emitted | step.start (I click "Sign Out")
      I click "Sign Out"
    Emitted | step.passed (I click "Sign Out")
    Emitted | step.finish (I click "Sign Out")
    Emitted | step.start (I see "Do you want to continue?")
      I see "Do you want to continue?"
    Emitted | step.passed (I see "Do you want to continue?")
    Emitted | step.finish (I see "Do you want to continue?")
    Emitted | step.start (I see "Stay signed in")
      I see "Stay signed in"
    Emitted | step.passed (I see "Stay signed in")
    Emitted | step.finish (I see "Stay signed in")
    Emitted | step.start (I click ".signout-link")
      I click ".signout-link"
    Emitted | step.passed (I click ".signout-link")
    Emitted | step.finish (I click ".signout-link")
    Emitted | step.start (I see "Message: CustomEvent fired. type is "logout"")
      I see "Message: CustomEvent fired. type is "logout""
    Emitted | step.passed (I see "Message: CustomEvent fired. type is "logout"")
    Emitted | step.finish (I see "Message: CustomEvent fired. type is "logout"")
    Emitted | step.start (I click "Stay signed in")
      I click "Stay signed in"
    Emitted | step.passed (I click "Stay signed in")
    Emitted | step.finish (I click "Stay signed in")
    Emitted | step.start (I dont see "Do you want to continue?")
      I dont see "Do you want to continue?"
    Emitted | step.passed (I dont see "Do you want to continue?")
    Emitted | step.finish (I dont see "Do you want to continue?")
    Emitted | step.start (I click "Report Issue")
      I click "Report Issue"
    Emitted | step.passed (I click "Report Issue")
    Emitted | step.finish (I click "Report Issue")
    Emitted | step.start (I see "CustomEvent fired. type is "report-issue-clicked"")
      I see "CustomEvent fired. type is "report-issue-clicked""
    Emitted | step.passed (I see "CustomEvent fired. type is "report-issue-clicked"")
    Emitted | step.finish (I see "CustomEvent fired. type is "report-issue-clicked"")
    Emitted | step.start (I click "SSP")
      I click "SSP"
    Emitted | step.passed (I click "SSP")
    Emitted | step.finish (I click "SSP")
    Emitted | step.start (I see "CustomEvent fired. type is "ssp-clicked"")
      I see "CustomEvent fired. type is "ssp-clicked""
    Emitted | step.passed (I see "CustomEvent fired. type is "ssp-clicked"")
    Emitted | step.finish (I see "CustomEvent fired. type is "ssp-clicked"")
    Emitted | step.start (I click "Français")
      I click "Français"
    Emitted | step.passed (I click "Français")
    Emitted | step.finish (I click "Français")
    Emitted | step.start (I see "CustomEvent fired. type is "language-changed"")
      I see "CustomEvent fired. type is "language-changed""
    Emitted | step.passed (I see "CustomEvent fired. type is "language-changed"")
    Emitted | step.finish (I see "CustomEvent fired. type is "language-changed"")
    Emitted | step.start (I click ".rui-icon-chevron-up")
      I click ".rui-icon-chevron-up"
    Emitted | step.passed (I click ".rui-icon-chevron-up")
    Emitted | step.finish (I click ".rui-icon-chevron-up")
    Emitted | step.start (I click "Add links to footer")
      I click "Add links to footer"
    Emitted | step.passed (I click "Add links to footer")
    Emitted | step.finish (I click "Add links to footer")
    Emitted | step.start (I click "Oasys")
      I click "Oasys"
(node:3483) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 framedetached listeners added. Use emitter.setMaxListeners() to increase limit
(node:3483) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 response listeners added. Use emitter.setMaxListeners() to increase limit
    Emitted | step.passed (I click "Oasys")
    Emitted | step.finish (I click "Oasys")
    Emitted | step.start (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "oasys"")
      I see "CustomEvent fired. type is "deeplink-clicked" and detail is "oasys""
    Emitted | step.passed (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "oasys"")
    Emitted | step.finish (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "oasys"")
    Emitted | step.start (I see "Sales Assist")
      I see "Sales Assist"
    Emitted | step.passed (I see "Sales Assist")
    Emitted | step.finish (I see "Sales Assist")
    Emitted | step.start (I click "Sales Assist")
      I click "Sales Assist"
(node:3483) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 lifecycleevent listeners added. Use emitter.setMaxListeners() to increase limit
(node:3483) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 framenavigatedwithindocument listeners added. Use emitter.setMaxListeners() to increase limit
    Emitted | step.passed (I click "Sales Assist")
    Emitted | step.finish (I click "Sales Assist")
    Emitted | step.start (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist"")
      I see "CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist""
    Emitted | step.passed (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist"")
    Emitted | step.finish (I see "CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist"")
    Emitted | step.start (I click ".rui-icon-chevron-up")
      I click ".rui-icon-chevron-up"
    Emitted | step.passed (I click ".rui-icon-chevron-up")
    Emitted | step.finish (I click ".rui-icon-chevron-up")
    Emitted | step.start (I dont see "Live chat")
      I dont see "Live chat"
    Emitted | step.passed (I dont see "Live chat")
    Emitted | step.finish (I dont see "Live chat")
    Emitted | step.start (I click ".agent-live-chat-indicator")
      I click ".agent-live-chat-indicator"
    Emitted | step.passed (I click ".agent-live-chat-indicator")
    Emitted | step.finish (I click ".agent-live-chat-indicator")
    Emitted | step.start (I see "Live chat")
      I see "Live chat"
    Emitted | step.passed (I see "Live chat")
    Emitted | step.finish (I see "Live chat")
    Emitted | step.start (I click ".agent-live-chat-indicator")
      I click ".agent-live-chat-indicator"
    Emitted | step.passed (I click ".agent-live-chat-indicator")
    Emitted | step.finish (I click ".agent-live-chat-indicator")
    Emitted | step.start (I dont see "Live chat")
      I dont see "Live chat"
    Emitted | step.passed (I dont see "Live chat")
    Emitted | step.finish (I dont see "Live chat")
    Emitted | step.start (I am on page "/#/components/agent-session-detail")
      I am on page "/#/components/agent-session-detail"
      › [Url] http://localhost:4200/#/components/agent-session-detail
    Emitted | step.passed (I am on page "/#/components/agent-session-detail")
    Emitted | step.finish (I am on page "/#/components/agent-session-detail")
    Emitted | step.start (I wait for element "agent-session-detail")
      I wait for element "agent-session-detail"
    Emitted | step.passed (I wait for element "agent-session-detail")
    Emitted | step.finish (I wait for element "agent-session-detail")
    Emitted | step.start (I am on page "/#/components/agent-preferred-links")
      I am on page "/#/components/agent-preferred-links"
      › [Url] http://localhost:4200/#/components/agent-preferred-links
    Emitted | step.passed (I am on page "/#/components/agent-preferred-links")
    Emitted | step.finish (I am on page "/#/components/agent-preferred-links")
    Emitted | step.start (I wait for element "agent-preferred-links")
      I wait for element "agent-preferred-links"
    Emitted | step.passed (I wait for element "agent-preferred-links")
    Emitted | step.finish (I wait for element "agent-preferred-links")
    Emitted | step.start (I am on page "/#/components/agent-quick-links")
      I am on page "/#/components/agent-quick-links"
      › [Url] http://localhost:4200/#/components/agent-quick-links
    Emitted | step.passed (I am on page "/#/components/agent-quick-links")
    Emitted | step.finish (I am on page "/#/components/agent-quick-links")
    Emitted | step.start (I wait for element "agent-quick-links")
      I wait for element "agent-quick-links"
    Emitted | step.passed (I wait for element "agent-quick-links")
    Emitted | step.finish (I wait for element "agent-quick-links")
    Emitted | step.start (I am on page "/#/components/agent-live-chat")
      I am on page "/#/components/agent-live-chat"
      › [Url] http://localhost:4200/#/components/agent-live-chat
    Emitted | step.passed (I am on page "/#/components/agent-live-chat")
    Emitted | step.finish (I am on page "/#/components/agent-live-chat")
    Emitted | step.start (I wait for element "agent-live-chat")
      I wait for element "agent-live-chat"
    Emitted | step.passed (I wait for element "agent-live-chat")
    Emitted | step.finish (I wait for element "agent-live-chat")
    Emitted | test.passed ([object Object])
    Emitted | test.finish ([object Object])
  ✔ OK in 4195ms

    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])

  OK  | 1 passed   // 5s
    Emitted | global.result ([object Object])
    Emitted | global.after ([object Object])

Provide test source code if related

$ cat demo/acceptance-footer-test.js
Feature('Acceptance test');

Scenario('Test Agent Footer', I => {

  //initalize test and wait for page to load
  I.resizeWindow(763,860);
  I.amOnPage('/#/components/agent-footer');
  I.wait(1);
  I.click('.mce-page-blocker');

  //check to see agent name is displayed
  I.see('Allen Kim');

  //test session-detail-indicator and session-details components
  I.click('Sign Out');
  I.see('Do you want to continue?');
  I.see('Stay signed in');
  I.click('.signout-link');
  I.see('Message: CustomEvent fired. type is "logout"');
  I.click('Stay signed in');
  I.dontSee('Do you want to continue?');

  // agent-footer deep links
  I.click('Report Issue');
  I.see('CustomEvent fired. type is "report-issue-clicked"');
  I.click('SSP');
  I.see('CustomEvent fired. type is "ssp-clicked"')
  I.click('Français');
  I.see('CustomEvent fired. type is "language-changed"')

  //test agent-quick-link-indicator and agent-quick-link components
  I.click('.rui-icon-chevron-up');
  I.click('Add links to footer');
  I.click('Oasys');
  I.see('CustomEvent fired. type is "deeplink-clicked" and detail is "oasys"');

  //test agent-quick-link-indicator and agent-quick-link components
  I.see('Sales Assist');
  I.click('Sales Assist');
  I.see('CustomEvent fired. type is "deeplink-clicked" and detail is "salesAssist"');
  I.click('.rui-icon-chevron-up');

  //test agent-live-chat and agent-live-chat-indicator
  I.dontSee('Live chat');
  I.click('.agent-live-chat-indicator');
  I.see('Live chat');
  I.click('.agent-live-chat-indicator');
  I.dontSee('Live chat');

  //testing each component page in demo
  I.amOnPage('/#/components/agent-session-detail');
  I.waitForElement('agent-session-detail');

  I.amOnPage('/#/components/agent-preferred-links');
  I.waitForElement('agent-preferred-links')

  I.amOnPage('/#/components/agent-quick-links');
  I.waitForElement('agent-quick-links');

  I.amOnPage('/#/components/agent-live-chat');
  I.waitForElement('agent-live-chat');
});

Details

  • CodeceptJS version: v1.4.2
  • NodeJS Version: 9.4.0
  • Operating System: Mac Os X Maverick
  • Helper: Puppeteer 1.8.0
  • Configuration file:
$ (dev) cat codecept.json
{
  "tests": "{,!(custom-elements|node_modules)/**/}*-test.js",
  "timeout": 10000,
  "output": "./output",
  "helpers": {
    "puppeteer": {
      "show": true,
      "url": "http://localhost:4200"
    }
  },
  "include": {
    "I": "./test/codecept-steps-file.js"
  },
  "bootstrap": false,
  "mocha": {},
  "name": "app"
}```

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
allenhwkimcommented, Oct 22, 2018

@luismanuel001 I have tested with your new helper, and it works fine.

1reaction
luismanuel001commented, Oct 17, 2018

I think this is related with an issue I’m having in my project, and I think it is due to the click() implementation on the puppeteer helper, that for some reason, it is calling the waitForNavigation() method at the end of every click, while I think this should only be called if it is a click that triggers a navigation (ex. an anchor tag click).

I tried removing the call to the this.waitForNavigation() at the end of the proceedClick() method on the puppeteer helper (https://github.com/Codeception/CodeceptJS/blob/1.4.3/lib/helper/Puppeteer.js#L1804), and all memory leak warnings, and all my navigation timeouts warnings went away.

I might create a PR with a solution for this later this week, but in the meantime I hope this helps you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

possible EventEmitter memory leak detected - node.js
I'd like to point out here that that warning is there for a reason and there's a good chance the right fix is...
Read more >
Possible EventEmitter memory leak detected. · Issue #1295
Hi there, I think there is a regression in version 3.0. When I'm using Custom Agent (https) with keepAlive: true option and then...
Read more >
How to fix possible EventEmitter memory leak detected - cri.dev
The warning possible EventEmitter memory leak detected happens when you have more than 10 listeners (read EventEmitter) attached to an event ...
Read more >
Possible EventEmitter memory leak detected. 11 scanStop ...
The node red console indicates "MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 scanStop listeners added. Use emitter.
Read more >
Actions execution throws "MaxListenersExceededWarning"
(node:18) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [Socket]. Use emitter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found