From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuMMC-00088j-Eb for qemu-devel@nongnu.org; Mon, 18 May 2015 10:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuMM8-00086K-96 for qemu-devel@nongnu.org; Mon, 18 May 2015 10:49:28 -0400 Message-ID: <5559FBDD.8070607@redhat.com> Date: Mon, 18 May 2015 10:49:01 -0400 From: John Snow MIME-Version: 1.0 References: <1431667606-14467-1-git-send-email-famz@redhat.com> <5556317B.4080604@redhat.com> <20150518013212.GA19546@ad.nay.redhat.com> In-Reply-To: <20150518013212.GA19546@ad.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Make debugging python tests easier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com On 05/17/2015 09:32 PM, Fam Zheng wrote: > On Fri, 05/15 13:48, John Snow wrote: >> >> >> On 05/15/2015 01:26 AM, Fam Zheng wrote: >>> Adding "-d" option. The output goes to "tee" so it appears in your >>> console. Also, raise the verbosity of unnitest runner. >>> >>> When testing a topic branch, it's possible that a bug introduced by a >>> code change makes the python test case hang, with debug output, it is >>> much easier to locate the problem. >>> >>> This can also be helpful if you want to watch the progress of a python >>> test, it offers you a way to sense the speed of each test case method >>> you're writing. >>> >> >> Awesome idea! >> >> Unfortunately, it explodes when I run ./check -v -d -qcow2 124: >> >> +Traceback (most recent call last): >> + File "124", line 363, in >> + iotests.main(supported_fmts=['qcow2']) >> + File "/home/bos/jhuston/src/qemu/tests/qemu-iotests/iotests.py", line >> 367, in main >> + sys.stderr.write(re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 >> tests', output.getvalue())) >> +AttributeError: 'file' object has no attribute 'getvalue' >> Failures: 124 >> Failed 1 of 1 tests >> >> --js > > I guess we can skip this line if debug is True. (However, I should have noted > in the commit message, by specifying "-d", the purpose of the execution is > solely *debugging the test itself*, and because I didn't find a easy way to get > *both* the verbose debug output and an output that would match $seq.out, this > patch always makes a "-d" execution fail.) > > Will send another version with an additional "if debug". > > Thanks, > > Fam > Ah, I misunderstood: I thought you wanted to just increase the verbosity, and the failing test warnings gave me a bit of pause. Best not to have things that cause a python stack trace laying around on purpose. --js