Files
scylladb/test/raft
Patryk Jędrzejczak 10065d13e4 Merge '[Backport 2026.1] raft: Await instead of returning future in wait_for_state_change' from Scylladb[bot]
The `try-catch` expression is pretty much useless in its current form. If we return the future, the awaiting will only be performed by the caller, completely circumventing the exception handling.

As a result, instead of handling `raft::request_aborted` with a proper error message, the user will face `seastar::abort_requested_exception` whose message is cryptic at best. It doesn't even point to the root of the problem.

Fixes SCYLLADB-665

Backport: This is a small improvement and may help when debugging, so let's backport it to all supported versions.

- (cherry picked from commit c36623baad)

- (cherry picked from commit e4f2b62019)

- (cherry picked from commit fae71f79c2)

Parent PR: #28624

Closes scylladb/scylladb#28753

* https://github.com/scylladb/scylladb:
  test: raft: Add test_aborting_wait_for_state_change
  raft: Describe exception types for wait_for_state_change and wait_for_leader
  raft: Await instead of returning future in wait_for_state_change

---

Changes made for the backport:
* wait_for_leader is a private member function, so we omit extending
  its description.
* The provided test originally used wait_for_leader. Since it's
  private, we replace it with wait_election_done. It should have
  the same effect, and the test should behave in its original form.

Closes scylladb/scylladb#29594
2026-04-30 08:57:01 +03:00
..

Running tests with pytest

To run test with pytest execute

pytest test/raft

To execute only one file, provide the path filename

pytest test/raft/many_test.cc

Since it's a normal path, autocompletion works in the terminal out of the box.

To provide a specific mode, use the next parameter --mode dev, if parameter isn't provided pytest tries to use ninja mode_list to find out the compiled modes.

Parallel execution is controlled by pytest-xdist and the parameter -n auto. This command starts tests with the number of workers equal to CPU cores.