Change in vdsm[master]: tests: fix wrong use of assertions

danken at redhat.com danken at redhat.com
Tue Jun 10 10:29:43 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: tests: fix wrong use of assertions
......................................................................


Patch Set 4:

(2 comments)

http://gerrit.ovirt.org/#/c/28124/4/tests/functional/storageTests.py
File tests/functional/storageTests.py:

Line 542:             try:
Line 543:                 unexportNFS(export)
Line 544:             except TestRunnerError as e:
Line 545:                 logging.warning("Failed to unexport NFS entry %s: %s",
Line 546:                                 export, e)
> Done
with exception(), "e" is redundant in the "except" line.
Line 547:             else:
Line 548:                 shutil.rmtree(export, ignore_errors=True)
Line 549: 
Line 550: 


http://gerrit.ovirt.org/#/c/28124/4/tests/testrunner.py
File tests/testrunner.py:

Line 392:     raise AssertionError(msg)
Line 393: 
Line 394: 
Line 395: def runCommand(*args):
Line 396:     process = subprocess.Popen(args, stderr=subprocess.PIPE,
> it's a bad practice. what is the use of continuing it?
execCmd surely has problems (the worst of them -- due to the misplaced AsyncProc -- is the different type of the return value, depending on the value of the sync arg).

However, I trust execCmd. Until the recent cpu-hogging bug, we had a long period of quiet using it. I do not find it particularly heavy or hard to use.

I think that we should not start a holy war about it in this patch, which has obviously-correct fixes of assertions.
Line 397:                                stdout=subprocess.PIPE)
Line 398:     output, error = process.communicate()
Line 399:     if process.returncode != 0:
Line 400:         raise TestRunnerError("subprocess failed: returncode=%s: stderr=%r" %


-- 
To view, visit http://gerrit.ovirt.org/28124
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I693923e6dcaa05bc1479db814c0b7696b3536c9c
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yoav Kleinberger <ykleinbe at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yoav Kleinberger <ykleinbe at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list