]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix functional test_server tests
authorarmando-migliaccio <armamig@gmail.com>
Tue, 13 Oct 2015 01:18:48 +0000 (18:18 -0700)
committerKevin Benton <blak111@gmail.com>
Sat, 10 Oct 2015 03:19:33 +0000 (20:19 -0700)
Now oslo.service 0.10.0 no longer sends SIGHUP to parent and
children services.

This was a chance introduced by 286a6ea, and since it invalidated
the very logic under test, this must be revised.

Change-Id: I18a11283925369bc918002477774f196010a1bc3
Closes-bug: #1505438

neutron/tests/functional/test_server.py

index e85dcec9b1789e9bb1034961dc8ba7402b8962c4..236d192bc8f09137da5157ace0e29ae3a12d5c7b 100644 (file)
@@ -130,16 +130,14 @@ class TestNeutronServer(base.BaseTestCase):
         1. Start a service with a given number of workers.
         2. Send SIGHUP to the service.
         3. Wait for workers (if any) to restart.
-        4. Assert that the pids of the workers didn't change after restart.
         """
 
-        start_workers = self._start_server(callback=service, workers=workers)
-
+        self._start_server(callback=service, workers=workers)
         os.kill(self.service_pid, signal.SIGHUP)
 
         # Wait for temp file to be created and its size become equal
-        # to size of FAKE_RESET_MSG repeated (workers + 1) times.
-        expected_size = len(FAKE_RESET_MSG) * (workers + 1)
+        # to size of FAKE_RESET_MSG
+        expected_size = len(FAKE_RESET_MSG)
         condition = lambda: (os.path.isfile(self.temp_file)
                              and os.stat(self.temp_file).st_size ==
                              expected_size)
@@ -153,15 +151,11 @@ class TestNeutronServer(base.BaseTestCase):
                  'size': expected_size}))
 
         # Verify that reset has been called for parent process in which
-        # a service was started and for each worker by checking that
-        # FAKE_RESET_MSG has been written to temp file workers + 1 times.
+        # a service was started. FAKE_RESET_MSG has been written to temp
+        # file.
         with open(self.temp_file, 'r') as f:
             res = f.readline()
-            self.assertEqual(FAKE_RESET_MSG * (workers + 1), res)
-
-        # Make sure worker pids don't change
-        end_workers = self._get_workers()
-        self.assertEqual(start_workers, end_workers)
+            self.assertEqual(FAKE_RESET_MSG, res)
 
 
 class TestWsgiServer(TestNeutronServer):