Nir Soffer has posted comments on this change.

Change subject: tests: SDM.copy_data test for abort while copying
......................................................................


Patch Set 5: Code-Review-1

(4 comments)

https://gerrit.ovirt.org/#/c/64479/5/tests/storage_sdm_copy_data_test.py
File tests/storage_sdm_copy_data_test.py:

Line 274
Line 275
Line 276
Line 277
Line 278
Lets use here the started event owned by the FakeQemuConvertChecker.

One problem with this, is that all operations shared the same event. Since we 
cannot really support multiple operations without reces, we can return self  in 
the checker, and have the checker implement the operation interface. Another 
option, that may be cleaner, generated the fake operation in the test and send 
it to the checker.


Line 278
Line 279
Line 280
Line 281
Line 282
So we remove this...


Line 296: 
Line 297: class FakeQemuImgOperation(object):
Line 298:     def __init__(self, error, wait_for_abort):
Line 299:         self.error = error
Line 300:         self.wait_for_abort = wait_for_abort
Lets have an event here...
Line 301:         self.running = True
Line 302: 
Line 303:     def _wait(self):
Line 304:         while self.running:


Line 310:     def wait_for_completion(self):
Line 311:         if self.error:
Line 312:             raise self.error()
Line 313:         if self.wait_for_abort:
Line 314:             self._wait()
And we can wait on the event here:

    if not self.wait_for_abort.wait(1):
        raise RuntimeError("Timeout waiting for abort, broken test?")


-- 
To view, visit https://gerrit.ovirt.org/64479
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I740d9ba42e3bd70865eadcb024ce6d9d8da0af95
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to