chore: adjusting resources for e2e test + adding strict_scheduling#22395
Open
mrzeszutko wants to merge 1 commit intomerge-train/spartanfrom
Open
chore: adjusting resources for e2e test + adding strict_scheduling#22395mrzeszutko wants to merge 1 commit intomerge-train/spartanfrom
mrzeszutko wants to merge 1 commit intomerge-train/spartanfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
All E2E tests currently run with the default
CPUS=2, MEM=8g, regardless of how many processes they start. A standard test (1 Anvil + 1 Aztec Node + 1 PXE = 3 processes) fits comfortably in 2 CPUs. But P2P tests spin up 6-10+ full validator nodes, epoch tests run multiple validators plus prover nodes, and fee tests always start a prover node — all squeezed into the same 2 CPUs.Meanwhile, GNU
parallelruns up to 64 jobs concurrently (num_cpus / 2) without awareness of per-test CPU needs. It happily runs 64 tests each claiming 2 CPUs even when some actually need 6-8. This causes CPU starvation, missed sequencer timing windows, and flaky timeout failures.Changes
1. Per-test resource overrides (
get_test_resources)Added a function that maps test file paths to appropriate CPUS/MEM based on the number of processes each test actually runs. The values were chosen by analyzing the source code of each test to count processes at peak load:
e2e_token_contract/*,e2e_deploy_contract/*e2e_fees/*,e2e_simple,e2e_epochs/epochs_multiplee2e_epochs/epochs_simple_block_building,epochs_multi_proofe2e_p2p/duplicate_proposal_slash,rediscoverye2e_p2p/gossip_network,epochs_mbps*,reqresp/*e2e_p2p/preferred_gossip_network,add_rollupe2e_prover/full(non-CI_FULL)e2e_prover/full(CI_FULL)Process abbreviations: AN = Anvil, AZ = Aztec Node (sequencer + archiver + world-state + P2P + validator), PN = Prover Node, PXE = Private eXecution Environment, BS = Bootstrap Node.
Memory formula:
MEM = CPUS * 4g(same ratio as the existing default of CPUS=2/MEM=8g), which provides headroom for each process's heap, native code, and world-state trees.2. Strict scheduling for standalone E2E test runs
Changed the
test(andtest_and_collect_avm_inputs) function inyarn-project/end-to-end/bootstrap.shto useSTRICT_SCHEDULING=1. This only affects standalone execution of E2E tests — i.e., when running./bootstrap.sh testdirectly (e.g., grind runs, local dev, or any workflow that invokes thetestfunction). It does not affect normal CI runs, where the Makefile callstest_cmdsand feeds commands to the test engine, which uses plainparallelizewithout strict scheduling.The strict scheduler:
CPUSrequirementCPU_LIST/tasksetThis prevents oversubscription in standalone runs: with 128 cores and tests requesting 2-8 CPUs each, the scheduler naturally limits concurrency to ~30-40 tests instead of the previous 64, with each test getting the cores it actually needs.
This is the same scheduler already used by benchmarks (
benchfunction).