Skip to content

Commit 93d3d0a

Browse files
authored
fix(kv-store): lazy-load skipped browser benchmark deps (#24108)
## Summary - Investigated the `merge-train/spartan-v5` dequeue for train PR #24053. - Latest dequeue was from merge-group CI, not a merge conflict: #24053 is currently mergeable/clean on `merge-train/spartan-v5`. - The failing merge-group run was `27576008840` on `gh-readonly-queue/v5-next/pr-24053-fc2322d6...`, failing `ci/x3-full` via `yarn-project/kv-store/scripts/run_test.sh src/bench/sqlite-opfs-encrypted/map_bench.test.ts`. - Root cause: skipped-by-default browser benchmarks still imported SQLite/OPFS and shared benchmark dependencies at module load, so normal CI test discovery could fail before the `describe.skip` path. - Fix: lazy-load benchmark dependencies only when `VITE_BENCH=1` for the IndexedDB, SQLite-OPFS, and encrypted SQLite-OPFS map benchmarks. Failed dashboard log: http://ci.aztec-labs.com/dbe70cb905f2df69 ## Verification - `CI=1 PATH="$HOME/.cargo/bin:$PATH" scripts/run_test.sh src/bench/sqlite-opfs-encrypted/map_bench.test.ts` from `yarn-project/kv-store` passes with the benchmark skipped. - `CI=1 PATH="$HOME/.cargo/bin:$PATH" scripts/run_test.sh src/bench/sqlite-opfs/map_bench.test.ts` passes with the benchmark skipped. - `CI=1 PATH="$HOME/.cargo/bin:$PATH" scripts/run_test.sh src/bench/indexeddb/map_bench.test.ts` passes with the benchmark skipped. - `yarn format kv-store --check` passes. Notes: the requested root `./bootstrap.sh ci` is not a valid bootstrap command in this checkout (`Unknown command: ci`). I also tried the apparent CI equivalent, `./bootstrap.sh ci-full-no-test-cache`; it did not complete in this container because the local CI engine/tooling failed before reaching these tests. --- *Created by [claudebox](https://claudebox.work/v2/sessions/72862d04194777fa) · group: `slackbot`*
1 parent fbfbca2 commit 93d3d0a

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

yarn-project/kv-store/src/bench/indexeddb/map_bench.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
* Skipped by default; set `VITE_BENCH=1` to run (or invoke this file directly
44
* via `yarn test:browser src/bench/indexeddb/map_bench.test.ts`).
55
*/
6-
import { createLogger } from '@aztec/foundation/log';
7-
8-
import { AztecIndexedDBStore } from '../../indexeddb/store.js';
9-
import { mockLogger } from '../../interfaces/utils.js';
10-
import { describeAztecMapBench } from '../shared_map_bench.js';
11-
126
const shouldRun = (import.meta as ImportMeta & { env?: { VITE_BENCH?: string } }).env?.VITE_BENCH === '1';
137

148
if (shouldRun) {
9+
const [{ createLogger }, { AztecIndexedDBStore }, { mockLogger }, { describeAztecMapBench }] = await Promise.all([
10+
import('@aztec/foundation/log'),
11+
import('../../indexeddb/store.js'),
12+
import('../../interfaces/utils.js'),
13+
import('../shared_map_bench.js'),
14+
]);
15+
1516
describeAztecMapBench(
1617
'IndexedDB',
1718
() => AztecIndexedDBStore.open(mockLogger, undefined, true),

yarn-project/kv-store/src/bench/sqlite-opfs-encrypted/map_bench.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
*
1010
* Skipped by default; set VITE_BENCH=1 (and VITE_SQLITE_OPFS=1) to run.
1111
*/
12-
import { createLogger } from '@aztec/foundation/log';
13-
14-
import { mockLogger } from '../../interfaces/utils.js';
15-
import { AztecSQLiteOPFSStore } from '../../sqlite-opfs/store.js';
16-
import { describeAztecMapBench } from '../shared_map_bench.js';
17-
1812
const shouldRun = (import.meta as ImportMeta & { env?: { VITE_BENCH?: string } }).env?.VITE_BENCH === '1';
1913

2014
if (shouldRun) {
15+
const [{ createLogger }, { mockLogger }, { AztecSQLiteOPFSStore }, { describeAztecMapBench }] = await Promise.all([
16+
import('@aztec/foundation/log'),
17+
import('../../interfaces/utils.js'),
18+
import('../../sqlite-opfs/store.js'),
19+
import('../shared_map_bench.js'),
20+
]);
21+
2122
describeAztecMapBench(
2223
'SQLite-OPFS (chacha20)',
2324
() => {

yarn-project/kv-store/src/bench/sqlite-opfs/map_bench.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
* Skipped by default; set `VITE_BENCH=1` to run (or invoke this file directly
44
* via `yarn test:browser src/bench/sqlite-opfs/map_bench.test.ts`).
55
*/
6-
import { createLogger } from '@aztec/foundation/log';
7-
8-
import { mockLogger } from '../../interfaces/utils.js';
9-
import { AztecSQLiteOPFSStore } from '../../sqlite-opfs/store.js';
10-
import { describeAztecMapBench } from '../shared_map_bench.js';
11-
126
const shouldRun = (import.meta as ImportMeta & { env?: { VITE_BENCH?: string } }).env?.VITE_BENCH === '1';
137

148
if (shouldRun) {
9+
const [{ createLogger }, { mockLogger }, { AztecSQLiteOPFSStore }, { describeAztecMapBench }] = await Promise.all([
10+
import('@aztec/foundation/log'),
11+
import('../../interfaces/utils.js'),
12+
import('../../sqlite-opfs/store.js'),
13+
import('../shared_map_bench.js'),
14+
]);
15+
1516
describeAztecMapBench(
1617
'SQLite-OPFS',
1718
() => AztecSQLiteOPFSStore.open(mockLogger, undefined, true),

0 commit comments

Comments
 (0)