Exemple #1
0
    time.sleep(0.1)

boot_heights = boot_node.get_all_heights()

assert catch_up_height in boot_heights, "%s not in %s" % (catch_up_height,
                                                          boot_heights)

tracker4.reset(
)  # the transition might have happened before we initialized the tracker
if catch_up_height >= 100:
    assert tracker4.check("transition to State Sync")
elif catch_up_height <= 30:
    assert not tracker4.check("transition to State Sync")

tracker4.reset()
assert tracker4.count("Consolidated connection with FullPeerInfo") == 2

if mode == 'manytx':
    while ctx.get_balances() != ctx.expected_balances:
        assert time.time() - started < TIMEOUT
        print(
            "Waiting for the old node to catch up. Current balances: %s; Expected balances: %s"
            % (ctx.get_balances(), ctx.expected_balances))
        time.sleep(1)

    # requery the balances from the newly started node
    ctx.nodes.append(node4)
    ctx.act_to_val = [2, 2, 2]

    while ctx.get_balances() != ctx.expected_balances:
        assert time.time() - started < TIMEOUT
assert catch_up_height in boot_heights, "%s not in %s" % (catch_up_height,
                                                          boot_heights)

tracker4.reset(
)  # the transition might have happened before we initialized the tracker
if catch_up_height >= 100:
    assert tracker4.check("transition to State Sync")
elif catch_up_height <= 30:
    assert not tracker4.check("transition to State Sync")

while True:
    assert time.time(
    ) - started < TIMEOUT, "Waiting for node 4 to connect to two peers"
    tracker4.reset()
    if tracker4.count("Consolidated connection with FullPeerInfo") == 2:
        break
    time.sleep(0.1)

tracker4.reset()
# Check that no message is dropped because a peer is disconnected
assert tracker4.count("Reason Disconnected") == 0

if mode == 'manytx':
    while ctx.get_balances() != ctx.expected_balances:
        assert time.time() - started < TIMEOUT
        print(
            "Waiting for the old node to catch up. Current balances: %s; Expected balances: %s"
            % (ctx.get_balances(), ctx.expected_balances))
        time.sleep(1)
Exemple #3
0
            ctx.send_moar_txs(hash_, 3, False)
            print("Sending moar txs at height %s" % boot_height)
    time.sleep(0.1)

boot_heights = boot_node.get_all_heights()

assert catch_up_height in boot_heights, "%s not in %s" % (catch_up_height,
                                                          boot_heights)

if catch_up_height >= 100:
    assert tracker4.check("transition to State Sync")
elif catch_up_height <= 30:
    assert not tracker4.check("transition to State Sync")

tracker4.reset()
assert tracker4.count("Connected to FullPeerInfo") == 2

if mode == 'manytx':
    while ctx.get_balances() != ctx.expected_balances:
        assert time.time() - started < TIMEOUT
        print(
            "Waiting for the old node to catch up. Current balances: %s; Expected balances: %s"
            % (ctx.get_balances(), ctx.expected_balances))
        time.sleep(1)

    # requery the balances from the newly started node
    ctx.nodes.append(node4)
    ctx.act_to_val = [2, 2, 2]

    while ctx.get_balances() != ctx.expected_balances:
        assert time.time() - started < TIMEOUT