Skip to content

test(e2e): consolidate cross-chain bridge and messaging suites#24491

Merged
PhilWindle merged 2 commits into
merge-train/spartan-v5from
spl/e2e-r2-cross-chain
Jul 5, 2026
Merged

test(e2e): consolidate cross-chain bridge and messaging suites#24491
PhilWindle merged 2 commits into
merge-train/spartan-v5from
spl/e2e-r2-cross-chain

Conversation

@spalladino

@spalladino spalladino commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Part of the e2e round-2 consolidation (PR 3 of 9): fewer CI containers for single-node/cross-chain/ with every asserted behavior preserved.

Merges (old → new)

  • token_bridge_private.test.ts + token_bridge_public.parallel.test.ts + token_bridge_failure_cases.test.tstoken_bridge.test.ts: one CrossChainMessagingTest setup in beforeAll (with startProverNode: true, covering all three), with describe('private'), describe('public'), describe('failure cases'). The public file previously re-ran the full harness setup per it via beforeEach.
  • l1_to_l2.parallel.test.tsl1_to_l2.test.ts + l1_to_l2_inbox_drift.test.ts: beforeEach full setup converted to a single beforeAll per file; the scenarios converted to it.each(['private','public']) tables. Split by scenario (see timings below): l1_to_l2.test.ts keeps the duplicate-message-from-non-registered-portal scenario, l1_to_l2_inbox_drift.test.ts holds the inbox-drift scenario (which resets the markProvenEnabled gate between its via beforeEach).
  • l2_to_l1.parallel.test.tsl2_to_l1.test.ts: dropped the .parallel suffix; the two message-count-shape its ([3,4] and [3,1,2]) tableized via it.each with per-row consume tuples; the reorg-and-remine, mixed private/public, no-message-tx, and multi-block-checkpoint its kept explicit and behaviorally unchanged.

Harness construction

  • The new CrossChainMessagingTest(...) for every suite now lives as the first statement of beforeAll rather than at describe scope, so nothing is constructed at test-registration time. Registration-time data (the it.each scope tables) is static, and test bodies read off t lazily.
  • The shared L1→L2 message helpers (sendMessageToL2, advanceBlock, waitForMessageFetched, waitForMessageReady) used by both l1_to_l2 files are extracted to message_test_helpers.ts. Each suite plugs in its own proving policy via a markAsProven dependency (unconditional for the duplicate-message suite; gated for the inbox-drift suite).

Container count

  • Before: 14 CI containers (2 plain files + 12 .parallel per-it containers), each paying a full node bootstrap.
  • After: 4 containers / 4 setups. Same 17 its in total.

Timings (why l1_to_l2 was split)

Measured from the last full CI run on this branch (commit ba5e29b):

  • token_bridge.test.ts: 463s (~7.7 min)
  • l2_to_l1.test.ts: 384s (~6.4 min)
  • l1_to_l2.test.ts: 738s (~12.3 min) — over the ~10 min target, so split

l1_to_l2's four its broke down as: duplicate-message private 149s / public 162s; inbox-drift private 194s / public 172s (setup + teardown ~59s). Splitting by scenario yields l1_to_l2 (~6 min) and l1_to_l2_inbox_drift (~7 min), both comfortably under 10 min, without resorting to the .parallel suffix.

Assertion mapping

  • No assertions dropped. All 17 its and their asserted properties survive; every it moved intact to exactly one file.
  • Because the token-bridge its now share one node, absolute balance assertions became delta-from-initial assertions (each it snapshots L1/L2 balances at its start). Same properties: deposit debits L1 by the bridge amount, claim credits L2, withdraw restores L1, wrong claims revert with the same error strings.
  • .test_patterns.yml flake-pattern regexes repointed from the three old bridge file names to token_bridge; the l1_to_l2 prefix regex already covers both new l1_to_l2* files.
  • bootstrap.sh: 25m per-container timeout overrides for the four cross-chain files (bodies run serially in one container each). The glob picks up the new file names unchanged.

Notes

  • No docs #include_code references any of the renamed files, so no docs changes.
  • single-node/README.md still lists the old cross-chain file names (it was already stale); left untouched to avoid conflicting with the sibling consolidation PRs — follow-up sweep will refresh it.

Merges the token bridge trio (token_bridge_private, token_bridge_public.parallel,
token_bridge_failure_cases) into a single token_bridge.test.ts on one shared
CrossChainMessagingTest setup, converts l1_to_l2 and l2_to_l1 from .parallel
fan-out to plain files with it.each tables, and updates bootstrap.sh timeouts
and .test_patterns.yml flake patterns for the renamed files.
@spalladino spalladino added the wip Work in progress label Jul 3, 2026
…_l2 suite

Move the CrossChainMessagingTest construction out of describe scope and into
beforeAll for the token_bridge, l2_to_l1, and l1_to_l2 suites.

Split l1_to_l2 (~12min in CI) into two suites: l1_to_l2 keeps the
duplicate-message scenario and l1_to_l2_inbox_drift holds the inbox-drift
scenario, each ~6-7min. The shared L1 to L2 message helpers are extracted to
message_test_helpers.ts.
@PhilWindle PhilWindle merged commit 863d4cc into merge-train/spartan-v5 Jul 5, 2026
16 checks passed
@PhilWindle PhilWindle deleted the spl/e2e-r2-cross-chain branch July 5, 2026 18:05
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