Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAC-5743: unit test doesn't exit after upgrading mocha to 4.0.1 #318

Merged
merged 1 commit into from
Nov 10, 2017
Merged

RAC-5743: unit test doesn't exit after upgrading mocha to 4.0.1 #318

merged 1 commit into from
Nov 10, 2017

Conversation

PengTian0
Copy link
Contributor

@PengTian0 PengTian0 commented Nov 8, 2017

Paired with @mcgG
Unit test doesn't exit after upgrading mocha to 4.0.1 because the new version of mocha won't exit if there are running process.
There are 3 kinds of cases that make mocha hangs

  1. amqp: try to reconnect after disconnect(connection.disconnect() fires the error handler with connection reset postwait/node-amqp#462).
    Fix: set the option "reconnect" to false in stop() to avoid the issue.
  2. statsd: the socket is not closed after call statsd.stop()
    Fix: call close() in stop() to close socket.
  3. stub object messenger without restore. That leads to the messenger.stop() failed to stop amqp connection.
    Fix: replace stub object with stub method of object in beforeEach. The stubbed methods will be restored in afterEach().

@mcgG @anhou @pengz1

@mcgG
Copy link
Contributor

mcgG commented Nov 9, 2017

👍 +1

Copy link
Member

@anhou anhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@anhou anhou merged commit b91b593 into RackHD:master Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants