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: output artifact gets expired easily #1671

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 testground/benchmark/benchmark/stateless.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from .stats import dump_block_stats
from .topology import connect_all
from .types import PeerPacket
from .utils import block_height, block_txs, wait_for_block, wait_for_port
from .utils import Tee, block_height, block_txs, wait_for_block, wait_for_port

# use cronosd on host machine
LOCAL_CRONOSD_PATH = "cronosd"
Expand Down Expand Up @@ -303,7 +303,7 @@ def do_run(
detect_idle_halted(cfg["num_idle"], 5)

with (home / "block_stats.log").open("w") as logfile:
dump_block_stats(logfile)
dump_block_stats(Tee(logfile, sys.stdout))

proc.kill()
proc.wait(20)
Expand Down
12 changes: 12 additions & 0 deletions testground/benchmark/benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,15 @@ def split_batch(a: int, size: int):
if m:
parts.append((k * size, a))
return parts


class Tee:
def __init__(self, f1, f2):
self.f1 = f1
self.f2 = f2

def write(self, s) -> int:
s1 = self.f1.write(s)
s2 = self.f2.write(s)
assert s1 == s2
return s1
Loading