Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
5d090a78
Commit
5d090a78
authored
Jun 08, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: check master aborts properly a connection to a buggy storage
parent
6c500078
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+18
-1
No files found.
neo/tests/threaded/test.py
View file @
5d090a78
...
...
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
sys
import
threading
import
transaction
import
unittest
...
...
@@ -23,7 +24,7 @@ from ZODB import POSException
from
neo.storage.transactions
import
TransactionManager
,
\
DelayedError
,
ConflictError
from
neo.lib.connection
import
MTClientConnection
from
neo.lib.protocol
import
NodeStates
,
Packets
,
ZERO_TID
from
neo.lib.protocol
import
ClusterStates
,
NodeStates
,
Packets
,
ZERO_TID
from
.
import
NEOCluster
,
NEOThreadedTest
,
Patch
from
neo.lib.util
import
makeChecksum
from
neo.client.pool
import
CELL_CONNECTED
,
CELL_GOOD
...
...
@@ -449,6 +450,22 @@ class Test(NEOThreadedTest):
cluster1
.
stop
()
cluster2
.
stop
()
def
testAbortStorage
(
self
):
cluster
=
NEOCluster
(
partitions
=
2
,
storage_count
=
2
)
storage
=
cluster
.
storage_list
[
0
]
try
:
cluster
.
start
()
# prevent storage to reconnect, in order to easily test
# that cluster becomes non-operational
storage
.
connectToPrimary
=
sys
.
exit
# send an unexpected to master so it aborts connection to storage
storage
.
master_conn
.
answer
(
Packets
.
Pong
())
cluster
.
tic
(
force
=
1
)
self
.
assertEqual
(
cluster
.
neoctl
.
getClusterState
(),
ClusterStates
.
VERIFYING
)
finally
:
cluster
.
stop
()
if
__name__
==
"__main__"
:
unittest
.
main
()
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