Browse Source

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
changes/39/703439/2
Riccardo Pittau 2 months ago
parent
commit
5380945642
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      ironic_python_agent/tests/unit/test_hardware.py

+ 1
- 1
ironic_python_agent/tests/unit/test_hardware.py View File

@@ -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'


Loading…
Cancel
Save