Skip to content

Mocha tests hanging in latest (5.8.9) #11065

@broofa

Description

@broofa

What are you doing?

I have a suite of mocha tests that sequelize.close() in the after hook. These tests run to completion in 5.8.8. In 5.8.9, they hang.

@sushantdhiman: I'm guessing this is a result of dcf079b#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L43

To Reproduce
Create a new directory, install modules:

$ mkdir foo && cd foo
$ npm i sequelize mysql2 mocha

Create a simple mocha test file, a.js:

const Sequelize = require('sequelize');

sequelize = new Sequelize('tendai_test', 'root', null, {dialect: 'mysql'});

after(async () => await sequelize.close());

describe(__filename, () => it('noop test', async () => await sequelize.query('DO 0')));

What do you expect to happen?

Running the test should complete:

$ mocha a.js

Executing (default): DO 0
  /Users/kieffer/foo/a.js
    ✓ noop test


  1 passing (54ms)

$  # (test finishes)

What is actually happening?

$ mocha a.js

Executing (default): DO 0
  /Users/kieffer/foo/a.js
    ✓ noop test

  1 passing (54ms)

(test hangs until mocha times out)

As noted, if you downgrade to sequelize 5.8.8, the problem goes away.

Environment

Dialect library version: mysql1.6.5
Database version: mysql Ver 14.14 Distrib 5.7.23, for osx10.13 (x86_64) using EditLine wrapper
Sequelize version: 5.8.9
Node Version: happens in both node 8 and 10
OS: MacOS 10.13.6
Tested with latest release:

  • No
  • Yes, specify that version: 5.8.9

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