Skip to content

DNSCHANNEL stops jest from closing #6423

@presentsvlad

Description

@presentsvlad

Jest does not closed himself after test finished

--detectOpenHandles suggest I need to close DNSCHANNEL manually:

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

  ●  DNSCHANNEL

      at dns.js:333:23

But I cannot find any additonal information based on that problem.

I have async tests running supertest and jest.

    "express": "^4.16.3",
    "jest": "^23.1.0",
    "supertest": "^3.1.0",
    "pg": "^7.4.3",
    "pg-pool": "^2.0.3"

Test code

const request = require('supertest');
const app = require('server');

// close the server after each test
afterEach(async () => {
  await app.db.close();
});

const wFixture = [{
      "complexity": 3,
}];

describe('Controllers', () => {
  test('list get method', async () => {
    const response = await request(app).get('/');
    expect(response.status).toEqual(200);
    expect(response.body.count).toEqual(1);
    expect(response.body.data).toEqual(wFixture);
  });
});

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