Commit ddd3e26c authored by Jérome Perrin's avatar Jérome Perrin

Repair testFunctionalStandaloneUserTutorial

Test was never ending processing activities:

```
2019-03-11T03:09:20 WARNING CMFActivity invalid after_path_and_method_id value: ('/erp5/organisation_module/2', 'immediateRecusriveReindexObject', 'immediateReindexObject')
Traceback (most recent call last):
  File "product/CMFActivity/Activity/SQLBase.py", line 319, in getValidationSQL
    validate_list.append(' AND '.join(method(v, quote)))
  File "product/CMFActivity/Activity/SQLBase.py", line 345, in _validate_after_path_and_method_id
    path, method_id = value
ValueError: too many values to unpack
2019-03-11T03:09:20 WARNING CMFActivity invalid after_path_and_method_id value: ('/erp5/organisation_module/2', 'immediateRecusriveReindexObject', 'immediateReindexObject')
Traceback (most recent call last):
  File "product/CMFActivity/Activity/SQLBase.py", line 319, in getValidationSQL
    validate_list.append(' AND '.join(method(v, quote)))
  File "product/CMFActivity/Activity/SQLBase.py", line 345, in _validate_after_path_and_method_id
    path, method_id = value
ValueError: too many values to unpack
2019-03-11T03:09:20 WARNING CMFActivity invalid after_path_and_method_id value: ('/erp5/organisation_module/2', 'immediateRecusriveReindexObject', 'immediateReindexObject')
Traceback (most recent call last):
  File "product/CMFActivity/Activity/SQLBase.py", line 319, in getValidationSQL
    validate_list.append(' AND '.join(method(v, quote)))
  File "product/CMFActivity/Activity/SQLBase.py", line 345, in _validate_after_path_and_method_id
    path, method_id = value
ValueError: too many values to unpack
2019-03-11T03:09:20 ERROR CMFActivity message uid 7256619472683296857L has a circular dependency
 ```

Fix this failing test by using the proper `after_path_and_method_id` syntax and also some other small changes to make the test fail earlier in case of problems.

/reviewed-on nexedi/erp5!844
parents 1f254aa7 494f871f
from time import sleep from Products.CMFActivity.Activity.Queue import VALIDATION_ERROR_DELAY
def waitForActivities(self, count=1000): def waitForActivities(self, count=1000):
""" """
...@@ -8,14 +8,16 @@ def waitForActivities(self, count=1000): ...@@ -8,14 +8,16 @@ def waitForActivities(self, count=1000):
to finish activities. to finish activities.
""" """
activity_tool = self.getPortalObject().portal_activities activity_tool = self.getPortalObject().portal_activities
for x in xrange(count): while count > 0:
count -= 1
x = activity_tool.getMessageList() x = activity_tool.getMessageList()
if not x: if not x:
return 'Done.' return 'Done.'
if all(x.processing_node == -2 for x in x): if all(x.processing_node == -2 for x in x):
break break
activity_tool.process_timer(None, None) activity_tool.process_timer(None, None)
sleep(1) if count % 10 == 0:
activity_tool.timeShift(3 * VALIDATION_ERROR_DELAY)
raise RuntimeError('tic is looping forever.') raise RuntimeError('tic is looping forever.')
def UpdateImage(image): def UpdateImage(image):
......
...@@ -95,7 +95,7 @@ pref.setPreferredHtmlStyleUnsavedFormWarning(False) ...@@ -95,7 +95,7 @@ pref.setPreferredHtmlStyleUnsavedFormWarning(False)
my_organisation.activate( my_organisation.activate(
after_path_and_method_id=( after_path_and_method_id=(
my_organisation.getPath(), 'immediateRecusriveReindexObject', 'immediateReindexObject')) \ my_organisation.getPath(), ('immediateRecusriveReindexObject', 'immediateReindexObject'))) \
.Organisation_addConditionallyAccountingPeriod() .Organisation_addConditionallyAccountingPeriod()
for rule_reference in ('default_delivering_rule', for rule_reference in ('default_delivering_rule',
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td tal:content="python: <td tal:content="python:
here.Zuite_getHowToInfo()['manager_username']"></td> here.Zuite_getHowToInfo()['manager_username']"></td>
<td></td> <td></td>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td>Done.</td> <td>Done.</td>
<td></td> <td></td>
</tr> </tr>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td>Done.</td> <td>Done.</td>
<td></td> <td></td>
</tr> </tr>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td>Done.</td> <td>Done.</td>
<td></td> <td></td>
</tr> </tr>
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td tal:content="python: <td tal:content="python:
here.Zuite_getHowToInfo()['functional_test_username']"></td> here.Zuite_getHowToInfo()['functional_test_username']"></td>
<td></td> <td></td>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td>Init Ok.</td> <td>Init Ok.</td>
<td></td> <td></td>
</tr> </tr>
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td>Done.</td> <td>Done.</td>
<td></td> <td></td>
</tr> </tr>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td tal:content="python: <td tal:content="python:
here.Zuite_getHowToInfo()['functional_another_test_username']"></td> here.Zuite_getHowToInfo()['functional_another_test_username']"></td>
<td></td> <td></td>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td>Init Ok.</td> <td>Init Ok.</td>
<td></td> <td></td>
</tr> </tr>
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>assertTextPresent</td>
<td tal:content="python: <td tal:content="python:
here.Zuite_getHowToInfo()['person_howto_reference']"></td> here.Zuite_getHowToInfo()['person_howto_reference']"></td>
<td></td> <td></td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment