mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 06:05:53 +00:00
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 commitc36623baad) - (cherry picked from commite4f2b62019) - (cherry picked from commitfae71f79c2) 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
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.