@samitouri / QOSamiQemu / commits / 5add514ba3

iotests/migrate-bitmaps-postcopy-test: replace the timing assertion with a content check

`downtime * 10 < postcopy_time` was an unnormalized wall-clock heuristic (commit e80a4150a5) that fails on fast hosts, where the bitmap payload now transfers in under a second. Check the actual invariant instead: right after RESUME, bitmap0's content hash on the destination must not yet match the fully migrated value. Throttle max-bandwidth first, since all-zero chunks skip the payload write and would otherwise let a fast host finish the transfer before the check runs. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Kevin Wolf <kwolf@redhat.com> CC: Hanna Reitz <hreitz@redhat.com> CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-ID: <20260715103451.1930909-4-den@openvz.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Denis V. Lunev committed Jul 15, 2026 at 12:34 UTC 5add514ba36ed2cc2a5aa3be64c4adc72d4d9003
1 file changed +14 -1
tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
+14 -1
@@ -160,12 +160,26 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
160
161 self.vm_b.cmd('migrate-set-capabilities', capabilities=caps)
162
163 + # Throttle so the chunks covering our discards (the only ones
164 + # not skipped by the all-zero fast path) can't outrun the check
165 + # below.
166 + self.vm_a.cmd('migrate-set-parameters', max_bandwidth=16536)
167 +
168 self.vm_a.cmd('migrate', uri='exec:cat>' + fifo)
169
170 self.vm_a.cmd('migrate-start-postcopy')
171
172 event_resume = self.vm_b.event_wait('RESUME')
173 self.vm_b_events.append(event_resume)
174 +
175 + # bitmap0 can't already have its final content: that requires
176 + # the bit data to have actually arrived.
177 + result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
178 + node='drive0', name='bitmap0')
179 + assert result['return']['sha256'] != all_discards_sha256
180 +
181 + self.vm_a.cmd('migrate-set-parameters', max_bandwidth=0)
182 +
183 return (event_resume, discards1_sha256, all_discards_sha256)
184
185 def test_postcopy_success(self):
@@ -186,7 +200,6 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
200 downtime = event_dist(event_stop, event_resume)
201 postcopy_time = event_dist(event_resume, event_complete)
202
189 - assert downtime * 10 < postcopy_time
203 if debug:
204 print('downtime:', downtime)
205 print('postcopy_time:', postcopy_time)