Fix a race in the allocation API tests
We expect the newly created allocation not to change instantly, but
the allocation process is usually pretty fast. Only compare fields
we care about.
Change-Id: Ifb2c9ebb4ab35c350001635dea1c41c8a0e5cfdd
diff --git a/ironic_tempest_plugin/tests/api/admin/test_allocations.py b/ironic_tempest_plugin/tests/api/admin/test_allocations.py
index 1891a3b..4e48374 100644
--- a/ironic_tempest_plugin/tests/api/admin/test_allocations.py
+++ b/ironic_tempest_plugin/tests/api/admin/test_allocations.py
@@ -133,7 +133,10 @@
_, body = self.client.create_allocation(self.resource_class,
name='banana')
_, loaded_body = self.client.show_allocation('banana')
- self._assertExpected(body, loaded_body)
+ # The allocation will likely have been processed by this time, so do
+ # not compare the whole body.
+ for field in ('name', 'uuid', 'resource_class'):
+ self.assertEqual(body[field], loaded_body[field])
@decorators.idempotent_id('4ca123c4-160d-4d8d-a3f7-15feda812263')
def test_list_allocations(self):