Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
a979165a
Commit
a979165a
authored
Oct 09, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stress: fix SQLite support and make it usable even if MySQLdb is not installed
parent
b0a6b8ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
neo/tests/__init__.py
neo/tests/__init__.py
+2
-1
neo/tests/functional/__init__.py
neo/tests/functional/__init__.py
+0
-1
tools/stress
tools/stress
+4
-1
No files found.
neo/tests/__init__.py
View file @
a979165a
...
@@ -26,7 +26,6 @@ import sys
...
@@ -26,7 +26,6 @@ import sys
import
tempfile
import
tempfile
import
unittest
import
unittest
import
weakref
import
weakref
import
MySQLdb
import
transaction
import
transaction
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
...
@@ -141,6 +140,7 @@ def getTempDirectory():
...
@@ -141,6 +140,7 @@ def getTempDirectory():
def
setupMySQLdb
(
db_list
,
clear_databases
=
True
):
def
setupMySQLdb
(
db_list
,
clear_databases
=
True
):
if
mysql_pool
:
if
mysql_pool
:
return
mysql_pool
.
setup
(
db_list
,
clear_databases
)
return
mysql_pool
.
setup
(
db_list
,
clear_databases
)
import
MySQLdb
from
MySQLdb.constants.ER
import
BAD_DB_ERROR
from
MySQLdb.constants.ER
import
BAD_DB_ERROR
user
=
DB_USER
user
=
DB_USER
password
=
''
password
=
''
...
@@ -178,6 +178,7 @@ class MySQLPool(object):
...
@@ -178,6 +178,7 @@ class MySQLPool(object):
self
.
kill
(
*
self
.
_mysqld_dict
)
self
.
kill
(
*
self
.
_mysqld_dict
)
def
setup
(
self
,
db_list
,
clear_databases
):
def
setup
(
self
,
db_list
,
clear_databases
):
import
MySQLdb
start_list
=
set
(
db_list
).
difference
(
self
.
_mysqld_dict
)
start_list
=
set
(
db_list
).
difference
(
self
.
_mysqld_dict
)
if
start_list
:
if
start_list
:
start_list
=
sorted
(
start_list
)
start_list
=
sorted
(
start_list
)
...
...
neo/tests/functional/__init__.py
View file @
a979165a
...
@@ -22,7 +22,6 @@ import ZODB
...
@@ -22,7 +22,6 @@ import ZODB
import
socket
import
socket
import
signal
import
signal
import
random
import
random
import
MySQLdb
import
sqlite3
import
sqlite3
import
unittest
import
unittest
import
tempfile
import
tempfile
...
...
tools/stress
View file @
a979165a
...
@@ -650,11 +650,14 @@ def main():
...
@@ -650,11 +650,14 @@ def main():
parser
.
error
(
parser
.
error
(
'--datadir: meaningless when using an existing MySQL server'
)
'--datadir: meaningless when using an existing MySQL server'
)
kw
=
{
'wait'
:
-
1
}
if
args
.
engine
:
kw
[
'engine'
]
=
args
.
engine
kw
=
dict
(
db_list
=
db_list
,
name
=
'stress'
,
kw
=
dict
(
db_list
=
db_list
,
name
=
'stress'
,
partitions
=
args
.
partitions
,
replicas
=
args
.
replicas
,
partitions
=
args
.
partitions
,
replicas
=
args
.
replicas
,
adapter
=
args
.
adapter
,
address_type
=
args
.
address_type
,
adapter
=
args
.
adapter
,
address_type
=
args
.
address_type
,
temp_dir
=
args
.
logdir
or
args
.
datadir
or
getTempDirectory
(),
temp_dir
=
args
.
logdir
or
args
.
datadir
or
getTempDirectory
(),
storage_kw
=
{
'engine'
:
args
.
engine
,
'wait'
:
-
1
}
)
storage_kw
=
kw
)
if
args
.
command
==
'run'
:
if
args
.
command
==
'run'
:
NFQueue
.
delay
=
args
.
delay
NFQueue
.
delay
=
args
.
delay
...
...
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