Skip to content
Open
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
17 changes: 13 additions & 4 deletions .github/workflows/bft-soak-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ name: bft-soak-test
on:
workflow_dispatch:
inputs:
consensus-type:
description: 'Consensus type to test'
required: false
default: 'qbft'
type: choice
options:
- all
- qbft
- ibft2
soak-time-mins:
description: 'Duration of soak test in minutes (minimum 60)'
required: false
Expand All @@ -13,7 +22,7 @@ env:

jobs:
bft-soak-test:
name: "BFT Soak Test"
name: "BFT Soak Test (${{ inputs.consensus-type }})"
runs-on: ubuntu-22.04
timeout-minutes: 180
permissions:
Expand All @@ -34,16 +43,16 @@ jobs:
with:
cache-disabled: true
- name: run BFT soak test
run: ./gradlew :acceptance-tests:tests:acceptanceTestBftSoak -Dacctests.soakTimeMins=${{ inputs['soak-time-mins'] }}
run: ./gradlew :acceptance-tests:tests:acceptanceTestBftSoak -Dacctests.soakTimeMins=${{ inputs['soak-time-mins'] }} -Dacctests.consensusType=${{ inputs.consensus-type }}
- name: Upload BFT Soak Test HTML Reports
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
if: always()
with:
name: bft-soak-test-html-reports
name: bft-soak-test-html-reports-${{ inputs.consensus-type }}
path: 'acceptance-tests/tests/build/reports/tests/**'
- name: Upload BFT Soak Test Results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
if: always()
with:
name: bft-soak-test-results
name: bft-soak-test-results-${{ inputs.consensus-type }}
path: 'acceptance-tests/tests/build/test-results/**/TEST-*.xml'
8 changes: 6 additions & 2 deletions acceptance-tests/tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ testing {
setSystemProperties(getSystemProperties())
systemProperty 'acctests.runBesuAsProcess', 'true'
systemProperty 'java.security.properties', "${buildDir}/resources/acceptanceTest/acceptanceTesting.security"
if (System.getProperty('acctests.consensusType')) {
systemProperty 'acctests.consensusType', System.getProperty('acctests.consensusType')
}
def javaProjects = rootProject.subprojects - project(':platform')
mustRunAfter javaProjects.test
description = 'Runs ALL Besu acceptance tests (excluding bftsoak).'
Expand Down Expand Up @@ -120,8 +123,9 @@ testing {
setSystemProperties(getSystemProperties())
systemProperty 'acctests.runBesuAsProcess', 'true'
systemProperty 'java.security.properties', "${buildDir}/resources/acceptanceTest/acceptanceTesting.security"
// Set to any time > 60 minutes to run the soak test for longer
// systemProperty 'acctests.soakTimeMins', '120'
if (System.getProperty('acctests.consensusType')) {
systemProperty 'acctests.consensusType', System.getProperty('acctests.consensusType')
}
description = 'Runs BFT soak test.'
group = 'verification'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public abstract class ParameterizedBftTestBase extends AcceptanceTestBase {
protected BftAcceptanceTestParameterization nodeFactory;

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.
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.
}
return BftAcceptanceTestParameterization.getFactories();
}

Expand Down
Loading