From 53809456420c7ad037e6ad0f20d5b99e8e4c1110 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Mon, 20 Jan 2020 17:04:02 +0100 Subject: [PATCH] Fix multiprocessing call in unit test This patch fixes the call to ApplyResult from the multiprocessing pool module. The error presents itself more clearly when running tests using Python 3.8, and that's why it's not been noticed so far. The change in behavior in Python 3.8 will raise the error: AttributeError: 'dict' object has no attribute '_cache' Change-Id: I6717ebf5fef0d32120c9386ab8e47cc81f328493 --- ironic_python_agent/tests/unit/test_hardware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ironic_python_agent/tests/unit/test_hardware.py b/ironic_python_agent/tests/unit/test_hardware.py index 407f2fae3..ff53a7509 100644 --- a/ironic_python_agent/tests/unit/test_hardware.py +++ b/ironic_python_agent/tests/unit/test_hardware.py @@ -1830,7 +1830,7 @@ class TestGenericHardwareManager(base.IronicAgentTest): internal_info['disk_erasure_concurrency'] = 10 mocked_dispatch.return_value = 'erased device' - apply_result = multiprocessing.pool.ApplyResult({}, None, None) + apply_result = multiprocessing.pool.ApplyResult apply_result._success = True apply_result._ready = True apply_result.get = lambda: 'erased device'