Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
6e7fdd72
Commit
6e7fdd72
authored
Mar 13, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testCacheTool: use time.sleep to simulate an expensive computation
nowadays we can use time.sleep in restricted python
parent
a64a94e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testCacheTool.py
...TemplateItem/portal_components/test.erp5.testCacheTool.py
+2
-6
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testCacheTool.py
View file @
6e7fdd72
...
...
@@ -368,13 +368,9 @@ return result
py_script_obj
=
getattr
(
portal
,
python_script_id
)
py_script_params
=
"value=10000, long_parameter=''"
py_script_body
=
"""
import time
def veryExpensiveMethod(value):
# do something expensive for some time
# no 'time.sleep()' available in Zope
# so concatenate strings
s = ''
for i in range(0, value):
s = str(value * value * value) + s
time.sleep(1)
return value
veryExpensiveMethod(value)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment