-
Notifications
You must be signed in to change notification settings - Fork 180
chore: Otter chaos bot #21937
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
base: main
Are you sure you want to change the base?
chore: Otter chaos bot #21937
Conversation
Signed-off-by: Michael Heinrichs <[email protected]>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
poulok
left a comment
There was a problem hiding this 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!
.../consensus-otter-tests/src/testFixtures/java/org/hiero/otter/fixtures/chaosbot/ChaosBot.java
Outdated
Show resolved
Hide resolved
.../src/testFixtures/java/org/hiero/otter/fixtures/chaosbot/internal/NodeFailureExperiment.java
Outdated
Show resolved
Hide resolved
...ests/src/testFixtures/java/org/hiero/otter/fixtures/chaosbot/internal/ExperimentFactory.java
Show resolved
Hide resolved
...otter-tests/src/testFixtures/java/org/hiero/otter/fixtures/turtle/TurtleTestEnvironment.java
Show resolved
Hide resolved
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]>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ 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 🚀 New features to boost your workflow:
|
Signed-off-by: Michael Heinrichs <[email protected]>
| public void runChaos(@NonNull final Duration duration) { | ||
| final Network network = env.network(); | ||
| final TimeManager timeManager = env.timeManager(); | ||
| final Instant endTime = timeManager.now().plus(duration); |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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
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