Exemplo n.º 1
0
def test_module_fresh_timeout():

    actor_config = ActorConfig('fresh', 100, 1, {}, "")
    fresh = Fresh(actor_config, timeout=1)
    fresh.pool.queue.inbox.disableFallThrough()
    fresh.pool.queue.outbox.disableFallThrough()
    fresh.pool.queue.timeout.disableFallThrough()

    fresh.start()
    sleep(2)
    one = getter(fresh.pool.queue.timeout)
    fresh.stop()

    assert one.get() == "timeout"
Exemplo n.º 2
0
def test_module_fresh_timeout():

    actor_config = ActorConfig('fresh', 100, 1, {}, "")
    fresh = Fresh(actor_config, timeout=1)
    fresh.pool.queue.inbox.disableFallThrough()
    fresh.pool.queue.outbox.disableFallThrough()
    fresh.pool.queue.timeout.disableFallThrough()

    fresh.start()
    sleep(2)
    one = getter(fresh.pool.queue.timeout)
    fresh.stop()

    assert one.get() == "timeout"
Exemplo n.º 3
0
def test_module_fresh_default():

    actor_config = ActorConfig('fresh', 100, 1, {}, "")
    fresh = Fresh(actor_config)
    fresh.pool.queue.inbox.disableFallThrough()
    fresh.pool.queue.outbox.disableFallThrough()
    fresh.pool.queue.timeout.disableFallThrough()

    fresh.start()

    e = Event("hello")

    fresh.pool.queue.inbox.put(e)
    one = getter(fresh.pool.queue.outbox)
    fresh.stop()

    assert one.get() == "hello"
Exemplo n.º 4
0
def test_module_fresh_default():

    actor_config = ActorConfig('fresh', 100, 1, {}, "")
    fresh = Fresh(actor_config)
    fresh.pool.queue.inbox.disableFallThrough()
    fresh.pool.queue.outbox.disableFallThrough()
    fresh.pool.queue.timeout.disableFallThrough()

    fresh.start()

    e = Event("hello")

    fresh.pool.queue.inbox.put(e)
    one = getter(fresh.pool.queue.outbox)
    fresh.stop()

    assert one.get() == "hello"
Exemplo n.º 5
0
def test_module_fresh_recovery():

    actor_config = ActorConfig('fresh', 100, 1, {}, "")
    fresh = Fresh(actor_config, timeout=1)
    fresh.pool.queue.inbox.disableFallThrough()
    fresh.pool.queue.outbox.disableFallThrough()
    fresh.pool.queue.timeout.disableFallThrough()

    fresh.start()
    sleep(1)
    one = getter(fresh.pool.queue.timeout)
    event = Event("test")
    fresh.pool.queue.inbox.put(event)
    sleep(1)
    two = getter(fresh.pool.queue.timeout)
    fresh.stop()

    assert two.get() == "recovery"
Exemplo n.º 6
0
def test_module_fresh_recovery():

    actor_config = ActorConfig('fresh', 100, 1, {}, "")
    fresh = Fresh(actor_config, timeout=1)
    fresh.pool.queue.inbox.disableFallThrough()
    fresh.pool.queue.outbox.disableFallThrough()
    fresh.pool.queue.timeout.disableFallThrough()

    fresh.start()
    sleep(1)
    one = getter(fresh.pool.queue.timeout)
    event = Event("test")
    fresh.pool.queue.inbox.put(event)
    sleep(1)
    two = getter(fresh.pool.queue.timeout)
    fresh.stop()

    assert two.get() == "recovery"