Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ci3/bench_engine
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,22 @@ isolate_bench_cpus
# Clean up old benchmark outputs to avoid confusion with new results.
find . -type d -iname bench-out | xargs rm -rf

# Run parallelizable benchmarks.
cat $bench_cmds_file | grep -v ':PARALLEL=0' | STRICT_SCHEDULING=1 parallelize
# Run parallelizable benchmarks (continue on failure to collect partial results).
bench_failed=0
cat $bench_cmds_file | grep -v ':PARALLEL=0' | STRICT_SCHEDULING=1 parallelize || bench_failed=1

# Run serial benchmarks one at a time (for memory bandwidth / cache isolation).
serial_cmds=$(cat $bench_cmds_file | grep ':PARALLEL=0' || true)
if [ -n "$serial_cmds" ]; then
echo "Running serial benchmarks..."
while IFS= read -r cmd; do
[ -z "$cmd" ] && continue
run_test_cmd "$cmd"
run_test_cmd "$cmd" || bench_failed=1
done <<< "$serial_cmds"
fi

unisolate_bench_cpus

if [ "$bench_failed" -ne 0 ]; then
echo "WARNING: Some benchmarks failed. Partial results may be collected."
fi
16 changes: 13 additions & 3 deletions ci3/parallelize_strict
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function wait_for_job {
wait -n
ret=$?
if [ $ret -ne 0 ]; then
exit 1
failed=1
fi
}

Expand Down Expand Up @@ -72,14 +72,19 @@ function run_tests {
}

num_jobs=0
failed=0

# We'll handle errors explicitly.
set +e
run_tests | tee $output
run_tests > >(tee $output) 2>&1

# Loop to monitor jobs until one fails or all finish.
while (( $(jobs -p | wc -l) > 0 )); do
wait_for_job
wait -n
ret=$?
if [ $ret -ne 0 ]; then
failed=1
fi
done

function filter_long_times {
Expand All @@ -97,3 +102,8 @@ if [ -n "$slow_jobs" ]; then
fi

echo "Completed run of $num_jobs tests in $SECONDS seconds."

if [ "$failed" -ne 0 ]; then
echo -e "${red}WARNING: Some jobs failed during this run.${reset}"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MockL2BlockSource } from '@aztec/archiver/test';
import type { EpochCache } from '@aztec/epoch-cache';
import { SecretValue } from '@aztec/foundation/config';
import { createLogger } from '@aztec/foundation/log';
import { sleep } from '@aztec/foundation/sleep';
Expand All @@ -15,7 +14,6 @@ import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-clien

import type { PeerId } from '@libp2p/interface';
import { peerIdFromString } from '@libp2p/peer-id';
import { mock } from 'jest-mock-extended';

import type { P2PConfig } from '../../../config.js';
import { BatchTxRequesterCollector, SendBatchRequestCollector } from '../../../services/index.js';
Expand All @@ -29,6 +27,7 @@ import {
InMemoryTxPool,
UNLIMITED_RATE_LIMIT_QUOTA,
calculateInternalTimeout,
createMockEpochCache,
createMockWorldStateSynchronizer,
} from '../../../test-helpers/index.js';
import { createP2PClient } from '../../index.js';
Expand Down Expand Up @@ -99,7 +98,7 @@ function sendMessage(message: WorkerResponse): Promise<void> {
async function startClient(config: P2PConfig, clientIndex: number) {
txPool = new InMemoryTxPool();
attestationPool = new InMemoryAttestationPool();
const epochCache = mock<EpochCache>();
const epochCache = createMockEpochCache();
const worldState = createMockWorldStateSynchronizer();
const l2BlockSource = new MockL2BlockSource();
const proofVerifier = new AlwaysTrueCircuitVerifier();
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/p2p/src/testbench/p2p_client_testbench_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Used when running testbench commands.
*/
import { MockL2BlockSource } from '@aztec/archiver/test';
import type { EpochCache, EpochCacheInterface } from '@aztec/epoch-cache';
import type { EpochCacheInterface } from '@aztec/epoch-cache';
import { BlockNumber } from '@aztec/foundation/branded-types';
import { SecretValue } from '@aztec/foundation/config';
import { Secp256k1Signer } from '@aztec/foundation/crypto/secp256k1-signer';
Expand All @@ -28,7 +28,6 @@ import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-clien
import type { Message, PeerId } from '@libp2p/interface';
import { TopicValidatorResult } from '@libp2p/interface';
import { peerIdFromString } from '@libp2p/peer-id';
import { mock } from 'jest-mock-extended';

import type { P2PClient } from '../client/index.js';
import type { P2PConfig } from '../config.js';
Expand All @@ -50,6 +49,7 @@ import {
InMemoryAttestationPool,
InMemoryTxPool,
UNLIMITED_RATE_LIMIT_QUOTA,
createMockEpochCache,
createMockWorldStateSynchronizer,
filterTxsByDistribution,
} from '../test-helpers/index.js';
Expand Down Expand Up @@ -344,7 +344,7 @@ process.on('message', async msg => {
workerConfig = config;
workerTxPool = new InMemoryTxPool();
workerAttestationPool = new InMemoryAttestationPool();
const epochCache = mock<EpochCache>();
const epochCache = createMockEpochCache();
const worldState = createMockWorldStateSynchronizer();
const l2BlockSource = new MockL2BlockSource();

Expand Down
Loading