-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Memory leak in tests: sinon.stub() without sinon.restore() #187471
Comments
The biggest gain would be from fixing the leak from |
@sandy081 I don't know if you own instantionServiceMock.ts, but I am looking into a fix for it since it will have the biggest impact. |
@lramos15, I've reopened this. |
This will call `sinon.restore()` and prevent a memory leak Part of #187471
Thanks. I should be careful to not do |
With #187482, I have made |
This will call `sinon.restore()` and prevent a memory leak Part of #187471
@alexr00 For those tests where I am just using |
You can wait for my change to dispose the |
* Dispose instances of test instantiation service This will call `sinon.restore()` and prevent a memory leak Part of #187471 * Fix interfering terminal tests * Remove `async` from terminal test suite * Fix `any`
* Dispose instances of test instantiation service This will call `sinon.restore()` and prevent a memory leak Part of microsoft#187471 * Fix interfering terminal tests * Remove `async` from terminal test suite * Fix `any`
FYI Windows ia32 started turning green again 🥳 https://dev.azure.com/monacotools/Monaco/_build/results?buildId=222587&view=logs&j=306b2268-2a17-5e97-ab97-f41a26dc5206&t=55fb80e7-db05-5adc-8e66-0ba915c72c3e |
👏 Thank you for the fast response everyone! |
In short, if you use
sinon.stub()
without callingsinon.restore()
you are leaking memory.See sinonjs/sinon#1866 for the details.
I'm seeing a lot of memory used in unit tests and it appears to be coming from sinon. This may be contributing to our unit test OOM issue on Windows 32 bit. Let's see if fixing this lets us run the unit tests again.
To fix
instatiationServiceMock.ts
I have madeTestInstantiationService
disposable, and there were some places where tests failed or the refactor seemed larger:The text was updated successfully, but these errors were encountered: