Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
tests: make integration test more stable (#1488)
Browse files Browse the repository at this point in the history
* wait new blk right before send tx

* larger timeout_commit for priority test

* larger timeout_commit for mempool related test

* mv chain id test to cluster used test

* keep cluster in module scope

* sync gomod2nix

* adjust timeout_commit

* rm prune all in indexer config

* add missing min_gas_multiplier

* wait 1 more blk in upgrade

* only keep 2 validators

* add retry for grpc_eth_call

* wait 1 block before stop

* fix lint

* disable recheck

* bump up upgrade

* sync gomod2nix

* Apply suggestions from code review

* Apply suggestions from code review

* append node log

* fix lint

* expect less gas after ecd7639

* allow retry continue on empty rsp

* update gomod2nix

* fix flake

* mod tidy

* keep grpc only test

* tests(integration): enable recheck tx mode

* update gomod2nix

Co-authored-by: Federico Kunze Küllmer <[email protected]>
Co-authored-by: Freddy Caceres <[email protected]>
Co-authored-by: Tom <[email protected]>
  • Loading branch information
4 people authored Dec 23, 2022
1 parent 1dfee9f commit 29caa19
Show file tree
Hide file tree
Showing 20 changed files with 189 additions and 134 deletions.
54 changes: 27 additions & 27 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ schema = 3
version = "v0.22.1"
hash = "sha256-hBU+roIELcmbW2Gz7eGZzL9qNA1bakq5wNxqCgs4TKc="
[mod."github.com/btcsuite/btcd/btcec/v2"]
version = "v2.2.0"
hash = "sha256-cwoIqi0SiAaGEBtuQKip9OVirKIeJw5fUoWo7x/xfOc="
version = "v2.3.2"
hash = "sha256-natWs+yIAuD1UI07iZtjPilroQLfXizFn3lNOiOT83U="
[mod."github.com/btcsuite/btcd/chaincfg/chainhash"]
version = "v1.0.1"
hash = "sha256-vix0j/KGNvoKjhlKgVeSLY6un2FHeIEoZWMC4z3yvZ4="
Expand Down Expand Up @@ -91,14 +91,14 @@ schema = 3
hash = "sha256-mFKxFHp7RaE1L5NdtH9H9px2Cy6I5uOZVnFOgE8Nrew="
replaced = "github.com/cosmos/cosmos-sdk/ics23/go"
[mod."github.com/cosmos/btcutil"]
version = "v1.0.4"
hash = "sha256-JvcBXBdjdmnaW/nyf/tw/uaOAGn1b78yxrtl2/Rs3kA="
version = "v1.0.5"
hash = "sha256-t572Sr5iiHcuMKLMWa2i+LBAt192oa+G1oA371tG/eI="
[mod."github.com/cosmos/cosmos-proto"]
version = "v1.0.0-beta.1"
hash = "sha256-oATkuj+fM5eBn+ywO+w/tL0AFSIEkx0J3Yz+VhVe0QA="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.46.6"
hash = "sha256-H1VZxZUWXhpXiY3A9smLp09MEGpXmh+XvX6YUiXPcpQ="
version = "v0.46.7"
hash = "sha256-54DCF8lrnA1oUmBJlbUlWXOP5UbenRInUROn5P5I9qI="
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
hash = "sha256-Qm2aC2vaS8tjtMUbHmlBSagOSqbduEEDwc51qvQaBmA="
Expand All @@ -112,14 +112,11 @@ schema = 3
version = "v0.19.4"
hash = "sha256-EmpRZ48pjPFq/fIHneut9Vyo5QJATfb3ZO7KzWnqs9g="
[mod."github.com/cosmos/ibc-go/v5"]
version = "v5.1.0"
hash = "sha256-9ZwGw6XqYkBtj+vTQ2IodNb7VcGesTFnVsxjd+G1I6Q="
version = "v5.2.0"
hash = "sha256-Gfqhdz9ZKEgb7LCkHiXCwYZYUYluQ+vMew/GkssfVj8="
[mod."github.com/cosmos/ledger-cosmos-go"]
version = "v0.11.1"
hash = "sha256-yli+VvVtZmHo2LPvCY6lYVUfcCDn3sBLDL+a8KIlqDA="
[mod."github.com/cosmos/ledger-go"]
version = "v0.9.2"
hash = "sha256-0YI+0A6wFBjiebBwzWOQjkgXkTakCrf7Gjg2xEaQdoM="
version = "v0.12.1"
hash = "sha256-9+nr+/r4MyiogddS0JcXOuriPqXP4nxln8ts+mYQRcg="
[mod."github.com/creachadair/taskgroup"]
version = "v0.3.2"
hash = "sha256-Y261IO/d9xjV0UScqHvo31broxvnKn4IQQC9Mu6jNkE="
Expand Down Expand Up @@ -362,11 +359,11 @@ schema = 3
version = "v0.0.5"
hash = "sha256-/5i70IkH/qSW5KjGzv8aQNKh9tHoz98tqtL0K2DMFn4="
[mod."github.com/onsi/ginkgo/v2"]
version = "v2.5.1"
hash = "sha256-VB29+H9k7l6il63oXJvsjamSUhsw/e99iI/BeTCderA="
version = "v2.6.1"
hash = "sha256-OEiWYKCGPCaqL3vzSrHquHGm+Q8URT2anpanAVK5hRo="
[mod."github.com/onsi/gomega"]
version = "v1.24.1"
hash = "sha256-REfxQTDRcO23GnmJfOW8/MmPJf9oE2grVvvGiC1eSbo="
version = "v1.24.2"
hash = "sha256-iascSzzBT1Uv/XybezSblIwwrq78BU4a9BVB5MvK6MM="
[mod."github.com/pelletier/go-toml"]
version = "v1.9.5"
hash = "sha256-RJ9K1BTId0Mled7S66iGgxHkZ5JKEIsrrNaEfM8aImc="
Expand Down Expand Up @@ -464,8 +461,8 @@ schema = 3
version = "v0.16.0"
hash = "sha256-JW4zO/0vMzf1dXLePOqaMtiLUZgNbuIseh9GV+jQlf0="
[mod."github.com/tendermint/tendermint"]
version = "v0.34.23"
hash = "sha256-eir0vr8lQOG+FTPo+ZUeDidAIACfyUq2ie3XRE8rIa4="
version = "v0.34.24"
hash = "sha256-3HFTv4XgN535RDaJ5OwUS+fnJHgkmLTwU7CNU2ilxEQ="
[mod."github.com/tendermint/tm-db"]
version = "v0.6.7"
hash = "sha256-hl/3RrBrpkk2zA6dmrNlIYKs1/GfqegSscDSkA5Pjlo="
Expand All @@ -482,8 +479,11 @@ schema = 3
version = "v0.5.8"
hash = "sha256-bfG3dssBUn+mSOAuKL+a/DTGGLUA+eASgLoGv/Gkqs0="
[mod."github.com/zondax/hid"]
version = "v0.9.1-0.20220302062450-5552068d2266"
hash = "sha256-IZea8SHuLQxlltm1avieRVI054TWZg2jEoplodvNtwk="
version = "v0.9.1"
hash = "sha256-hSVmN/f/lQHFhF60o6ej78ELC0MMoqQgqIX2hHjdTXg="
[mod."github.com/zondax/ledger-go"]
version = "v0.14.0"
hash = "sha256-RozTPSNs4RerZ4DQMBcGmvREjoRtH1G69xjhccYjIOk="
[mod."go.etcd.io/bbolt"]
version = "v1.3.6"
hash = "sha256-DenVAmyN22xUiivk6fdJp4C9ZnUJXCMDUf8E0goRRV4="
Expand All @@ -497,20 +497,20 @@ schema = 3
version = "v0.0.0-20220722155223-a9213eeb770e"
hash = "sha256-kNgzydWRpjm0sZl4uXEs3LX5L0xjJtJRAFf/CTlYUN4="
[mod."golang.org/x/net"]
version = "v0.2.0"
hash = "sha256-0MqnHDdLkkau6k7hlWD9MzIoAFROvxulyT+KzZkSXOs="
version = "v0.4.0"
hash = "sha256-7IwGZh/xg4mQz88cJio2Ov5d3jGRXKj1itlAja/EAbQ="
[mod."golang.org/x/oauth2"]
version = "v0.0.0-20221014153046-6fdb5e3db783"
hash = "sha256-IoygidVNqyAZmN+3macDeIefK8hhJToygpcqlwehdYQ="
[mod."golang.org/x/sync"]
version = "v0.1.0"
hash = "sha256-Hygjq9euZ0qz6TvHYQwOZEjNiTbTh1nSLRAWZ6KFGR8="
[mod."golang.org/x/sys"]
version = "v0.2.0"
hash = "sha256-N6yfQH7R2gfcvyWTQZbxWuSNyVy6hAxiab2WFzgAykI="
version = "v0.3.0"
hash = "sha256-TIHhfYbZ99sCU1ZMikxwomXH5AEtD/lA1VMMW+UAhbU="
[mod."golang.org/x/term"]
version = "v0.2.0"
hash = "sha256-azcllZ0o/9TurqX9udaJ0o9yxqSoI0/bSJsvQQLYIQc="
version = "v0.3.0"
hash = "sha256-NKv2o8wz8DB/2W2h/muGEIHb+S06mBXZxhG254RpQ5s="
[mod."golang.org/x/text"]
version = "v0.5.0"
hash = "sha256-ztH+xQyM/clOcQl+y/UEPcfNKbc3xApMbEPDDZ9up0o="
Expand Down
5 changes: 3 additions & 2 deletions tests/integration_tests/configs/cosmovisor.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ local config = import 'default.jsonnet';

config {
'ethermint_9000-1'+: {
'app-config'+: {
'minimum-gas-prices': '100000000000aphoton',
},
genesis+: {
app_state+: {
feemarket+: {
params+: {
no_base_fee: false,
base_fee:: super.base_fee,
initial_base_fee: super.base_fee,
},
},
},
Expand Down
4 changes: 0 additions & 4 deletions tests/integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
cmd: 'ethermintd',
'start-flags': '--trace',
config: {
consensus: {
// larger timeout for more stable mempool tests
timeout_commit: '2s',
},
mempool: {
// use v1 mempool to enable tx prioritization
version: 'v1',
Expand Down
13 changes: 9 additions & 4 deletions tests/integration_tests/configs/enable-indexer.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ config {
},
},
'app-config'+: {
pruning: 'everything',
'state-sync'+: {
'snapshot-interval': 0,
},
'json-rpc'+: {
'enable-indexer': true,
},
},
genesis+: {
app_state+: {
feemarket+: {
params+: {
min_gas_multiplier: '0',
},
},
},
},
},
}
11 changes: 11 additions & 0 deletions tests/integration_tests/configs/long_timeout_commit.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
local default = import 'default.jsonnet';

default {
'ethermint_9000-1'+: {
config+: {
consensus+: {
timeout_commit: '5s',
},
},
},
}
9 changes: 9 additions & 0 deletions tests/integration_tests/configs/pruned_node.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@ config {
'snapshot-interval': 0,
},
},
genesis+: {
app_state+: {
feemarket+: {
params+: {
min_gas_multiplier: '0',
},
},
},
},
},
}
2 changes: 1 addition & 1 deletion tests/integration_tests/configs/rollback-test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local config = import 'default.jsonnet';

