Skip to content

Add test to make sure we release the ICorProfilerCallback interfaces - #41855

Merged
davmason merged 7 commits into
dotnet:masterfrom
davmason:release_test
Sep 15, 2020
Merged

Add test to make sure we release the ICorProfilerCallback interfaces#41855
davmason merged 7 commits into
dotnet:masterfrom
davmason:release_test

Conversation

@davmason

Copy link
Copy Markdown
Contributor

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.

@davmasondavmason added this to the 6.0.0 milestone Sep 4, 2020
@davmason
davmason requested a review from a teamSeptember 4, 2020 06:49
@davmasondavmason self-assigned this Sep 4, 2020
@ghost

ghost commented Sep 4, 2020

Copy link
Copy Markdown

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@davmason

Copy link
Copy Markdown
ContributorAuthor

@noahfalk@sywhang @dotnet/dotnet-diag does anybody have time to review this?

@sdmacleasdmaclea left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadsrc/tests/profiler/unittest/releaseonshutdown.cs

@josalemjosalem left a comment

Copy link
Copy Markdown
Contributor

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 👍

Comment threadsrc/tests/profiler/unittest/releaseonshutdown.cs Outdated
Comment threadsrc/tests/profiler/native/releaseonshutdown/releaseonshutdown.h Outdated
Comment threadsrc/tests/profiler/unittest/releaseonshutdown.cs Outdated
Comment threadsrc/tests/profiler/native/releaseondetach/releaseondetach.cpp Outdated

@sdmacleasdmaclea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits

@noahfalknoahfalk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM : )

Comment threadsrc/tests/profiler/unittest/releaseondetach.cs Outdated
@davmason
davmason merged commit 6ed3261 into dotnet:masterSep 15, 2020
@ghostghost locked as resolved and limited conversation to collaborators Dec 7, 2020
@davmason
davmason deleted the release_test branch January 20, 2021 08:58
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@davmason@noahfalk@josalem@sdmaclea@sywhang