@@ -143,13 +143,13 @@ def test_constrained_port_update_handles_db_retries(self):
143143 # update
144144 with self .port () as port :
145145 rev = port ['port' ]['revision_number' ]
146- new = {'port' : {'name' : 'nigiri' }}
147146
148147 def concurrent_increment (s ):
149148 db_api .sqla_remove (se .Session , 'before_commit' ,
150149 concurrent_increment )
151150 # slip in a concurrent update that will bump the revision
152151 plugin = directory .get_plugin ()
152+ new = {'port' : {'name' : 'nigiri' }}
153153 plugin .update_port (nctx .get_admin_context (),
154154 port ['port' ]['id' ], new )
155155 raise db_exc .DBDeadlock ()
@@ -160,13 +160,16 @@ def concurrent_increment(s):
160160 # transaction, the revision number is tested only once the first
161161 # time the revision number service is executed for this session and
162162 # object.
163+ new = {'port' : {'name' : 'sushi' }}
163164 self ._update ('ports' , port ['port' ]['id' ], new ,
164165 headers = {'If-Match' : 'revision_number=%s' % rev },
165166 expected_code = exc .HTTPOk .code )
167+ new = {'port' : {'name' : 'salmon' }}
166168 self ._update ('ports' , port ['port' ]['id' ], new ,
167169 headers = {'If-Match' : 'revision_number=%s' %
168170 str (int (rev ) + 2 )},
169171 expected_code = exc .HTTPOk .code )
172+ new = {'port' : {'name' : 'tea' }}
170173 self ._update ('ports' , port ['port' ]['id' ], new ,
171174 headers = {'If-Match' : 'revision_number=1' },
172175 expected_code = exc .HTTPPreconditionFailed .code )
0 commit comments