Skip to content

Commit 4853272

Browse files
committed
fix: address PR review feedback for TestStatePressure
- use cfg.GasUnitsToBurn instead of re-reading env var with different default - add comment explaining time.Sleep before requireSpammersRunning - add post-run assertions for sent > 0 and failed == 0 - add TODO comment for CI result publishing
1 parent 983abca commit 4853272

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/benchmark.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
-run='^TestSpamoorSuite$/^TestERC20Throughput$' -v -timeout=15m \
101101
./benchmark/ --evm-binary=../../../build/evm
102102
103+
# TODO: wire up to publish results once additional tests are in place.
103104
state-pressure-benchmark:
104105
name: State Pressure Benchmark
105106
runs-on: ubuntu-latest

test/e2e/benchmark/spamoor_state_pressure_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (s *SpamoorSuite) TestStatePressure() {
3434
storageSpamConfig := map[string]any{
3535
"throughput": cfg.Throughput,
3636
"total_count": cfg.CountPerSpammer,
37-
"gas_units_to_burn": envInt("BENCH_GAS_UNITS_TO_BURN", 2000000),
37+
"gas_units_to_burn": cfg.GasUnitsToBurn,
3838
"max_pending": 50000,
3939
"max_wallets": cfg.MaxWallets,
4040
"base_fee": 20,
@@ -55,6 +55,7 @@ func (s *SpamoorSuite) TestStatePressure() {
5555
t.Cleanup(func() { _ = e.spamoorAPI.DeleteSpammer(id) })
5656
}
5757

58+
// allow spamoor time to initialise spammer goroutines before polling status
5859
time.Sleep(3 * time.Second)
5960
requireSpammersRunning(t, e.spamoorAPI, spammerIDs)
6061

@@ -103,4 +104,11 @@ func (s *SpamoorSuite) TestStatePressure() {
103104
s.Require().Greater(result.summary.SteadyState, time.Duration(0), "expected non-zero steady-state duration")
104105
result.log(t, wallClock)
105106
w.addEntries(result.entries())
107+
108+
metrics, mErr := e.spamoorAPI.GetMetrics()
109+
s.Require().NoError(mErr, "failed to get final metrics")
110+
sent := sumCounter(metrics["spamoor_transactions_sent_total"])
111+
failed := sumCounter(metrics["spamoor_transactions_failed_total"])
112+
s.Require().Greater(sent, float64(0), "at least one transaction should have been sent")
113+
s.Require().Zero(failed, "no transactions should have failed")
106114
}

0 commit comments

Comments
 (0)