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

Fix test for sync unsubscribe, to work with real DB (sharedb-mongo) #368

Merged
merged 2 commits into from
May 13, 2020

Conversation

ericyhwang
Copy link
Contributor

Background: sharedb's tests get included and run inside of sharedb-mongo as well.

share/sharedb-mongo#88 revealed that the new test case added in #358 for "unsubscribes synchronously" doesn't work in sharedb-mongo's test suite, which has a DB connection per test case and closes that connection after the test. The second client's op submission then results in:

Error: Already closed (and Mocha's done() called multiple times)

This PR moves the done() in the test to after the second client has successfully submitted. If the first client is incorrectly still subscribed and receives the op through a subscription, that will still correctly cause the test case to fail with "Already closed (and Mocha's done() called multiple times)".

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.356% when pulling 5c1dc96 on fix-tests-sync-unsub into 32fdb30 on master.

@ericyhwang ericyhwang merged commit 2f7089f into master May 13, 2020
@ericyhwang ericyhwang deleted the fix-tests-sync-unsub branch May 13, 2020 16:50
@curran
Copy link
Contributor

curran commented May 13, 2020

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants