def testRequestsSize(txnPoolNodesLooper, txnPoolNodeSet, poolTxnClientNames,
                     tdirWithPoolTxns, poolTxnData, noRetryReq):
    """
    Client should not be using node registry but pool transaction file
    :return:
    """
    clients = []
    for name in poolTxnClientNames:
        seed = poolTxnData["seeds"][name].encode()
        client, wallet = buildPoolClientAndWallet((name, seed),
                                                  tdirWithPoolTxns)
        txnPoolNodesLooper.add(client)
        ensureClientConnectedToNodesAndPoolLedgerSame(txnPoolNodesLooper,
                                                      client, *txnPoolNodeSet)
        clients.append((client, wallet))

    n = 250
    timeOutPerReq = 3
    for (client, wallet) in clients:
        logger.debug("{} sending {} requests".format(client, n))
        sendReqsToNodesAndVerifySuffReplies(txnPoolNodesLooper, wallet, client,
                                            n, 1, timeOutPerReq)
        logger.debug("{} sent {} requests".format(client, n))
    for node in txnPoolNodeSet:
        logger.debug("{} has requests {} with size {}".format(
            node, len(node.requests), get_size(node.requests)))
        for replica in node.replicas:
            logger.debug("{} has prepares {} with size {}".format(
                replica, len(replica.prepares), get_size(replica.prepares)))
            logger.debug("{} has commits {} with size {}".format(
                replica, len(replica.commits), get_size(replica.commits)))
def testRequestsSize(txnPoolNodesLooper, txnPoolNodeSet, poolTxnClientNames,
                     tdirWithPoolTxns, poolTxnData, noRetryReq):
    """
    Client should not be using node registry but pool transaction file
    :return:
    """
    clients = []
    for name in poolTxnClientNames:
        seed = poolTxnData["seeds"][name].encode()
        client, wallet = buildPoolClientAndWallet((name, seed),
                                                  tdirWithPoolTxns)
        txnPoolNodesLooper.add(client)
        ensureClientConnectedToNodesAndPoolLedgerSame(txnPoolNodesLooper,
                                                      client, *txnPoolNodeSet)
        clients.append((client, wallet))

    numRequests = 250
    fVal = 1
    for (client, wallet) in clients:
        logger.debug("{} sending {} requests".format(client, numRequests))
        sdk_send_random_and_check(looper, txnPoolNodeSet, sdk_pool_handle,
                                  sdk_wallet_steward, numRequests)
        logger.debug("{} sent {} requests".format(client, numRequests))
    for node in txnPoolNodeSet:
        logger.debug("{} has requests {} with size {}".format(
            node, len(node.requests), get_size(node.requests)))
        for replica in node.replicas.values():
            logger.debug("{} has prepares {} with size {}".format(
                replica, len(replica.prepares), get_size(replica.prepares)))
            logger.debug("{} has commits {} with size {}".format(
                replica, len(replica.commits), get_size(replica.commits)))
Esempio n. 3
0
def testRequestsSize(txnPoolNodesLooper, txnPoolNodeSet, poolTxnClientNames,
                     tdirWithPoolTxns, poolTxnData, noRetryReq):
    """
    Client should not be using node registry but pool transaction file
    :return:
    """
    clients = []
    for name in poolTxnClientNames:
        seed = poolTxnData["seeds"][name].encode()
        client, wallet = buildPoolClientAndWallet((name, seed),
                                                  tdirWithPoolTxns)
        txnPoolNodesLooper.add(client)
        ensureClientConnectedToNodesAndPoolLedgerSame(txnPoolNodesLooper, client,
                                                      *txnPoolNodeSet)
        clients.append((client, wallet))

    n = 250
    timeOutPerReq = 3
    for (client, wallet) in clients:
        logger.debug("{} sending {} requests".format(client, n))
        sendReqsToNodesAndVerifySuffReplies(txnPoolNodesLooper, wallet, client,
                                            n, 1, timeOutPerReq)
        logger.debug("{} sent {} requests".format(client, n))
    for node in txnPoolNodeSet:
        logger.debug("{} has requests {} with size {}".
                     format(node, len(node.requests), get_size(node.requests)))
        for replica in node.replicas:
            logger.debug("{} has prepares {} with size {}".
                         format(replica, len(replica.prepares),
                                get_size(replica.prepares)))
            logger.debug("{} has commits {} with size {}".
                         format(replica, len(replica.commits),
                                get_size(replica.commits)))
def testRequestsSize(looper, txnPoolNodeSet, sdk_pool_handle,
                     sdk_wallet_steward, noRetryReq):
    clients = []
    for i in range(4):
        clients.append(
            sdk_add_new_nym(looper, sdk_pool_handle, sdk_wallet_steward))
    numRequests = 250

    for (_, nym) in clients:
        logger.debug("{} sending {} requests".format(nym, numRequests))
        sdk_send_random_requests(looper, sdk_pool_handle, sdk_wallet_steward,
                                 numRequests)
        logger.debug("{} sent {} requests".format(nym, numRequests))

    for node in txnPoolNodeSet:
        logger.debug("{} has requests {} with size {}".format(
            node, len(node.requests), get_size(node.requests)))
        for replica in node.replicas.values():
            logger.debug("{} has prepares {} with size {}".format(
                replica, len(replica.prepares), get_size(replica.prepares)))
            logger.debug("{} has commits {} with size {}".format(
                replica, len(replica.commits), get_size(replica.commits)))
def testRequestsSize(looper, txnPoolNodeSet, sdk_pool_handle,
                     sdk_wallet_steward, noRetryReq):
    clients = []
    for i in range(4):
        clients.append(sdk_add_new_nym(looper, sdk_pool_handle, sdk_wallet_steward))
    numRequests = 250

    for (_, nym) in clients:
        logger.debug("{} sending {} requests".format(nym, numRequests))
        sdk_send_random_requests(looper, sdk_pool_handle,
                                 sdk_wallet_steward, numRequests)
        logger.debug("{} sent {} requests".format(nym, numRequests))

    for node in txnPoolNodeSet:
        logger.debug("{} has requests {} with size {}".
                     format(node, len(node.requests), get_size(node.requests)))
        for replica in node.replicas.values():
            logger.debug("{} has prepares {} with size {}".
                         format(replica, len(replica.prepares),
                                get_size(replica.prepares)))
            logger.debug("{} has commits {} with size {}".
                         format(replica, len(replica.commits),
                                get_size(replica.commits)))