Skip to content

Conversation

@netopyr
Copy link
Contributor

@netopyr netopyr commented Oct 30, 2025

Description:

This is the first version of a chaos bot for Otter. It can be used to generate random failures (network and node). The behavior is deterministic for a fixed seed. This is just a first prototype. The final API will be discussed.

Related issue(s):

Fixes #21921

@netopyr netopyr added this to the v0.68 milestone Oct 30, 2025
@netopyr netopyr requested a review from poulok October 30, 2025 15:19
@netopyr netopyr self-assigned this Oct 30, 2025
@lfdt-bot
Copy link

lfdt-bot commented Oct 30, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@poulok poulok left a comment

Choose a reason for hiding this comment

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

This is soooo cool!

Signed-off-by: Michael Heinrichs <[email protected]>
# Conflicts:
#	platform-sdk/consensus-otter-tests/src/testFixtures/java/module-info.java
Signed-off-by: Michael Heinrichs <[email protected]>
@codacy-production
Copy link

codacy-production bot commented Nov 6, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6c563e7) 104241 78017 74.84%
Head commit (083a69f) 104241 (+0) 78017 (+0) 74.84% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#21937) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #21937   +/-   ##
=========================================
  Coverage     70.94%   70.94%           
  Complexity    24432    24432           
=========================================
  Files          2668     2668           
  Lines        104336   104336           
  Branches      10955    10955           
=========================================
  Hits          74019    74019           
  Misses        26274    26274           
  Partials       4043     4043           

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@netopyr netopyr marked this pull request as ready for review November 6, 2025 14:27
@netopyr netopyr requested a review from a team as a code owner November 6, 2025 14:27
poulok
poulok previously approved these changes Nov 6, 2025
public void runChaos(@NonNull final Duration duration) {
final Network network = env.network();
final TimeManager timeManager = env.timeManager();
final Instant endTime = timeManager.now().plus(duration);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I suggest calling this chaosEndTime so as to distinguish it more from the endTime of each experiment.

new PriorityQueue<>(Comparator.comparing(Experiment::endTime));
Instant nextStart = calculateNextStart(randotron, timeManager.now());

while (timeManager.now().isBefore(endTime)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Some simple comments in this method would help readers understand more quickly

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.

ChaosBot

4 participants