config {
'ethermint_9000-1'+: {
validators: super.validators + [{
validators: super.validators[0:1] + [{
name: 'fullnode',
}],
},
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/configs/upgrade-test-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ let
released = pkgs.buildGo118Module rec {
name = "ethermintd";
# the commit before https:/evmos/ethermint/pull/943
src = fetchEthermint "f21592ebfe74da7590eb42ed926dae970b2a9a3f";
src = fetchEthermint "8866ae0ffd67a104e9d1cf4e50fba8391dda6c45";
subPackages = [ "cmd/ethermintd" ];
vendorSha256 = "sha256-ABm5t6R/u2S6pThGrgdsqe8n3fH5tIWw7a57kxJPbYw=";
vendorSha256 = "sha256-oDtMamNlwe/393fZd+RNtRy6ipWpusbco8Xg1ZuKWYw=";
doCheck = false;
};
current = pkgs.callPackage ../../../. { };
Expand Down
34 changes: 1 addition & 33 deletions tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from pathlib import Path

import pytest

from .network import setup_custom_ethermint, setup_ethermint, setup_geth
from .network import setup_ethermint, setup_geth


@pytest.fixture(scope="session")
Expand All @@ -11,42 +9,12 @@ def ethermint(tmp_path_factory):
yield from setup_ethermint(path, 26650)


@pytest.fixture(scope="session")
def ethermint_indexer(tmp_path_factory):
path = tmp_path_factory.mktemp("indexer")
yield from setup_custom_ethermint(
path, 26660, Path(__file__).parent / "configs/enable-indexer.jsonnet"
)


@pytest.fixture(scope="session")
def geth(tmp_path_factory):
path = tmp_path_factory.mktemp("geth")
yield from setup_geth(path, 8545)


@pytest.fixture(
scope="session", params=["ethermint", "geth", "ethermint-ws", "enable-indexer"]
)
def cluster(request, ethermint, ethermint_indexer, geth):
"""
run on both ethermint and geth
"""
provider = request.param
if provider == "ethermint":
yield ethermint
elif provider == "geth":
yield geth
elif provider == "ethermint-ws":
ethermint_ws = ethermint.copy()
ethermint_ws.use_websocket()
yield ethermint_ws
elif provider == "enable-indexer":
yield ethermint_indexer
else:
raise NotImplementedError


@pytest.fixture(
scope="session", params=["ethermint", "ethermint-ws"]
)
Expand Down
10 changes: 7 additions & 3 deletions tests/integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pystarport.utils import build_cli_args_safe, interact

DEFAULT_GAS_PRICE = "5000000000000aphoton"
DEFAULT_GAS = "250000"


class ChainCommand:
Expand Down Expand Up @@ -636,16 +637,19 @@ def edit_validator(
)

def gov_propose(self, proposer, kind, proposal, **kwargs):
method = "submit-legacy-proposal"
kwargs.setdefault("gas_prices", DEFAULT_GAS_PRICE)
kwargs.setdefault("gas", DEFAULT_GAS)
if kind == "software-upgrade":
return json.loads(
self.raw(
"tx",
"gov",
"submit-proposal",
method,
kind,
proposal["name"],
"-y",
"--no-validate",
from_=proposer,
# content
title=proposal.get("title"),
Expand All @@ -664,7 +668,7 @@ def gov_propose(self, proposer, kind, proposal, **kwargs):
self.raw(
"tx",
"gov",
"submit-proposal",
method,
kind,
"-y",
from_=proposer,
Expand All @@ -685,7 +689,7 @@ def gov_propose(self, proposer, kind, proposal, **kwargs):
self.raw(
"tx",
"gov",
"submit-proposal",
method,
kind,
fp.name,
"-y",
Expand Down
Loading

0 comments on commit 29caa19

Please sign in to comment.