From 87638f2ab5379c04dfdf87329ebe450c24ac25bc Mon Sep 17 00:00:00 2001 From: Sri Vignesh Date: Mon, 24 Feb 2020 13:46:27 +0530 Subject: [testfix] Add steps to stabilise glusterd Moved steps from teardown class to teardown and removed unwanted teardown class and rectified the testcase failing with wait for io to complete by removing the step because after validate io the sub process terminates and results in failure. Change-Id: I2eaf05680b817b681aff8b48683fc9dac88896b0 Signed-off-by: Sri Vignesh --- .../test_restart_glusterd_while_rebalancing.py | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py') diff --git a/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py b/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py index 6b6256872..ace2f2fb0 100644 --- a/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py +++ b/tests/functional/glusterd/test_restart_glusterd_while_rebalancing.py @@ -20,7 +20,6 @@ import sys -from time import sleep from glusto.core import Glusto as g from glustolibs.gluster.exceptions import ExecutionError @@ -30,7 +29,10 @@ from glustolibs.gluster.brick_ops import add_brick from glustolibs.gluster.rebalance_ops import (rebalance_start, get_rebalance_status) from glustolibs.gluster.gluster_init import (restart_glusterd, - wait_for_glusterd_to_start) + wait_for_glusterd_to_start, + is_glusterd_running, + start_glusterd) +from glustolibs.gluster.peer_ops import wait_for_peers_to_connect from glustolibs.io.utils import validate_io_procs from glustolibs.misc.misc_libs import upload_scripts from glustolibs.gluster.glusterdir import get_dir_contents @@ -90,18 +92,19 @@ class TestRestartGlusterdWhileRebalance(GlusterBaseClass): """ tearDown for every test """ + ret = is_glusterd_running(self.servers) + if ret: + ret = start_glusterd(self.servers) + if not ret: + raise ExecutionError("Failed to start glusterd on %s" + % self.servers) + g.log.info("Glusterd started successfully on %s", self.servers) # checking for peer status from every node - count = 0 - while count < 80: - ret = self.validate_peers_are_connected() - if ret: - break - sleep(2) - count += 1 - - if not ret: - raise ExecutionError("Servers are not in peer probed state") + for server in self.servers: + ret = wait_for_peers_to_connect(server, self.servers) + if not ret: + raise ExecutionError("Servers are not in peer probed state") # unmounting the volume and Cleaning up the volume ret = self.unmount_volume_and_cleanup_volume(self.mounts) -- cgit