当前位置: 首页>>代码示例>>Python>>正文


Python Waldo.set_default_partner_timeout方法代码示例

本文整理汇总了Python中waldo.lib.Waldo.set_default_partner_timeout方法的典型用法代码示例。如果您正苦于以下问题:Python Waldo.set_default_partner_timeout方法的具体用法?Python Waldo.set_default_partner_timeout怎么用?Python Waldo.set_default_partner_timeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在waldo.lib.Waldo的用法示例。


在下文中一共展示了Waldo.set_default_partner_timeout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run_test

# 需要导入模块: from waldo.lib import Waldo [as 别名]
# 或者: from waldo.lib.Waldo import set_default_partner_timeout [as 别名]
def run_test():
    '''
    Tests Waldo's ability to detect a network failure between two endpoints
    mid-sequence, thrown a NetworkException, and catch that exception using
    a try-catch.
    
    Returns true if the exception is caught and handled, and false otherwise.
    '''
    Waldo.set_default_heartbeat_period(1)
    Waldo.set_default_partner_timeout(3)
    acceptor_process.start()
    time.sleep(SLEEP_TIME)
    connector = Waldo.tcp_connect(Ping,HOST,PORT,signal_func)
    return connector.testNetworkException()
开发者ID:bmistree,项目名称:Waldo,代码行数:16,代码来源:network_exception_mid_sequence_test.py

示例2: run_test

# 需要导入模块: from waldo.lib import Waldo [as 别名]
# 或者: from waldo.lib.Waldo import set_default_partner_timeout [as 别名]
def run_test():
    '''
    Tests that Waldo can detect a network exception mid-sequence and propagate
    that exception back through an endpoint call.

    Returns true if the test passes and false otherwise.
    '''
    Waldo.set_default_heartbeat_period(1)
    Waldo.set_default_partner_timeout(2)
    acceptor_process.start()
    time.sleep(SLEEP_TIME)
    endpt = Waldo.tcp_connect(Ping, HOST, PORT)
    endpt.addTerminationFunction(signal_func)
    catcher = Waldo.no_partner_create(Catcher)
    catcher.addEndpoint(endpt)
    return catcher.testPropagateNetworkExceptionOnEndpointCall()
开发者ID:bmistree,项目名称:Waldo,代码行数:18,代码来源:network_exception_test_propagate_endpoint_call.py

示例3: run_test

# 需要导入模块: from waldo.lib import Waldo [as 别名]
# 或者: from waldo.lib.Waldo import set_default_partner_timeout [as 别名]
def run_test():
    '''
    Tests Waldo's ability to detect a network failure between two endpoints
    mid-sequence, thrown a NetworkException, and catch that exception using
    a try-catch.
    
    Returns true if the exception is caught and handled, and false otherwise.
    '''
    acceptor_process = Process(target=spawn_acceptor,args=())
    Waldo.set_default_heartbeat_period(1)
    Waldo.set_default_partner_timeout(3)
    acceptor_process.start()
    time.sleep(KILL_WAIT_TIME)
    connector = Waldo.tcp_connect(Ping,HOST,PORT)
    time.sleep(KILL_WAIT_TIME)
    acceptor_process.terminate()
    time.sleep(TIMEOUT_DETECT_TIME)
    return connector.testNetworkException()
开发者ID:bmistree,项目名称:Waldo,代码行数:20,代码来源:network_exception_on_call_test.py

示例4: run_test

# 需要导入模块: from waldo.lib import Waldo [as 别名]
# 或者: from waldo.lib.Waldo import set_default_partner_timeout [as 别名]
def run_test():
    '''
    Tests Waldo's capability of propagating a network exception back through
    a sequence. Here we have two pairs of endpoints: (a,b), (c,d). Endpoint a 
    begins a sequence with b, which makes and endpoint call to c, which 
    initiates a sequence with d. Endpoint d is in a separate process which is
    manually terminated mid-sequence, thus a network exception should be
    detected by c and propagated back to a.

    Returns true if the exception is propagated back to the root of the
    event and handled and false otherwise.
    '''
    global acceptor_proc
    Waldo.set_default_heartbeat_period(1)
    Waldo.set_default_partner_timeout(2)
    acceptor_proc.start()
    time.sleep(SLEEP_TIME) # make sure process is ready for tcp_connect
    inner_ping = Waldo.tcp_connect(InnerPing, HOST, PORT_INNER)
    Waldo.tcp_accept(OuterPong, HOST, PORT_OUTER, inner_ping)
    outer_ping = Waldo.tcp_connect(OuterPing, HOST, PORT_OUTER)
    result = outer_ping.testNestedSequencePropagation()
    acceptor_proc.terminate()
    return result
开发者ID:bmistree,项目名称:Waldo,代码行数:25,代码来源:network_exception_nested_sequence_test.py


注:本文中的waldo.lib.Waldo.set_default_partner_timeout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。