Skip to content

fix(test-specs): parenthesize walrus when counting failing txs#3190

Open
cuiweixie wants to merge 1 commit into
ethereum:forks/amsterdamfrom
cuiweixie:fix/blockchain-failing-tx-count-walrus
Open

fix(test-specs): parenthesize walrus when counting failing txs#3190
cuiweixie wants to merge 1 commit into
ethereum:forks/amsterdamfrom
cuiweixie:fix/blockchain-failing-tx-count-walrus

Conversation

@cuiweixie

Copy link
Copy Markdown

Description

Fix operator precedence around the walrus assignment when counting failing transactions:

# Before (wrong): assigns bool because `>` binds tighter than `:=`
if failing_tx_count := len([...]) > 0:

# After (correct): assigns the count, then compares
if (failing_tx_count := len([...])) > 0:

Previously failing_tx_count was always True/False, so failing_tx_count > 1 never detected multiple failing transactions and the correctness check was effectively dead.

Related Issues or PRs

N/A.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

walrus

Without parentheses, `:=` binds after `>`, so failing_tx_count became
a bool and the multi-failure check never fired.
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.39%. Comparing base (2119b38) to head (d11e691).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3190   +/-   ##
================================================
  Coverage            93.39%   93.39%           
================================================
  Files                  624      624           
  Lines                37014    37014           
  Branches              3386     3386           
================================================
  Hits                 34570    34570           
  Misses                1671     1671           
  Partials               773      773           
Flag Coverage Δ
unittests 93.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant