yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #65515
[Bug 1701129] Re: Functional tests fail intermittently with 400 Bad Request from placement
Reviewed: https://review.openstack.org/478683
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1d74a7ab3da2a04e133347bd59cb1e37e1c8e322
Submitter: Jenkins
Branch: master
commit 1d74a7ab3da2a04e133347bd59cb1e37e1c8e322
Author: melanie witt <melwittt@xxxxxxxxx>
Date: Wed Jun 28 23:50:53 2017 +0000
Handle version for PUT and POST in PlacementFixture
The SchedulerReportClient allows a "version" keyword argument to be
specified for its get/put/post methods and several functions pass a
version because they are sending data supported only in specific
microversions of the placement API.
The PlacementFixture has to mock the SchedulerReportClient
get/put/post/delete methods to swap in a Keystone session with
auth=None. The fake methods for PUT and POST are missing handling of
the "version" keyword argument, causing intermittent "400 Bad Request"
failures in the functional test jobs when unexpected parameters are
passed to placement microversion 1.0 instead of the intended
microversion.
Closes-Bug: #1701129
Change-Id: I681712ac37f732c7803c68f6c7d1eae9f2877d3d
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1701129
Title:
Functional tests fail intermittently with 400 Bad Request from
placement
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Noticed this on a test run on an unrelated patch I uploaded,
functional test failure with trace:
2017-06-28 22:16:50,659 INFO [nova.api.openstack.placement.requestlog] 127.0.0.1 "PUT /allocations/f0bd6e91-2486-418c-bea2-bb2392568171" status: 400 len: 2220 microversion: 1.0
2017-06-28 22:16:50,659 INFO [nova.placement.wsgi.server] 127.0.0.1 "PUT /allocations/f0bd6e91-2486-418c-bea2-bb2392568171 HTTP/1.1" status: 400 len: 2504 time: 0.0040810
2017-06-28 22:16:50,660 WARNING [nova.scheduler.client.report] Unable to submit allocation for instance f0bd6e91-2486-418c-bea2-bb2392568171 (400 <html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>400 Bad Request</h1>
The server could not comply with the request since it is either malformed or otherwise incorrect.<br /><br />
JSON does not validate: Additional properties are not allowed (u'project_id', u'user_id' were unexpected)
Failed validating 'additionalProperties' in schema:
{'additionalProperties': False,
'properties': {'allocations': {'items': {'additionalProperties': False,
'properties': {'resource_provider': {'additionalProperties': False,
'properties': {'uuid': {'format': 'uuid',
'type': 'string'}},
'required': ['uuid'],
'type': 'object'},
'resources': {'additionalProperties': False,
'patternProperties': {'^[0-9A-Z_]+$': {'minimum': 1,
'type': 'integer'}},
'type': 'object'}},
'required': ['resource_provider',
'resources'],
'type': 'object'},
'type': 'array'}},
'required': ['allocations'],
'type': 'object'}
On instance:
{u'allocations': [{u'resource_provider': {u'uuid': u'29000c79-94bf-4326-9630-281d2ef67071'},
u'resources': {u'DISK_GB': 20,
u'MEMORY_MB': 2048,
u'VCPU': 1}}],
u'project_id': u'6f70656e737461636b20342065766572',
u'user_id': u'fake'}
</body>
</html>)
The problem is that microversion 1.0 is being requested with
parameters only available in microversion >= 1.8. This is because the
PlacementFixture's _fake_put() method ignores the version keyword
argument and doesn't pass it along to placement.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1701129/+subscriptions
References