Starting stopping PerfView from unit test framework #1540
Unanswered
kontacthimanshu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a WPF application. As we build/fix the application we try to ensure developers are not introducing memory leaks or bad memory usage. So after every build we test run the application using Appium from Selenium and use PerfView to collect the memory snapshot. From the snapshot we collect GC stats and analyze memory usage from build to build.
Here is what we do at high level:
Here is how we start PerfView (This code is executed from test initialize method):
Here is how we stop PerfView (This code is executed from test tear down or clean-up method).
The problem:
As soon as the “stop” command from the code above is issued, PerfView starts to shutdown but it takes a while as it is doing its tasks. What happens is that test clean up finished well before PerfView has actually finished.
What we want is that test clean up should wait for PerfView to finish completely. We have tried the WaitForExit() method of System.Diagnostic.Process class to wait for PerfView for at least 30 minutes but it is not working out.
It could not be PerfView issue. Wanted to check if there are two processes involved in PerfView (foreground and background). So the C# might just be dealing with foreground process which finishes sooner.
Beta Was this translation helpful? Give feedback.
All reactions