nova.tests.unit.console.test_websocketproxy. NovaProxyRequestHandlerTestCase.test_tcp_rst_no_compute_rpcapi fails with mock==4.0.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
melanie witt |
Bug Description
Seen in a proposed patch to update upper-constraints in openstack/
nova.tests.
2020-07-15 21:09:49,927 INFO [nova.console.
2020-07-15 21:09:49,928 INFO [nova.console.
2020-07-15 21:09:49,928 INFO [nova.console.
2020-07-15 21:09:49,932 INFO [nova.console.
}}}
Traceback (most recent call last):
File "/home/
self.
File "/home/
self.
File "/home/
raise mismatch_error
testtools.
I did some print()ing locally and found that what's happening here is that the mock library's own process for create_autospec is calling the NovaProxyReques
This bug has actually been brought up before as an issue in the mock library repo [2] and is likely a bug in mock.
The mock library is minimally maintained AFAIK and the community has desired to move away from it. Based on this, I think instead of working around the bug in nova or potentially blacklisting mock==4.0.2 (since nova is the only project failing with its use at this point), it might best to fix the issue by using unittest.mock from the python standard library instead, in test_websocketp
[1] https:/
[2] https:/
summary: |
- nova.tests.unit.console.test_websocketproxy.NovaProxyRequestHandlerTestCase.test_tcp_rst_no_compute_rpcapi - fails with mock==4.0.2 + nova.tests.unit.console.test_websocketproxy. + NovaProxyRequestHandlerTestCase.test_tcp_rst_no_compute_rpcapi fails + with mock==4.0.2 |
Fix proposed to branch: master /review. opendev. org/741351
Review: https:/