theintern / leadfoot

A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.
Other
170 stars 24 forks source link

"Error: kill ESRCH" when all tests are over #155

Closed sylvaindubus closed 6 years ago

sylvaindubus commented 6 years ago

Using

Current behavior

When all tests are over, I get the following message in my console (and I have to CTRL+C). The browser closes normally.

‣ Created remote session chrome 67.0.3396.99 on Mac OS X (94754befded4f049fda77db2695c3d60)
✓ chrome 67.0.3396.99 on Mac OS X - User - can wait some seconds (3.149s)
This is the end !
TOTAL: tested 1 platforms, 1 passed, 0 failed
(ノಠ益ಠ)ノ彡┻━┻
Error: kill ESRCH
  at Object._errnoException  <util.js:992:11>
  at process.kill  <internal/process.js:183:18>
  at <node_modules/src/util.ts:46:10>
  at Array.forEach  <anonymous>
  at Object.kill  <node_modules/src/util.ts:45:24>
  at <node_modules/src/Tunnel.ts:566:3>
  at new Promise  <anonymous>
  at SeleniumTunnel.Tunnel._stop  <node_modules/src/Tunnel.ts:555:9>
  at SeleniumTunnel.Tunnel.stop  <node_modules/src/Tunnel.ts:523:24>
  at <src/lib/executors/Node.ts:303:7>

How to reproduce

index.html

<!DOCTYPE html>
<html lang="fr">
  <head>
    <meta charset="UTF-8">
    <title>Coucou</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  </head>
  <body>
    <div id="app">Hey !</div>
  </body>
</html>

This doesn't occur all the time (about 80-90%).

intern.json

{
  "functionalSuites": "test.js",
  "environments": [
    {
      "browserName": "chrome",
      "fixSessionCapabilities": "no-detect"
    }
  ]
}

test.js

const { registerSuite } = intern.getInterface('object')

registerSuite('User', () => {
  let remote

  return {
    before() {
      remote = this.remote.get('index.html')
    },
    after() {
      console.log('This is the end !')
    },
    tests: {
      'can wait some seconds': () => (
        remote.sleep(3000)
      )
    }
  }
})
jason0x43 commented 6 years ago

This error isn't related to Leadfoot -- it was actually a problem with Dig Dug (and was, just for fun, tracked in an Intern issue).

A fix was included in the recently released Dig Dug 2.1.2. Ensure you're using that version of @theintern/digdug. If not, uninstall and reinstall intern in your project.

If you're still seeing this issue with @theintern/didgug@2.1.2, we can open a new issue in https://github.com/theintern/digdug/issues.

sylvaindubus commented 6 years ago

Thanks for your reply. I was using Dig Dug 2.1.1. After reinstalling Intern, it works well.