Merge "Set timeout for functional job"
This commit is contained in:
commit
8acface007
@ -41,29 +41,27 @@ class TestAsyncProcess(base.BaseTestCase):
|
|||||||
eventlet.sleep(0.01)
|
eventlet.sleep(0.01)
|
||||||
|
|
||||||
def test_stopping_async_process_lifecycle(self):
|
def test_stopping_async_process_lifecycle(self):
|
||||||
with self.assert_max_execution_time():
|
proc = async_process.AsyncProcess(['tail', '-f',
|
||||||
proc = async_process.AsyncProcess(['tail', '-f',
|
self.test_file_path])
|
||||||
self.test_file_path])
|
proc.start()
|
||||||
proc.start()
|
self._check_stdout(proc)
|
||||||
self._check_stdout(proc)
|
proc.stop()
|
||||||
proc.stop()
|
|
||||||
|
|
||||||
# Ensure that the process and greenthreads have stopped
|
# Ensure that the process and greenthreads have stopped
|
||||||
proc._process.wait()
|
proc._process.wait()
|
||||||
self.assertEqual(proc._process.returncode, -9)
|
self.assertEqual(proc._process.returncode, -9)
|
||||||
for watcher in proc._watchers:
|
for watcher in proc._watchers:
|
||||||
watcher.wait()
|
watcher.wait()
|
||||||
|
|
||||||
def test_async_process_respawns(self):
|
def test_async_process_respawns(self):
|
||||||
with self.assert_max_execution_time():
|
proc = async_process.AsyncProcess(['tail', '-f',
|
||||||
proc = async_process.AsyncProcess(['tail', '-f',
|
self.test_file_path],
|
||||||
self.test_file_path],
|
respawn_interval=0)
|
||||||
respawn_interval=0)
|
proc.start()
|
||||||
proc.start()
|
|
||||||
|
|
||||||
# Ensure that the same output is read twice
|
# Ensure that the same output is read twice
|
||||||
self._check_stdout(proc)
|
self._check_stdout(proc)
|
||||||
pid = proc._get_pid_to_kill()
|
pid = proc._get_pid_to_kill()
|
||||||
proc._kill_process(pid)
|
proc._kill_process(pid)
|
||||||
self._check_stdout(proc)
|
self._check_stdout(proc)
|
||||||
proc.stop()
|
proc.stop()
|
||||||
|
@ -74,18 +74,17 @@ class TestOvsdbMonitor(BaseMonitorTest):
|
|||||||
eventlet.sleep(0.01)
|
eventlet.sleep(0.01)
|
||||||
|
|
||||||
def test_killed_monitor_respawns(self):
|
def test_killed_monitor_respawns(self):
|
||||||
with self.assert_max_execution_time():
|
self.monitor.respawn_interval = 0
|
||||||
self.monitor.respawn_interval = 0
|
old_pid = self.monitor._process.pid
|
||||||
old_pid = self.monitor._process.pid
|
output1 = self.collect_initial_output()
|
||||||
output1 = self.collect_initial_output()
|
pid = self.monitor._get_pid_to_kill()
|
||||||
pid = self.monitor._get_pid_to_kill()
|
self.monitor._kill_process(pid)
|
||||||
self.monitor._kill_process(pid)
|
self.monitor._reset_queues()
|
||||||
self.monitor._reset_queues()
|
while (self.monitor._process.pid == old_pid):
|
||||||
while (self.monitor._process.pid == old_pid):
|
eventlet.sleep(0.01)
|
||||||
eventlet.sleep(0.01)
|
output2 = self.collect_initial_output()
|
||||||
output2 = self.collect_initial_output()
|
# Initial output should appear twice
|
||||||
# Initial output should appear twice
|
self.assertEqual(output1, output2)
|
||||||
self.assertEqual(output1, output2)
|
|
||||||
|
|
||||||
|
|
||||||
class TestSimpleInterfaceMonitor(BaseMonitorTest):
|
class TestSimpleInterfaceMonitor(BaseMonitorTest):
|
||||||
@ -104,7 +103,6 @@ class TestSimpleInterfaceMonitor(BaseMonitorTest):
|
|||||||
self.assertFalse(self.monitor.has_updates,
|
self.assertFalse(self.monitor.has_updates,
|
||||||
'has_updates without port addition should be False')
|
'has_updates without port addition should be False')
|
||||||
self.create_resource('test-port-', self.bridge.add_port)
|
self.create_resource('test-port-', self.bridge.add_port)
|
||||||
with self.assert_max_execution_time():
|
# has_updates after port addition should become True
|
||||||
# has_updates after port addition should become True
|
while not self.monitor.has_updates:
|
||||||
while not self.monitor.has_updates:
|
eventlet.sleep(0.01)
|
||||||
eventlet.sleep(0.01)
|
|
||||||
|
2
tox.ini
2
tox.ini
@ -26,12 +26,14 @@ setenv = VIRTUAL_ENV={envdir}
|
|||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
setenv = OS_TEST_PATH=./neutron/tests/functional
|
setenv = OS_TEST_PATH=./neutron/tests/functional
|
||||||
|
OS_TEST_TIMEOUT=90
|
||||||
|
|
||||||
[testenv:dsvm-functional]
|
[testenv:dsvm-functional]
|
||||||
setenv = OS_TEST_PATH=./neutron/tests/functional
|
setenv = OS_TEST_PATH=./neutron/tests/functional
|
||||||
OS_SUDO_TESTING=1
|
OS_SUDO_TESTING=1
|
||||||
OS_ROOTWRAP_CMD=sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
|
OS_ROOTWRAP_CMD=sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
|
||||||
OS_FAIL_ON_MISSING_DEPS=1
|
OS_FAIL_ON_MISSING_DEPS=1
|
||||||
|
OS_TEST_TIMEOUT=90
|
||||||
sitepackages=True
|
sitepackages=True
|
||||||
|
|
||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user