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
Laurent S
erp5
Commits
41d15f3a
Commit
41d15f3a
authored
Feb 07, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testERP5Catalog: Clarify test_48_ERP5Site_hotReindexAll
parent
331dd60c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
32 deletions
+24
-32
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+24
-32
No files found.
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
41d15f3a
...
...
@@ -1073,21 +1073,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
len
(
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
limit
=
None
)))
ctool
.
default_result_limit
=
old_default_result_limit
def
playActivityList
(
self
,
method_id_list
):
self
.
commit
()
portal_activities
=
self
.
getActivityTool
()
for
i
in
range
(
0
,
100
):
message_list
=
portal_activities
.
getMessageList
()
for
message
in
message_list
:
#if message.method_id=='_setHotReindexingState':
# import pdb;pdb.set_trace()
if
message
.
method_id
in
method_id_list
:
try
:
portal_activities
.
manageInvoke
(
message
.
object_path
,
message
.
method_id
)
except
ActivityFlushError
,
m
:
pass
self
.
commit
()
def
test_48_ERP5Site_hotReindexAll
(
self
):
"""
test the hot reindexing of catalog -> catalog2
...
...
@@ -1200,31 +1185,33 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
deleted_url
=
self
.
deleted_organisation
.
getRelativeUrl
()
module
.
manage_delObjects
(
ids
=
[
self
.
deleted_organisation
.
getId
()])
self
.
commit
()
# We will invoke acitivities one by one in order to make sure we can test
# the double indexing state of hot reindexing
self
.
playActivityList
((
'Folder_reindexAll'
,
'InventoryModule_reindexMovementList'
,
'immediateReindexObject'
,
'Folder_reindexObjectList'
,
'unindexObject'
,
'recursiveImmediateReindexObject'
))
query
=
self
.
portal
.
cmf_activity_sql_connection
().
query
query
(
'update message set processing_node=-4 where method_id in '
'("playBackRecordedObjectList", "_finishHotReindexing")'
,
)
hasNoProcessableMessage
=
lambda
message_list
:
all
(
x
.
processing_node
==
-
4
for
x
in
message_list
)
self
.
tic
(
stop_condition
=
hasNoProcessableMessage
)
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
HOT_REINDEXING_DOUBLE_INDEXING_STATE
)
# try to delete objects in double indexing state
module
.
manage_delObjects
(
ids
=
[
self
.
organisation2
.
getId
()])
self
.
playActivityList
((
'immediateReindexObject'
,
'unindexObject'
,
'recursiveImmediateReindexObject'
,
'playBackRecordedObjectList
'
,
'getId'
,
'_setHotReindexingState'
)
)
self
.
commit
()
query
(
'update message set processing_node=-1 where '
'method_id="playBackRecordedObjectList"
'
,
)
self
.
tic
(
stop_condition
=
hasNoProcessableMessage
)
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
HOT_REINDEXING_DOUBLE_INDEXING_STATE
)
# Now we have started an double indexing
self
.
next_deleted_organisation
=
module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
"GreatTitle2"
,
id
=
'toto'
)
next_deleted_url
=
self
.
next_deleted_organisation
.
getRelativeUrl
()
self
.
commit
()
self
.
playActivityList
((
'immediateReindexObject'
,
'recursiveImmediateReindexObject'
,))
self
.
tic
(
stop_condition
=
hasNoProcessableMessage
)
path_list
=
[
next_deleted_url
]
self
.
checkRelativeUrlInSQLPathList
(
path_list
,
connection_id
=
self
.
new_connection_id
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
,
connection_id
=
self
.
original_connection_id
)
...
...
@@ -1233,6 +1220,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
#after the hot reindexing
self
.
organisation4
=
module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
"GreatTitle2"
)
self
.
commit
()
query
(
'update message set processing_node=-1 where '
'method_id="_finishHotReindexing"'
,
)
self
.
tic
()
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
HOT_REINDEXING_FINISHED_STATE
)
...
...
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