Skip to content

Node does not exit after server.stop() #68

@jaller94

Description

@jaller94

Code to reproduce

I am using Node v10.11.0.

const { SingleThing, Thing, WebThingServer } = require('webthing');

async function test() {
  const thing = new Thing();
  const server = new WebThingServer(new SingleThing(thing), 8000);
  console.log('starting...');
  await server.start();
  console.log('started');
  console.log('stopping...');
  server.stop();
  console.log('stopped');
}

test().catch(console.error);

After completing tests in a repository of mine Jest has to be force exited for the process to quit.

git clone git@gitlab.com:webthings/all-webthings.git
cd all-webthings
git checkout cf92a899d376ca48411b56f04ca0c2915a41d2ba
npm test -- --detectOpenHandles

This output the following on my machine:

Ran all test suites.

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  Timeout

      at Object.<anonymous> (node_modules/dnssd/lib/sleep.js:14:16)
      at Object.<anonymous> (node_modules/dnssd/lib/Advertisement.js:14:13)

Because I assume that this is an issue more related to dnssd I filed it in that repository as well: DeMille/dnssd.js#10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions