@@ -143,13 +143,13 @@ def test_constrained_port_update_handles_db_retries(self):
143
143
# update
144
144
with self .port () as port :
145
145
rev = port ['port' ]['revision_number' ]
146
- new = {'port' : {'name' : 'nigiri' }}
147
146
148
147
def concurrent_increment (s ):
149
148
db_api .sqla_remove (se .Session , 'before_commit' ,
150
149
concurrent_increment )
151
150
# slip in a concurrent update that will bump the revision
152
151
plugin = directory .get_plugin ()
152
+ new = {'port' : {'name' : 'nigiri' }}
153
153
plugin .update_port (nctx .get_admin_context (),
154
154
port ['port' ]['id' ], new )
155
155
raise db_exc .DBDeadlock ()
@@ -160,13 +160,16 @@ def concurrent_increment(s):
160
160
# transaction, the revision number is tested only once the first
161
161
# time the revision number service is executed for this session and
162
162
# object.
163
+ new = {'port' : {'name' : 'sushi' }}
163
164
self ._update ('ports' , port ['port' ]['id' ], new ,
164
165
headers = {'If-Match' : 'revision_number=%s' % rev },
165
166
expected_code = exc .HTTPOk .code )
167
+ new = {'port' : {'name' : 'salmon' }}
166
168
self ._update ('ports' , port ['port' ]['id' ], new ,
167
169
headers = {'If-Match' : 'revision_number=%s' %
168
170
str (int (rev ) + 2 )},
169
171
expected_code = exc .HTTPOk .code )
172
+ new = {'port' : {'name' : 'tea' }}
170
173
self ._update ('ports' , port ['port' ]['id' ], new ,
171
174
headers = {'If-Match' : 'revision_number=1' },
172
175
expected_code = exc .HTTPPreconditionFailed .code )
0 commit comments