]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add info to debug test_keepalived_respawns gate failure
authorAssaf Muller <amuller@redhat.com>
Sat, 29 Aug 2015 15:32:19 +0000 (11:32 -0400)
committerAssaf Muller <amuller@redhat.com>
Wed, 2 Sep 2015 20:25:03 +0000 (16:25 -0400)
Current theory is that there's a bug in external_process.active,
it returns True when it shouldn't, then kill -15 on the process
pid fails because the process isn't up. Added ps -p output to
see if the process is up or not.

Change-Id: Ic062be829d5f05a1294f6b2fa54820422871ffcb
Related-Bug: #1490043

neutron/tests/functional/agent/linux/test_keepalived.py

index 9c9da7098d6cb02879de669e3347fa283bc5e447..cfb49348bebf48c9f9ac5fe2abb0f1a593f4428f 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.agent.linux import external_process
 from neutron.agent.linux import keepalived
@@ -22,6 +23,9 @@ from neutron.tests import base
 from neutron.tests.unit.agent.linux import test_keepalived
 
 
+LOG = logging.getLogger(__name__)
+
+
 class KeepalivedManagerTestCase(base.BaseTestCase,
                                 test_keepalived.KeepalivedConfBaseMixin):
 
@@ -49,11 +53,17 @@ class KeepalivedManagerTestCase(base.BaseTestCase,
         self.assertEqual(self.expected_config.get_config_str(),
                          self.manager.get_conf_on_disk())
 
+    def _log_pid(self, pid):
+        # TODO(amuller): Remove when bug 1490043 is solved.
+        LOG.info(utils.execute(['ps', '-F', pid]))
+
     def test_keepalived_respawns(self):
         self.manager.spawn()
         process = self.manager.get_process()
+        pid = process.pid
+        self._log_pid(pid)
         self.assertTrue(process.active)
-
+        self._log_pid(pid)
         process.disable(sig='15')
 
         utils.wait_until_true(