Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: load generator don't retry on error #1644

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ result
integration_tests/configs/*.yaml

# direnv
/.envrc
/.direnv
.envrc
.direnv
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## UNRELEASED

### Improvements

* (testground)[#]() load generator retry with backoff on error.
yihuang marked this conversation as resolved.
Show resolved Hide resolved

*Oct 14, 2024*

## v1.4.0-rc1
Expand Down
2 changes: 1 addition & 1 deletion testground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ nix run .#stateless-testcase -- gen /tmp/data/out \
--num-txs 20 \
--num-idle 20 \
--app-patch '{"mempool": {"max-txs": -1}}' \
--config-patch '{"mempool": {"size": 100000}}' \
--config-patch '{"mempool": {"size": 10000}}' \
--tx-type erc20-transfer \
--genesis-patch '{"consensus": {"params": {"block": {"max_gas": "263000000"}}}}'
```
Expand Down
7 changes: 6 additions & 1 deletion testground/benchmark/benchmark/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path

import aiohttp
import backoff
import eth_abi
import ujson

Expand Down Expand Up @@ -77,6 +78,8 @@ def load(datadir: Path, global_seq: int) -> [str]:
return ujson.load(f)


@backoff.on_predicate(backoff.expo, max_time=60, max_value=5)
@backoff.on_exception(backoff.expo, aiohttp.ClientError, max_time=60, max_value=5)
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
async def async_sendtx(session, raw):
async with session.post(
LOCAL_JSON_RPC,
Expand All @@ -89,7 +92,9 @@ async def async_sendtx(session, raw):
) as rsp:
data = await rsp.json()
if "error" in data:
print("send tx error", data["error"])
print("send tx error, will retry,", data["error"])
return False
return True


async def send(txs):
Expand Down
15 changes: 13 additions & 2 deletions testground/benchmark/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions testground/benchmark/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ click = "^8.1.7"
ujson = "^5.10.0"
jsonmerge = "^1.9.2"

backoff = "^2.2.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8.2"
pytest-github-actions-annotate-failures = "^0.2.0"
Expand Down
Loading