Skip to content

feat(nemesis): Remove disrupt_method_wrapper#13644

Draft
pehala wants to merge 15 commits intoscylladb:masterfrom
pehala:refactor_decorator
Draft

feat(nemesis): Remove disrupt_method_wrapper#13644
pehala wants to merge 15 commits intoscylladb:masterfrom
pehala:refactor_decorator

Conversation

@pehala
Copy link
Contributor

@pehala pehala commented Feb 17, 2026

Overview

This PR refactors and in the end get rid of disrupt_method_wrapper by moving it into execute_nemesis. Existing logic is simplified by removing features that are no longer needed (exclusive nemesis) or by refactoring calls to be move consise and elegant (I like context managers). Result is function which is now much simpler to understand, with only neccessary features and removal of another level of indirection by removing decorator. Due to spliting into multiple function it is now also easier to test and to mock individual parts, finally enabling us to write tests for actual nemesis execution

It builds on top of #13416 to not block it from being merged and to save myself a rebase later. Until the PR is merged, this PR can be reviewed commit by commit and individual changes can be discussed before being finalized after the dependency merge

This PR can be split into individual PR one commiteach if needed, but each PR has more or less isolated changes so it should be reviewable.

Changes

  • Remove ES logging
    • ES is no longer used
  • Remove duplicit metric tracking
  • Remove exclusive nemesis mechanism
    • Confirmed that multitenants are no longer needed
    • Wrote up design to be reconstructed later if needed
  • Add hooks into ClusterTester
    • Replaces hardcoded data validation with simple, yet flexible mechanism
    • Affects only longevity_lwt_test
  • Refactor code inside the method
    • Refactor log info handling
    • Merge with statements
    • Add DISRUPT_DEFAULT_POOL for setting the node pools

TODO

  • Update tests
  • Write new comprehensive tests for the new structure
  • Test using existing longevity and lwt tests

Testing

  • None, need to update tests first

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

* Replace nemesis.py with module
* Extract all monkeys into a separate module
* Introduce gatherer.py module for autoloading all nemesis
* Update affected imports
In execute nemesis, the event is started as well
Used only for multitenant k8s, which is not needed anymore
Add docs/shelved/MULTITENANTK8s.md to document purpose and implementation if it needs to be revived
Reworks Argus and validation logic, which was in inner function inside this wrapper
* Add util methods
* Rewrite the log logic to be more concise and all at one place
* Enables running code before and after each nemesis,
 without hardcoding it in nemesis code
* Used currently only in longevity_lwt_test.py to validate data
* Reduces code duplication
* Add default pool
* Moved the code so it is inside one try block
  * Removes one level of indentation
Move all logic into execute_nemesis
@pehala pehala added the backport/none Backport is not required label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/none Backport is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments