Skip to content

Comments

Bft soak test: run qbft only by default#9863

Open
macfarla wants to merge 7 commits intohyperledger:mainfrom
macfarla:bft-soak-separate
Open

Bft soak test: run qbft only by default#9863
macfarla wants to merge 7 commits intohyperledger:mainfrom
macfarla:bft-soak-separate

Conversation

@macfarla
Copy link
Contributor

@macfarla macfarla commented Feb 22, 2026

PR description

Separate the BFT soak test by consensus mechanism (qbft, ibft2, all). By default run QBFT only.

Follow up to #9846

Files changed:


  1. .github/workflows/bft-soak-test.yml — added consensus-type choice input, pass it as -Dacctests.consensusType=, updated artifact names
  2. acceptance-tests/tests/build.gradle — forward acctests.consensusType system property to the test JVM in both all and acceptanceTestBftSoak targets
  3. acceptance-tests/tests/src/acceptanceTest/java/org/hyperledger/besu/tests/acceptance/bft/ParameterizedBftTestBase.java — filter factoryFunctions() stream based on acctests.consensusType

  Verification commands for reviewers:

  # Run only QBFT — expect test report to show "1: qbft" only
  ./gradlew :acceptance-tests:tests:acceptanceTest --tests "*BftMiningAcceptanceTest_Part1.shouldMineOnSingleNodeWithFreeGas_Berlin*" -Dacctests.consensusType=qbft

  # Run only IBFT2 — expect test report to show "1: ibft2" only
  ./gradlew :acceptance-tests:tests:acceptanceTest --tests "*BftMiningAcceptanceTest_Part1.shouldMineOnSingleNodeWithFreeGas_Berlin*" -Dacctests.consensusType=ibft2

  # Run both — expect test report to show both
  ./gradlew :acceptance-tests:tests:acceptanceTest --tests "*BftMiningAcceptanceTest_Part1.shouldMineOnSingleNodeWithFreeGas_Berlin*" -Dacctests.consensusType=all

  # Check results in:
  # acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml
navigate via acceptance-tests/tests/build/reports/tests/acceptanceTest/index.html

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Copilot AI review requested due to automatic review settings February 22, 2026 23:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR separates BFT soak tests by consensus mechanism, allowing targeted testing of QBFT, IBFT2, or both. By default, only QBFT tests are run.

Changes:

  • Added consensus-type workflow input with QBFT as the default
  • Forwarded acctests.consensusType system property to test JVM
  • Filtered parameterized test factory based on consensus type

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/bft-soak-test.yml Added consensus-type input with QBFT default and updated artifact names to include consensus type
acceptance-tests/tests/build.gradle Forwarded acctests.consensusType system property to both acceptanceTest and acceptanceTestBftSoak targets
acceptance-tests/tests/src/acceptanceTest/java/org/hyperledger/besu/tests/acceptance/bft/ParameterizedBftTestBase.java Implemented filtering logic to run tests for specific consensus type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


public static Stream<Arguments> factoryFunctions() {
final String consensusType = System.getProperty("acctests.consensusType");
if (consensusType != null && !consensusType.isEmpty() && !consensusType.equals("all")) {
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

The condition checks for null, empty, and 'all' separately. Consider using isBlank() instead of separate null and isEmpty checks for cleaner code: if (consensusType != null && !consensusType.isBlank() && !consensusType.equals(\"all\"))

Suggested change
if (consensusType != null && !consensusType.isEmpty() && !consensusType.equals("all")) {
if (consensusType != null && !consensusType.isBlank() && !consensusType.equals("all")) {

Copilot uses AI. Check for mistakes.
final String consensusType = System.getProperty("acctests.consensusType");
if (consensusType != null && !consensusType.isEmpty() && !consensusType.equals("all")) {
return BftAcceptanceTestParameterization.getFactories()
.filter(args -> consensusType.equals(args.get()[0]));
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

The filter condition assumes the first element of the arguments array is the consensus type. Consider adding a comment explaining this assumption or using a named constant for the array index to improve code clarity.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@matthew1001 matthew1001 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants