hwillson / meteor-stub-collections

Stub out Meteor collections with in-memory local collections.
MIT License
24 stars 17 forks source link

Update sinon to avoid timeouts #30

Closed sebakerckhof closed 6 years ago

sebakerckhof commented 6 years ago

This PR updates sinon. It's kind of hard to explain why it's important, but I'll give it a try:

My first test was timing out when calling the stub function of this library. I found out that this was happening when I had a lot of test files. My investigation revealed that

This can be seen in the attached performance profile ( between 1100ms-1250ms)

sourcemaps - CPU-20180531T160228.zip

Sinon 5 no longer creates this stack trace in the wrapMethod function: https://github.com/sinonjs/sinon/blob/master/lib/sinon/util/core/wrap-method.js#L110

Oh and interestingly enough. The slow piece of code (SourceMapConsumer) that resulted in this timeout is exactly what is being replaced by WASM, which you started working on https://github.com/meteor/meteor/issues/9568#issuecomment-359930688 . So if we can upgrade to source-map v0.7, we can probably also upgrade meteor's source-map-support package and avoid such issues in the first place.

sebakerckhof commented 6 years ago

ping @hwillson

sebakerckhof commented 6 years ago

Actually, I missed one deprecation, gonna do a quick follow-up PR. And in the meantime sinon 6 came out (without breaking changes), but I'll give it a quick test anyway.

hwillson commented 6 years ago

Awesome @sebakerckhof - thanks!

sebakerckhof commented 6 years ago

@hwillson . I opened a new one: https://github.com/hwillson/meteor-stub-collections/pull/31