Skip to content

Flaky tests on 1.0.6 #23

Open
Open
@sebakerckhof

Description

@sebakerckhof

My tests have gotten flaky since going to 1.0.6 (the version wasn't locked, so I'm not sure what version I was running before, but it was about 2 weeks ago they were last being run).

Before, collection hooks weren't being called at all, and now suddenly they are being called. But since I typically don't want these hooks to be called when running unit tests (well, except if I'm testing the hook itself), I changed all my insert/update/remove calls to be on the .direct collection.

And while the changelog says these should also be stubbed, the behavior seems to be very flaky.

It seems to run correct on the first run, but on a rebuild (e.g. when changing a test) things seem to go wrong every so often and in random ways.

Errors coming from npm-mongo on collections that should have been stubbed, like:

‣
Error: E11000 duplicate key error collection: meteor.meetings index: _id_ dup key: { : "aaa" }WriteError({"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: meteor.meetings index: _id_ dup key: { : \"aaa\" }","op":{"_id":"aaa","state":2,"endDate":"2017-11-28T17:52:37.668Z"}})
    at Function.MongoError.create (

And find-s that seems to not find results that have clearly been inserted.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions