tests.unit.aiplatform.test_cloud_profiler.TestWebServer: test_correct_response failed
envgap__googleapis__python-aiplatform-1118
01 / FAILURE SIGNATURE
As reported upstream
E AttributeError: module 'werkzeug.wrappers' has no attribute 'BaseResponse'
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
d0d719c0bf557b908eb63f3a245db2f47b136eb3- Manifest
setup.py- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
googleapis/python-aiplatform #1118 · read the original issue
This test failed!
To configure my behavior, see [the Flaky Bot documentation](https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot).
If I'm commenting on this issue too often, add the `flakybot: quiet` label and
I will stop commenting.
---
commit: d0d719c0bf557b908eb63f3a245db2f47b136eb3
buildURL: [Build Status](https://source.cloud.google.com/results/invocations/7c6cbad4-1036-43cc-8ecc-27b332d36606), [Sponge](http://sponge2/7c6cbad4-1036-43cc-8ecc-27b332d36606)
status: failed
<details><summary>Test output</summary><br><pre>self = <test_cloud_profiler.TestWebServer testMethod=test_correct_response>
def test_correct_response(self):
res_dict = {"response": "OK"}
def my_callable(var1, var2):
return wrappers.BaseResponse(
json.dumps(res_dict), content_type="application/json", status=200
)
plugin = _create_mock_plugin()
plugin.get_routes.return_value = {"/my_route": my_callable}
ws = webserver.WebServer([plugin])
builder = EnvironBuilder(method="GET", path="/test_plugin/my_route")
env = builder.get_environ()
# Mock a start response callable
response = []
buff = []
def start_response(status, headers):
response[:] = [status, headers]
return buff.append
> res = ws(env, start_response)
tests/unit/aiplatform/test_cloud_profiler.py:353:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/aiplatform/training_utils/cloud_profiler/webserver.py:114: in __call__
return self.wsgi_app(environ, start_response)
google/cloud/aiplatform/training_utils/cloud_profiler/webserver.py:99: in wsgi_app
response = self.dispatch_request(environ, start_response)
google/cloud/aiplatform/training_utils/cloud_profiler/webserver.py:80: in dispatch_request
return self._routes[request.path](environ, start_response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
var1 = {'HTTP_HOST': 'localhost', 'PATH_INFO': '/test_plugin/my_route', 'QUERY_STRING': '', 'RAW_URI': '/test_plugin/my_route', ...}
var2 = <function TestWebServer.test_correct_response.<locals>.start_response at 0x7f7ecd75d4c0>
def my_callable(var1, var2):
> return wrappers.BaseResponse(
json.dumps(res_dict), content_type="application/json", status=200
)
E AttributeError: module 'werkzeug.wrappers' has no attribute 'BaseResponse'
tests/unit/aiplatform/test_cloud_profiler.py:333: AttributeError</pre></details>04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]