Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix the benchmark tests #6160

Merged
merged 3 commits into from
Dec 6, 2023
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
branches:
- stable
- unstable
workflow_dispatch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is just to be able to trigger it manually, might be useful to have

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some discussions @dapplion suggested to open draft PRs to test some idea. For that purpose it's required sometime to run some workflows manually on branches.


jobs:
run:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import {BeaconDb} from "../../../../src/index.js";
import {testLogger} from "../../../utils/logger.js";

const logger = testLogger();
const numberOfValidators = 1024;

describe("produceBlockBody", () => {
const stateOg = generatePerfTestCachedStateAltair({goBackOneSlot: false, vc: numberOfValidators});
const stateOg = generatePerfTestCachedStateAltair({goBackOneSlot: false});

let db: BeaconDb;
let chain: BeaconChain;
Expand Down
4 changes: 4 additions & 0 deletions packages/state-transition/test/perf/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export function cachedStateAltairPopulateCaches(state: CachedBeaconStateAltair):
state.inactivityScores.getAll();
}

/**
* Warning: This function has side effects on the cached state
* The order in which the caches are populated is important and can cause stable tests to fail.
*/
export function generatePerfTestCachedStateAltair(opts?: {
goBackOneSlot: boolean;
vc?: number;
Expand Down
Loading