From 997238e2e9cc9730316b21a0d6e8014b5c452a83 Mon Sep 17 00:00:00 2001 From: Oleg Fayans Date: Fri, 26 Aug 2016 14:36:23 +0200 Subject: [PATCH] Added a sleep interval after domainlevel raise in tests Due to race conditions the test sometimes catches 2 one-way segments instead of one bidirectional. We need to give the master time to merge the one-way segments before we test the output. https://fedorahosted.org/freeipa/ticket/6265 --- ipatests/test_integration/test_replica_promotion.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index 497dad5..f02c815 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -2,6 +2,7 @@ # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # +import time from ipatests.test_integration.base import IntegrationTest from ipatests.test_integration import tasks from ipatests.test_integration.tasks import assert_error @@ -63,7 +64,8 @@ def test_backup_restore(self): command = ["ipa", "topologysegment-find", DOMAIN_SUFFIX_NAME] tasks.install_replica(self.master, self.replicas[0]) backup_file = tasks.ipa_backup(self.master) - self.master.run_command(["ipa", "domainlevel-set", "1"]) + self.master.run_command(["ipa", "domainlevel-set", str(DOMAIN_LEVEL_1)]) + time.sleep(10) result = self.master.run_command(command) found1 = result.stdout_text.rfind("1 segment matched") assert(found1 > 0), result.stdout_text