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
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
d0f59e50
Commit
d0f59e50
authored
Nov 27, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP [ERP5] TaskDistribution: start a random test instead of looking for the smaller int_index
This prevent getting DB read/write conflicts
parent
e8ac9541
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
product/ERP5/Tool/TaskDistributionTool.py
product/ERP5/Tool/TaskDistributionTool.py
+14
-6
No files found.
product/ERP5/Tool/TaskDistributionTool.py
View file @
d0f59e50
...
...
@@ -231,18 +231,26 @@ class TaskDistributionTool(BaseTool):
if
test_result
.
getSimulationState
()
!=
'started'
:
return
started_list
=
[]
for
line
in
test_result
.
objectValues
(
portal_type
=
"Test Result Line"
,
sort_on
=
[(
"int_index"
,
"ascending"
)]):
# Look for a test to run
# As many nodes may call this function at the same time,
# fetching all lines will create read/write DB conflicts
# To prevent this, randomize the list of documents to check
# and stop as soon as one test to run is found
line_id_list
=
[
x
for
x
in
test_result
.
objectIds
()]
random
.
shuffle
(
line_id_list
)
for
line_id
in
line_id_list
:
line
=
test_result
[
line_id
]
if
(
line
.
getPortalType
()
!=
'Test Result Line'
):
continue
test
=
line
.
getTitle
()
if
test
not
in
exclude_list
:
state
=
line
.
getSimulationState
()
test
=
line
.
getRelativeUrl
(),
test
if
state
==
'draft'
:
if
line
.
getSimulationState
()
==
'draft'
:
if
node_title
:
node
=
self
.
_getTestNodeRelativeUrl
(
node_title
)
line
.
setSource
(
node
)
line
.
start
()
return
test
return
line
.
getRelativeUrl
(),
test
security
.
declarePublic
(
'stopUnitTest'
)
def
stopUnitTest
(
self
,
test_path
,
status_dict
,
node_title
=
None
):
...
...
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