Fix test_load_governor on large machines
The test_load_governor fakes the load to be 100 and expects the executor to deregister. However when running the tests on a really big machine (72 cores) the test fails because the executor permits a load of 180 before deregistering. This can be fixed by faking the load relative to the cpu count. Change-Id: Ia177605356e90fc33848097f9443fc2859ac61e2
This commit is contained in:
parent
5fbc185236
commit
160cd6468b
|
@ -14,6 +14,7 @@
|
|||
# under the License.
|
||||
|
||||
import logging
|
||||
import multiprocessing
|
||||
import os
|
||||
import time
|
||||
from unittest import mock
|
||||
|
@ -472,7 +473,10 @@ class TestGovernor(ZuulTestCase):
|
|||
loadavg_mock.return_value = (0.0, 0.0, 0.0)
|
||||
self.executor_server.manageLoad()
|
||||
self.assertTrue(self.executor_server.accepting_work)
|
||||
loadavg_mock.return_value = (100.0, 100.0, 100.0)
|
||||
|
||||
# fake the load to be higher than permitted
|
||||
fake_load = multiprocessing.cpu_count() * 2.6
|
||||
loadavg_mock.return_value = (fake_load, fake_load, fake_load)
|
||||
self.executor_server.manageLoad()
|
||||
self.assertFalse(self.executor_server.accepting_work)
|
||||
|
||||
|
|
Loading…
Reference in New Issue