Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Ctrl-C doesn't terminate gemini-gui server when running through npm run #81

Description

@shamrin

Steps

  1. npm install --save-dev gemini-gui
  2. configure gemini to use chromedriver
  3. add npm run test:gui command to package.json:
{
  // ...
  "scripts": {
    "test:gui": "gemini-gui -p 8076 ./gemini",
  }
}

  1. launch gemini-gui through npm run test:gui
  2. click Run button to run tests
  3. hit Ctrl-C in the server console

Expected

gemini-gui server is terminated

Actual

npm run script is terminated, but gemini-gui is still running and occupies the port forever

Logs

$ grep test:gui package.json
    "test:gui": "gemini-gui -p 8076 ./gemini",
$ npm run test:gui

> somepkg@1.0.0 test:gui /Users/user/src/somepkg
> gemini-gui -p 8076 ./gemini

GUI is running at http://localhost:8076
✓ somepkg home [chrome]
Total: 1 Passed: 1 Failed: 0 Skipped: 0 Retries: 0
^CCancelling...
$ npm run test:gui

> somepkg@1.0.0 test:gui /Users/user/src/somepkg
> gemini-gui -p 8076 ./gemini

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:8076
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1259:14)
    at listen (net.js:1295:10)
    at net.js:1405:9
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)

Address is indeed still in use:

$ lsof -PiTCP -sTCP:LISTEN | grep 8076
node      85382 user   15u  IPv4 0xdeadbeef12345      0t0  TCP localhost:8076 (LISTEN)

Curiously, it prints Force quit when killing the process:

$ kill 85382
Force quit.

(The problem is even more confusing because of #2)

Activity

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