From d1713f93b37d64a4a275191392fba23e00c716a0 Mon Sep 17 00:00:00 2001 From: Tobias Johansson Date: Tue, 19 Feb 2019 14:16:28 +0100 Subject: [PATCH] Notifications regression: Notifications not created Notifications for when someone posted a comment on your node was not created. Root cause was that default values defined in schema was not set, resulting in activity subscriptions not being active. There were 2 bugs preventing them to be set: * The way the caching of markdown as html was implemented caused default values not to be set. * Eve/Cerberus regression causes nested default values to fail https://github.com/pyeve/eve/issues/1174 Also, a 3rd bug caused nodes without a parent not to have a subscription. Migration scripts: How markdown fields is cached has changed, and unused properties of attachments has been removed. ./manage.py maintenance replace_pillar_node_type_schemas Set the default values of activities-subscription ./manage.py maintenance fix_missing_activities_subscription_defaults --- tests/test_subversion.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_subversion.py b/tests/test_subversion.py index 48661b7..edda2e7 100644 --- a/tests/test_subversion.py +++ b/tests/test_subversion.py @@ -2,10 +2,10 @@ """Unit test for SVN interface.""" -import collections import datetime import logging.config import unittest +from time import sleep from bson import ObjectId from dateutil.tz import tzutc @@ -391,6 +391,12 @@ class SvnTaskLoggedTest(AbstractAttractTest): with self.app.test_request_context(): _, token = cli.create_svner_account('svner@example.com', self.project['url']) + # !! UGLY !! + # The '_created' timestamp resolution is to low. Therefor both created and commit activity can get the same + # created timestamp, and then the ordering of activities is non-deterministic. + # So lets slow things down a little. + sleep(0.001) + # Do the push msg = '¡is a tie! commit to task [%s]' % shortcode self.post('/attract/api/%s/subversion/log' % self.project['url'],