-
Type:
Suggestion
-
Resolution: Timed out
-
None
-
Component/s: Performance, Tests
-
0
Build result pages of failed runs of a particular plan were loading in about 30 seconds. Almost all of this time was being spent under com.atlassian.bamboo.resultsummary.tests.TestsManagerImpl.getTestsForChainResultByDeltaState, even though the results of the corresponding SQL query were small and arrived in no time. It turned out that after performing this query, Hibernate was eagerly loading all TEST_CASE rows, current and historical, and the latter in this patological case (due to user error) was in hundreds of thousands.
The solution was to edit com/atlassian/bamboo/resultsummary/TestResults.hbm.xml in atlassian-bamboo-persistence jar and replace lazy="false" with lazy="true" (since the default in this file is lazy="false") from the relation between TEST_CLASS and TEST_CASE. I do not see where loading all of the TEST_CASEs may be a good idea, and Bamboo does not seem to load them on its own.