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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
3255f158
Commit
3255f158
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
42079e95
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 @
3255f158
...
@@ -231,18 +231,26 @@ class TaskDistributionTool(BaseTool):
...
@@ -231,18 +231,26 @@ class TaskDistributionTool(BaseTool):
if
test_result
.
getSimulationState
()
!=
'started'
:
if
test_result
.
getSimulationState
()
!=
'started'
:
return
return
started_list
=
[]
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
()
test
=
line
.
getTitle
()
if
test
not
in
exclude_list
:
if
test
not
in
exclude_list
:
state
=
line
.
getSimulationState
()
if
line
.
getSimulationState
()
==
'draft'
:
test
=
line
.
getRelativeUrl
(),
test
if
state
==
'draft'
:
if
node_title
:
if
node_title
:
node
=
self
.
_getTestNodeRelativeUrl
(
node_title
)
node
=
self
.
_getTestNodeRelativeUrl
(
node_title
)
line
.
setSource
(
node
)
line
.
setSource
(
node
)
line
.
start
()
line
.
start
()
return
test
return
line
.
getRelativeUrl
(),
test
security
.
declarePublic
(
'stopUnitTest'
)
security
.
declarePublic
(
'stopUnitTest'
)
def
stopUnitTest
(
self
,
test_path
,
status_dict
,
node_title
=
None
):
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