Skip to content

Commit 3d4becd

Browse files
authored
chore: enable chaos test in xts dry run (#22258)
Signed-off-by: Michael Heinrichs <[email protected]>
1 parent c89dfe0 commit 3d4becd

File tree

6 files changed

+80
-4
lines changed

6 files changed

+80
-4
lines changed

.github/workflows/zxc-execute-otter-tests.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
type: boolean
1414
required: false
1515
default: false
16+
enable-chaos-otter-tests:
17+
description: "Chaos Otter Testing Enabled"
18+
type: boolean
19+
required: false
20+
default: false
1621
enable-network-log-capture:
1722
description: "Network Log Capture Enabled"
1823
type: boolean
@@ -203,6 +208,49 @@ jobs:
203208
platform-sdk/consensus-otter-tests/build/container/**
204209
retention-days: 7
205210

211+
- name: Chaos Otter Testing
212+
id: gradle-chaos-otter-tests
213+
if: ${{ inputs.enable-chaos-otter-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
214+
env:
215+
LC_ALL: en.UTF-8
216+
LANG: en_US.UTF-8
217+
run: ${GRADLE_EXEC} :consensus-otter-tests:testChaos
218+
219+
- name: Publish Chaos Otter Testing Report
220+
uses: step-security/publish-unit-test-result-action@5d195d4dec0b9fa7b51a3dbc4298362a021247c7 # v2.20.4
221+
if: ${{ inputs.enable-chaos-otter-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
222+
with:
223+
check_name: "Node: Chaos Otter Tests Result"
224+
json_thousands_separator: ","
225+
junit_files: "**/consensus-otter-tests/build/test-results/testChaos/TEST-*.xml"
226+
comment_mode: errors # only comment if we could not find or parse the JUnit XML files
227+
228+
- name: Upload Chaos Otter Test Report Artifacts
229+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
230+
if: ${{ inputs.enable-chaos-otter-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
231+
with:
232+
name: Chaos Otter Test Report
233+
path: "**/consensus-otter-tests/build/test-results/testChaos/TEST-*.xml"
234+
retention-days: 7
235+
236+
- name: Upload Chaos Otter Tests Turtle Logs
237+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
238+
if: ${{ inputs.enable-chaos-otter-tests && inputs.enable-network-log-capture && steps.gradle-chaos-otter-tests.conclusion == 'failure' && !cancelled() }}
239+
with:
240+
name: Chaos Otter Tests Turtle Logs
241+
path: |
242+
platform-sdk/consensus-otter-tests/build/turtle/**
243+
retention-days: 7
244+
245+
- name: Upload Chaos Otter Tests Container Logs
246+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
247+
if: ${{ inputs.enable-chaos-otter-tests && inputs.enable-network-log-capture && steps.gradle-chaos-otter-tests.conclusion == 'failure' && !cancelled() }}
248+
with:
249+
name: Chaos Otter Tests Container Logs
250+
path: |
251+
platform-sdk/consensus-otter-tests/build/container/**
252+
retention-days: 7
253+
206254
- name: Check Results
207255
id: calculate-failure-mode
208256
if: ${{ always() }}
@@ -220,6 +268,7 @@ jobs:
220268
"${{ steps.gradle-build.outcome || 'skipped' }}"
221269
"${{ steps.gradle-full-otter-tests.outcome || 'skipped' }}"
222270
"${{ steps.gradle-fast-otter-tests.outcome || 'skipped' }}"
271+
"${{ steps.gradle-chaos-otter-tests.outcome || 'skipped' }}"
223272
)
224273
225274
failure_mode="none"

.github/workflows/zxc-xts-tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,20 @@ jobs:
205205
gradle-cache-username: ${{ secrets.gradle-cache-username }}
206206
gradle-cache-password: ${{ secrets.gradle-cache-password }}
207207

208+
xts-chaos-otter-tests:
209+
name: XTS Chaos Otter Tests
210+
if: ${{ inputs.enable-extended-test-suite == 'true' && contains(inputs.custom-job-label, 'Dry Run') }}
211+
uses: ./.github/workflows/zxc-execute-otter-tests.yaml
212+
with:
213+
custom-job-label: "${{ inputs.custom-job-label }} Chaos Otter Tests"
214+
enable-chaos-otter-tests: true
215+
enable-network-log-capture: true
216+
ref: ${{ inputs.commit_sha }}
217+
secrets:
218+
access-token: ${{ secrets.access-token }}
219+
gradle-cache-username: ${{ secrets.gradle-cache-username }}
220+
gradle-cache-password: ${{ secrets.gradle-cache-password }}
221+
208222
abbreviated-panel:
209223
name: JRS Panel
210224
if: ${{ inputs.enable-abbreviated-panel == 'true' }}

platform-sdk/consensus-otter-tests/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ testing {
2929

3030
targets.configureEach { testTask { dependsOn(":consensus-otter-docker-app:assemble") } }
3131
}
32+
33+
suites.register<JvmTestSuite>("testChaos") {
34+
targets.configureEach { testTask { dependsOn(":consensus-otter-docker-app:assemble") } }
35+
}
3236
}
3337

3438
testModuleInfo {
@@ -54,6 +58,10 @@ extensions.getByName<GradleOnlyDirectives>("testOtterModuleInfo").apply {
5458
runtimeOnly("io.grpc.netty.shaded")
5559
}
5660

61+
extensions.getByName<GradleOnlyDirectives>("testChaosModuleInfo").apply {
62+
runtimeOnly("io.grpc.netty.shaded")
63+
}
64+
5765
tasks.withType<Test>().configureEach { maxHeapSize = "8g" }
5866

5967
// This should probably not be necessary (Log4j issue?)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
open module org.hiero.otter.chaos {
3+
requires org.hiero.otter.fixtures;
4+
requires static com.github.spotbugs.annotations;
5+
}

platform-sdk/consensus-otter-tests/src/testOtter/java/org/hiero/otter/test/ChaosTest.java renamed to platform-sdk/consensus-otter-tests/src/testChaos/java/org/hiero/otter/chaos/ChaosTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
package org.hiero.otter.test;
2+
package org.hiero.otter.chaos;
33

44
import com.swirlds.common.merkle.synchronization.config.ReconnectConfig_;
55
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -9,15 +9,13 @@
99
import org.hiero.otter.fixtures.OtterTest;
1010
import org.hiero.otter.fixtures.TestEnvironment;
1111
import org.hiero.otter.fixtures.chaosbot.ChaosBotConfiguration;
12-
import org.junit.jupiter.api.Disabled;
1312

1413
/**
1514
* A test that runs chaos experiments on a network of nodes.
1615
*/
17-
public class ChaosTest {
16+
class ChaosTest {
1817

1918
@OtterTest(requires = Capability.RECONNECT)
20-
@Disabled("This test should only be run manually to verify stability under chaos conditions.")
2119
void chaosTest(@NonNull final TestEnvironment env) {
2220
final Network network = env.network();
2321
network.addNodes(7);

platform-sdk/consensus-otter-tests/src/testFixtures/java/org/hiero/otter/fixtures/chaosbot/internal/ChaosBotImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public ChaosBotImpl(@NonNull final TestEnvironment env, @NonNull final ChaosBotC
7676
@SuppressWarnings("DataFlowIssue")
7777
@Override
7878
public void runChaos(@NonNull final Duration duration) {
79+
log.info("Run chaos bot for {}", duration);
80+
7981
final Network network = env.network();
8082
final TimeManager timeManager = env.timeManager();
8183
final Instant chaosEndTime = timeManager.now().plus(duration);

0 commit comments

Comments
 (0)