Skip to content

Commit

Permalink
Problem: fail to push testground image (#1594)
Browse files Browse the repository at this point in the history
* Problem: fail to push testground image

* cleanup
  • Loading branch information
mmsqe authored Sep 20, 2024
1 parent 30d6fd8 commit 3c8be96
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions nix/testground-image.nix
Original file line number Diff line number Diff line change
@@ -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 [ ] ++ [
Expand All @@ -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"
];
Expand Down
14 changes: 0 additions & 14 deletions testground/benchmark/benchmark/sendtx.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import time
from concurrent.futures import ThreadPoolExecutor, as_completed

import aiohttp
import ujson
Expand Down Expand Up @@ -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 = []
Expand Down
8 changes: 4 additions & 4 deletions testground/benchmark/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
Expand Down
4 changes: 2 additions & 2 deletions testground/benchmark/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
}

0 comments on commit 3c8be96

Please sign in to comment.