Replace VcStorage with real TurboTasks in tests/benches #93955
Replace VcStorage with real TurboTasks in tests/benches
#93955lukesandberg wants to merge 1 commit into
Conversation
6b3f45e to
b8c2854
Compare
0e26296 to
9084604
Compare
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: a222aee |
Failing test suitesCommit: a222aee | About building and testing Next.js
Expand output● yarn PnP › should compile and serve the index page correctly with-eslint
Expand output● yarn PnP › should compile and serve the index page correctly with-eslint
Expand output● yarn PnP › should compile and serve the index page correctly with-eslint
Expand output● yarn PnP › should compile and serve the index page correctly with-eslint
Expand output● yarn PnP › should compile and serve the index page correctly with-eslint
Expand output● yarn PnP › should compile and serve the index page correctly with-eslint |
9084604 to
a222aee
Compare

VcStorageis a partial in-memory implementor ofTurboTasksApi/TurboTasksCallApiinturbo-tasks-testing. It gave a handful of tests/benchmarks a way to allocate cells and call functions without spinning up a real backend, at the cost of stubbing roughly half of the trait surface withunreachable!()/unimplemented!().This PR migrates the four call sites to construct a real
TurboTasksover anoop_backing_storage(), then deletesVcStorageand the test-onlywith_turbo_tasks_for_testing/current_task_for_testinghelpers it was the sole consumer of. After this PR,TurboTasks<B>is the only concrete implementor ofdyn TurboTasksApi.Migrated call sites
turbo-tasks-fswith_extensionandfile_stemtests — directtt.run_once(async move { … })replacement, matching the existingtest_try_from_sys_pathtest in the same file.turbopack-ecmascriptanalyzer::tests::fixture— the body is now in a#[turbo_tasks::function(operation, root)] async fn fixture_op(input: RcStr)invoked viafixture_op(input).read_strongly_consistent().await. The synchronous SWC parser+resolver setup is wrapped inGLOBALS.set(&globals, || …)returning owned(eval_context, var_graph), after which the async resolve/link work proceeds without GLOBALS — mirroring the production pattern inanalyze_ecmascript_module_internal.run_testis no longer needed.turbopack-ecmascriptbench_link— restructured to mirrorturbo-tasks-backend/benches/overhead.rs:iter_customwithTurboTasksconstructed per measurement batch (storage_mode: None,dependency_tracking: false),Instant::now()placed after construction so it isn't timed.BenchInput.var_graphis nowArc<VarGraph>so the future can beSend + 'static. Quick run shows no change in performance forlink/typeof.Deleted
VcStorageand its trait impls (turbo-tasks-testing/src/lib.rsshrinks from 339 lines to 9).with_turbo_tasks_for_testing,current_task_for_testing, and thetest_helpersre-export module — all unused afterVcStorageis gone.Verification
cargo check --workspace --tests --benches— clean.cargo clippyon changed crates — clean.cargo test -p turbo-tasks-fs --lib— 110/110 pass.cargo test -p turbopack-ecmascript --lib— 352/352 pass (including all 60 analyzer fixture tests).cargo bench -p turbopack-ecmascript --bench analyzer -- "link/typeof" --quick— runs; no change in performance detected.