-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add test to make sure we release the ICorProfilerCallback interfaces #41855
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
Conversation
|
Tagging subscribers to this area: @tommcdon |
sdmaclea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Terminate the wait loop on test complete
- Return result!=100 when test fails.
josalem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to see a test to catch this scenario 👍
src/tests/profiler/native/releaseonshutdown/releaseonshutdown.h
Outdated
Show resolved
Hide resolved
We don't actually release any ICorProfilerCallback* on shutdown, we only do on detach
sdmaclea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits
noahfalk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM : )
A recurring issue is that we add a new ICorProfilerCallback* interface and then forget to add the code to ~EEToProfInterfaceImpl to release it. See #41791 and #10756 for examples.
This test verifies that its destructor is called after detaching. As far as I can reason there isn't a good way to directly assert that all ICorProfilerCallback* interfaces are released, but in order to test new APIs we would have to change the base Profiler test class to inherit from that interface. So, unless we check in code without tests this will provide coverage.