Skip to content

test(evm-module): skip RandomSampling fairness + gas benchmark under coverage (fix coverage CI on main)#1235

Merged
branarakic merged 1 commit into
mainfrom
fix/coverage-skip-heavy-rs-tests
Jun 18, 2026
Merged

test(evm-module): skip RandomSampling fairness + gas benchmark under coverage (fix coverage CI on main)#1235
branarakic merged 1 commit into
mainfrom
fix/coverage-skip-heavy-rs-tests

Conversation

@branarakic

Copy link
Copy Markdown
Contributor

What's broken

main's Tornado: Solidity coverage (push safety net) lane is red: npx hardhat coverage exits 1 with 1 failing test —

@unit RandomSampling > Phase 10 — value-weighted challenge generation
  > fairness: draw frequency within ±2pp of weight share (settled state):
    Error: Timeout of 600000ms exceeded.

All 781 tests pass locally under coverage (12m); on CI the run takes ~34m and the 5000-draw fairness test tips past the 600s mocha timeout under instrumentation.

Cause

Introduced by #1226 (the BIT sampling PR), which added two timing/gas-shaped tests without the coverage guard the repo already uses:

  • the fairness statistical test (5000 previewChallengeForSeed draws), and
  • the @gas benchmark suite.

Under solidity-coverage every draw runs heavily instrumented, so the fairness test blows the timeout. Neither adds unique contract-line coverage (they re-exercise the same paths).

Fix

Guard both to skip under coverage, matching the existing convention in ContextGraphStorage.test.ts:

const skip = process.argv.some((a) => a.includes('coverage'));
(skip ? it.skip : it)('fairness: …', )        // RandomSampling.test.ts
(skip ? describe.skip : describe)('@gas …', )  // RandomSampling-bit-gas.test.ts

Verified

  • Normal hardhat test: both still run + pass (gas 2✓, fairness 1✓).
  • hardhat coverage: both skip (gas suite → 2 pending, "Coverage skipped for: …"), so no timeout.

🤖 Generated with Claude Code

…der coverage

The "Tornado: Solidity coverage (push safety net)" lane went red on main: the
`@unit RandomSampling > fairness: draw frequency within ±2pp` test (5000 draws via
previewChallengeForSeed) exceeds the 600s mocha timeout under coverage instrumentation
(each instrumented draw is far slower; CI took 34m vs ~12m locally, tipping it over).

Both this statistical test and the `@gas` benchmark are timing/gas-shaped and add no
unique contract-line coverage, so guard them to skip under coverage — matching the
existing convention in ContextGraphStorage.test.ts (`process.argv.some(a =>
a.includes('coverage'))`). Verified: both still RUN + pass under normal `hardhat test`;
both SKIP under `hardhat coverage` (gas suite shows 2 pending). Introduced by #1226,
which added these tests without the coverage guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@otReviewAgent otReviewAgent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Agent completed this review and found no issues.

@branarakic branarakic merged commit 0567c91 into main Jun 18, 2026
37 of 40 checks passed
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.

2 participants