本文整理汇总了Python中lib.tarantool_server.TarantoolServer.crash_expected方法的典型用法代码示例。如果您正苦于以下问题:Python TarantoolServer.crash_expected方法的具体用法?Python TarantoolServer.crash_expected怎么用?Python TarantoolServer.crash_expected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.tarantool_server.TarantoolServer
的用法示例。
在下文中一共展示了TarantoolServer.crash_expected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TarantoolServer
# 需要导入模块: from lib.tarantool_server import TarantoolServer [as 别名]
# 或者: from lib.tarantool_server.TarantoolServer import crash_expected [as 别名]
master.admin('box.space._cluster:delete{%d} ~= nil' % replica_id)
print '-------------------------------------------------------------'
print 'JOIN replica to read-only master'
print '-------------------------------------------------------------'
# master server
master = server
master.admin('box.cfg { read_only = true }')
#gh-1230 Assertion vclock_has on attempt to JOIN read-only master
failed = TarantoolServer(server.ini)
failed.script = 'replication-py/failed.lua'
failed.vardir = server.vardir
failed.rpl_master = master
failed.name = "failed"
failed.crash_expected = True
try:
failed.deploy()
except Exception as e:
line = "ER_READONLY"
if failed.logfile_pos.seek_once(line) >= 0:
print "'%s' exists in server log" % line
master.admin('box.cfg { read_only = false }')
print '-------------------------------------------------------------'
print 'JOIN replica with different replica set UUID'
print '-------------------------------------------------------------'
failed = TarantoolServer(server.ini)
failed.script = 'replication-py/uuid_mismatch.lua'
示例2: TarantoolServer
# 需要导入模块: from lib.tarantool_server import TarantoolServer [as 别名]
# 或者: from lib.tarantool_server.TarantoolServer import crash_expected [as 别名]
import os
import sys
import re
import yaml
from lib.tarantool_server import TarantoolServer
server = TarantoolServer(server.ini)
server.script = 'long_run-py/lua/finalizers.lua'
server.vardir = os.path.join(server.vardir, 'finalizers')
server.crash_expected = True
try:
server.deploy()
except:
print "Expected error:", sys.exc_info()[0]
else:
print "Error! exception did not occur"