Skip to content

New Chrome Process Getting Executed On Each New Test Run And Using CPU #893

Closed

Description

@ninpop25

I am running my tests on Chrome browser on client server and via jenkins my automation test build initiates on daily basis.

my tests are getting failed on random basis and when I debugged i found that each time a new chrome Tab is opened then the previous tab is not getting killed in task manager even after my use of I.closeOtherTabs() in the start of each test.

there are multiple chrome.exe getting opened when each test runs and this causes high CPU utilization and then causes tests to fail random.

Is there any way to kill old chrome.exe when a new test runs so that there are not threads of chrome.exe running and causing high CPU

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

# paste output here

Provide test source code if related

// paste test

Details

  • CodeceptJS version:
  • NodeJS Version:
  • Operating System:window 10
  • Protractor || WebDriverIO || Nightmare version (if related)
  • Configuration file:
# {
  "output": "./output",
  "helpers": {
    "WebDriverIO": {
      "url": "https://formsviewertest.azurewebsites.net",
      "browser": "chrome",
      "windowSize": "maximize",
      "restart": false,
      "keepBrowserState": true,
      "keepCookies": true
    },
    "TabSwitch": {
      "require": "./tabswitch_helper.js"
    }
  },
  "include": {
    "I": "./steps_file.js",
    "loginPagePage": "./pages/loginPage.js",
    "manageCredentialPage": "./pages/manageCredential.js",
    "templatePage": "./pages/template.js",
    "uiHelper": "./pages/uiHelper.js",
    "fvAssert": "./pages/fvAssert.js",
    "listPage": "./pages/listPage.js",
    "fvData": "./InputData/login.js"
  },
  "mocha": {
    "reporterOptions": {
      "codeceptjs-cli-reporter": {
        "stdout": "-",
        "options": {
          "verbose": false,
          "steps": true
        }
      },
      "mocha-junit-reporter": {
        "stdout": "./output/console.log",
        "options": {
          "mochaFile": "./output/result.xml"
        }
      }
    }
  },
  "bootstrap": "./config/start_server.js",
  "teardown": "./config/stop_server.js",
  "hooks": [],
  "tests": "**/fv_*_test.js",
  "timeout": 10000,
  "name": "FV"
}

**Below is screenshot of my server that shows multiple chrome.exe**

![cpu](https://user-images.githubusercontent.com/28402736/35318496-a6ee2e6e-0101-11e8-8df5-f952f131ba14.JPG)

Activity

  1. reubenmiller commented on Jan 27, 2018

    @reubenmiller
    Collaborator

    I'm not in a position to look into this issue in detail, but a possible workaround would be to close the chrome.exe instances using powershell after the codeceptjs have finished executing. This is easily done in Jenkins.

    Assuming that you have an independent chrome install (see suggestion in #864), then you can add this powershell one liner to kill the chrome.exe

    Get-Process -Name "chrome.exe" | Where-Object { $_.path -like "*Desktop\chrome.exe" } | Stop-Process

    This would only work if you have a way of differentiating from the normal system chrome installation (i.e. under \Program Files) and the chrome.exe used for the tests.

    In my jenkins setup, I use the Powershell Plugin so you can call codeceptjs to run the tests, then kill anything after it has completed.

  2. ninpop25 commented on Feb 3, 2018

    @ninpop25
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions