Skip to content

Commit

Permalink
tests: fix flacky test_running_base_functionality
Browse files Browse the repository at this point in the history
The integration test `test_running_cluster::test_running_base_functionality`
fails sometimes with an failed assertion of the same PID after restart.

After the patch waiting for instances stop was added to make sure that
cluster is down before it will start again and will check for PID.

Closes #972
  • Loading branch information
themilchenko committed Oct 21, 2024
1 parent 4529899 commit c3f3fbb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/integration/running/test_running_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import yaml

from utils import (control_socket, extract_status, get_tarantool_version,
run_command_and_get_output, run_path, wait_file)
pid_file, run_command_and_get_output, run_path, wait_file,
wait_instance_stop)

tarantool_major_version, tarantool_minor_version = get_tarantool_version()

Expand Down Expand Up @@ -99,6 +100,11 @@ def test_running_base_functionality(tt_cmd, tmpdir_with_cfg):
)
start_output = instance_process.stdout.read()

# Need to wait for all instances to stop before start.
for instance in instances:
pid_path = os.path.join(tmpdir, app_name, run_path, instance, pid_file)
wait_instance_stop(pid_path)

for inst in instances:
assert f"Starting an instance [{app_name}:{inst}]" in start_output

Expand Down

0 comments on commit c3f3fbb

Please sign in to comment.