diff --git a/flake.nix b/flake.nix index 5b3887fecc..7649379adc 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,7 @@ cronosd-testnet = mkApp packages.cronosd-testnet; stateless-testcase = { type = "app"; - program = "${pkgs.testground-testcase}/bin/stateless-testcase"; + program = "${pkgs.benchmark-testcase}/bin/stateless-testcase"; }; }; defaultPackage = packages.cronosd; diff --git a/nix/testground-image.nix b/nix/testground-image.nix index 5644a3f78c..629ae3ae8c 100644 --- a/nix/testground-image.nix +++ b/nix/testground-image.nix @@ -1,4 +1,4 @@ -{ dockerTools, runCommandLocal, cronos-matrix, testground-testcase }: +{ dockerTools, runCommandLocal, cronos-matrix, benchmark-testcase }: let patched-cronosd = cronos-matrix.cronosd.overrideAttrs (oldAttrs: { patches = oldAttrs.patches or [ ] ++ [ @@ -15,13 +15,13 @@ dockerTools.buildLayeredImage { name = "cronos-testground"; created = "now"; contents = [ - testground-testcase + benchmark-testcase patched-cronosd tmpDir ]; config = { Expose = [ 9090 26657 26656 1317 26658 26660 26659 30000 ]; - Cmd = [ "/bin/testground-testcase" ]; + Cmd = [ "/bin/stateless-testcase" ]; Env = [ "PYTHONUNBUFFERED=1" ]; diff --git a/testground/benchmark/benchmark/sendtx.py b/testground/benchmark/benchmark/sendtx.py index 22a1bd6740..d3a5395aea 100644 --- a/testground/benchmark/benchmark/sendtx.py +++ b/testground/benchmark/benchmark/sendtx.py @@ -1,6 +1,5 @@ import asyncio import time -from concurrent.futures import ThreadPoolExecutor, as_completed import aiohttp import ujson @@ -65,19 +64,6 @@ def sendtx(w3: web3.Web3, acct: Account, tx_amount: int): ) -def generate_load(num_accounts, num_txs, global_seq, **kwargs): - w3 = web3.Web3(web3.providers.HTTPProvider("http://localhost:8545")) - assert w3.eth.chain_id == CHAIN_ID - accounts = [gen_account(global_seq, i + 1) for i in range(num_accounts)] - with ThreadPoolExecutor(max_workers=num_accounts) as executor: - futs = (executor.submit(sendtx, w3, acct, num_txs) for acct in accounts) - for fut in as_completed(futs): - try: - fut.result() - except Exception as e: - print("test task failed", e) - - def prepare_txs(global_seq, num_accounts, num_txs): accounts = [gen_account(global_seq, i + 1) for i in range(num_accounts)] txs = [] diff --git a/testground/benchmark/flake.nix b/testground/benchmark/flake.nix index 3883096eed..f71ff46a46 100644 --- a/testground/benchmark/flake.nix +++ b/testground/benchmark/flake.nix @@ -63,19 +63,19 @@ }; in rec { - packages.default = pkgs.testground-testcase; + packages.default = pkgs.benchmark-testcase; apps = { default = { type = "app"; - program = "${pkgs.testground-testcase}/bin/testground-testcase"; + program = "${pkgs.benchmark-testcase}/bin/stateless-testcase"; }; stateless-testcase = { type = "app"; - program = "${pkgs.testground-testcase}/bin/stateless-testcase"; + program = "${pkgs.benchmark-testcase}/bin/stateless-testcase"; }; }; devShells.default = pkgs.mkShell { - buildInputs = [ pkgs.testground-testcase-env ]; + buildInputs = [ pkgs.benchmark-testcase-env ]; }; legacyPackages = pkgs; }) diff --git a/testground/benchmark/overlay.nix b/testground/benchmark/overlay.nix index bb37c0a1ef..328d6ce9f0 100644 --- a/testground/benchmark/overlay.nix +++ b/testground/benchmark/overlay.nix @@ -40,6 +40,6 @@ let in { - testground-testcase = final.callPackage benchmark { }; - testground-testcase-env = final.callPackage benchmark-env { }; + benchmark-testcase = final.callPackage benchmark { }; + benchmark-testcase-env = final.callPackage benchmark-env { }; }