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
alecs_myu
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
Hide 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):
...
@@ -1073,21 +1073,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
len
(
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
limit
=
None
)))
len
(
self
.
getCatalogTool
()(
portal_type
=
'Organisation'
,
limit
=
None
)))
ctool
.
default_result_limit
=
old_default_result_limit
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
):
def
test_48_ERP5Site_hotReindexAll
(
self
):
"""
"""
test the hot reindexing of catalog -> catalog2
test the hot reindexing of catalog -> catalog2
...
@@ -1200,31 +1185,33 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1200,31 +1185,33 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
deleted_url
=
self
.
deleted_organisation
.
getRelativeUrl
()
deleted_url
=
self
.
deleted_organisation
.
getRelativeUrl
()
module
.
manage_delObjects
(
ids
=
[
self
.
deleted_organisation
.
getId
()])
module
.
manage_delObjects
(
ids
=
[
self
.
deleted_organisation
.
getId
()])
self
.
commit
()
self
.
commit
()
# We will invoke acitivities one by one in order to make sure we can test
query
=
self
.
portal
.
cmf_activity_sql_connection
().
query
# the double indexing state of hot reindexing
query
(
self
.
playActivityList
((
'Folder_reindexAll'
,
'update message set processing_node=-4 where method_id in '
'InventoryModule_reindexMovementList'
,
'("playBackRecordedObjectList", "_finishHotReindexing")'
,
'immediateReindexObject'
,
)
'Folder_reindexObjectList'
,
hasNoProcessableMessage
=
lambda
message_list
:
all
(
'unindexObject'
,
x
.
processing_node
==
-
4
'recursiveImmediateReindexObject'
))
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
# try to delete objects in double indexing state
module
.
manage_delObjects
(
ids
=
[
self
.
organisation2
.
getId
()])
module
.
manage_delObjects
(
ids
=
[
self
.
organisation2
.
getId
()])
self
.
playActivityList
((
'immediateReindexObject'
,
self
.
commit
()
'unindexObject'
,
query
(
'recursiveImmediateReindexObject'
,
'update message set processing_node=-1 where '
'playBackRecordedObjectList
'
,
'method_id="playBackRecordedObjectList"
'
,
'getId'
,
)
'_setHotReindexingState'
)
)
self
.
tic
(
stop_condition
=
hasNoProcessableMessage
)
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
HOT_REINDEXING_DOUBLE_INDEXING_STATE
)
HOT_REINDEXING_DOUBLE_INDEXING_STATE
)
# Now we have started an double indexing
# Now we have started an double indexing
self
.
next_deleted_organisation
=
module
.
newContent
(
portal_type
=
'Organisation'
,
self
.
next_deleted_organisation
=
module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
"GreatTitle2"
,
id
=
'toto'
)
title
=
"GreatTitle2"
,
id
=
'toto'
)
next_deleted_url
=
self
.
next_deleted_organisation
.
getRelativeUrl
()
next_deleted_url
=
self
.
next_deleted_organisation
.
getRelativeUrl
()
self
.
commit
()
self
.
tic
(
stop_condition
=
hasNoProcessableMessage
)
self
.
playActivityList
((
'immediateReindexObject'
,
'recursiveImmediateReindexObject'
,))
path_list
=
[
next_deleted_url
]
path_list
=
[
next_deleted_url
]
self
.
checkRelativeUrlInSQLPathList
(
path_list
,
connection_id
=
self
.
new_connection_id
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
,
connection_id
=
self
.
new_connection_id
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
,
connection_id
=
self
.
original_connection_id
)
self
.
checkRelativeUrlInSQLPathList
(
path_list
,
connection_id
=
self
.
original_connection_id
)
...
@@ -1233,6 +1220,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
...
@@ -1233,6 +1220,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
#after the hot reindexing
#after the hot reindexing
self
.
organisation4
=
module
.
newContent
(
portal_type
=
'Organisation'
,
self
.
organisation4
=
module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
"GreatTitle2"
)
title
=
"GreatTitle2"
)
self
.
commit
()
query
(
'update message set processing_node=-1 where '
'method_id="_finishHotReindexing"'
,
)
self
.
tic
()
self
.
tic
()
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
self
.
assertEqual
(
portal_catalog
.
getHotReindexingState
(),
HOT_REINDEXING_FINISHED_STATE
)
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