Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
analysis: Fix leaks in call stack tests and analysis waitForCompletion
In unit tests that extend CallStackTestBase, the CallGraphAnalysis gets a CompositeHostModel that is never disposed. The models can be disposed in the @after method of the test, however for this to work, the analysis must be completed before the test ends. In CallStackTestBase, the @before method schedules the CallStackAnalysisStub(InstrumentedCallStackAnalysis) and waits for its completion before executing the test. However, when the InstrumentedCallStackAnalysis completes its execution, it schedules a CallGraphAnalysis and does not wait for its completion. This can cause the model to be created after the test has completed and attempted to dispose the models, and causes a leak. The InstrumentedCallStackAnalysis waitForCompletion methods should additionally wait for completion of the CallGraphAnalysis. However, the CallGraphAnalysis is setup to have the InstrumentedCallStackAnalysis as a dependent analysis, so this now causes a deadlock as each analysis is waiting for the other to complete. Normally an analysis that has dependent analyses will schedule these and wait for completion before executing itself. But in this case it is the InstrumentedCallStackAnalysis that executes to completion before scheduling the CallGraphAnalysis, so the latter does not need to have the former as a dependent analysis. In other tests that do not extend CallStackTestBase, dispose the models in the @after method. Change-Id: I154d9d1eda7ca43740191f7fda34786c53f69b05 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/202591 Tested-by: Marco Miller <marco.miller@ericsson.com> Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org> Reviewed-by: Marco Miller <marco.miller@ericsson.com>
- Loading branch information
1 parent
78881b4
commit 16f9917
Showing
7 changed files
with
63 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters