Assertion failure due to weak signal receivers having no guarantee of being garbage collected in time #2189
Labels
[C] Backend
Focuses on backend implementation
[P] Minor
Minor priority
[T] Bug
This is a bug. We don't like it. Please get rid of it.
See discussion in #1361.
Our two weak notification receivers (grep
weak=True
) were intended to only be active while the current request is being handled. However, we can not assume this, as garbage collection is not guaranteed. We've had at least two sporadic test failures in the last weeks due to this. To replicate, run the tests with a patchedmanage.py
where you addedto the top and run the tests with
--shuffle=3290553936
(any shuffle where theuser_edit
view is accessed at least once before theevaluation_edit
view test that removes participants and triggers reward point granting.I don't know yet how to properly implement the behavior we intended to have. If may suffice to unregister the signal receiver at the end of the view.
Edit: While we're at it, I think the
grant_reward_points_after_delete
function could use aassert not grantings
in theif reverse
in theif granting
case -- we only expectgrantings
to be set once, otherwise, overwriting of the old value ofgrantings
would be unexpected.The text was updated successfully, but these errors were encountered: