Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
fa844159
Commit
fa844159
authored
Aug 15, 2022
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
racetest: Factor-out functionality to open another connection to the storage to common function
We will need it in soon for the next test.
parent
c593c7d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
src/ZODB/tests/racetest.py
src/ZODB/tests/racetest.py
+14
-14
No files found.
src/ZODB/tests/racetest.py
View file @
fa844159
...
...
@@ -193,6 +193,18 @@ class RaceTests(object):
def
_new_storage_client
(
self
):
raise
NotImplementedError
# dbopen creates new client storage connection and wraps it with DB.
def
dbopen
(
self
):
try
:
zstor
=
self
.
_new_storage_client
()
except
NotImplementedError
:
# the test will be skipped from main thread because dbopen is
# first used in init on the main thread before any other thread
# is spawned.
self
.
skipTest
(
"%s does not implement _new_storage_client"
%
type
(
self
))
return
DB
(
zstor
)
# verify storage for race in between load and external invalidations.
# https://github.com/zopefoundation/ZEO/issues/155
#
...
...
@@ -206,21 +218,9 @@ class RaceTests(object):
def
_check_race_load_vs_external_invalidate
(
self
,
spec
):
assert
isinstance
(
spec
,
ISpec
)
# dbopen creates new client storage connection and wraps it with DB.
def
dbopen
():
try
:
zstor
=
self
.
_new_storage_client
()
except
NotImplementedError
:
# the test will be skipped from main thread because dbopen is
# first used in init on the main thread before any other thread
# is spawned.
self
.
skipTest
(
"%s does not implement _new_storage_client"
%
type
(
self
))
return
DB
(
zstor
)
# init initializes the database according to the spec.
def
init
():
db
=
dbopen
()
db
=
self
.
dbopen
()
_state_init
(
db
,
spec
)
db
.
close
()
...
...
@@ -246,7 +246,7 @@ class RaceTests(object):
failure
=
[
None
]
*
nwork
# [tx] is failure from T(tx)
def
T
(
tx
,
N
):
db
=
dbopen
()
db
=
self
.
dbopen
()
def
t_
():
transaction
.
begin
()
...
...
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