Invalid calculation of %done of parent issues under certain ciscumstances
One of our customers at Planio noticed a bug in the calculation of the %done field for parent issues.
With #14798, you updated the calculation of the done ration for certain edge cases, namely when the estimated_time of a child issue was explicitly set to 0. This patch however doesn't cover the whole issue and leads now to incorrect results (i.e. too large %done, sometimes even larger than 100) if there are closed issues of which some have set estimated_time to 0 and some to something larger.
The cause of the bug is the the calculation of the average doesn't handle
estimated_time set to 0 and thus can produce a too small average which results in an overall too large result.
The attached patch fixes the issue and modifies the test to expose the bug. The bug affects all versions after r12131 (>= 2.3.3).