Intermittent failure in gate guestagent.test_pkg.PkgRPMRemoveTestCase.test_permission_error

Bug #1365531 reported by Amrith Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Amrith Kumar

Bug Description

I've seen this a couple of times. I would like to figure out what it is and do something about it.

2014-09-03 17:34:28.982 | FAIL: guestagent.test_pkg.PkgRPMRemoveTestCase.test_permission_error
2014-09-03 17:34:28.982 | tags: worker-2
2014-09-03 17:34:28.982 | ----------------------------------------------------------------------
2014-09-03 17:34:28.982 | Traceback (most recent call last):
2014-09-03 17:34:28.982 | File "/home/jenkins/workspace/gate-trove-python26/trove/tests/unittests/guestagent/test_pkg.py", line 438, in test_permission_error
2014-09-03 17:34:28.982 | self.pkgName, 5000)
2014-09-03 17:34:28.983 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 420, in assertRaises
2014-09-03 17:34:28.983 | self.assertThat(our_callable, matcher)
2014-09-03 17:34:28.983 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 431, in assertThat
2014-09-03 17:34:28.983 | mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
2014-09-03 17:34:28.983 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 481, in _matchHelper
2014-09-03 17:34:28.983 | mismatch = matcher.match(matchee)
2014-09-03 17:34:28.983 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_exception.py", line 108, in match
2014-09-03 17:34:28.983 | mismatch = self.exception_matcher.match(exc_info)
2014-09-03 17:34:28.983 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_higherorder.py", line 62, in match
2014-09-03 17:34:28.984 | mismatch = matcher.match(matchee)
2014-09-03 17:34:28.984 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 412, in match
2014-09-03 17:34:28.984 | reraise(*matchee)
2014-09-03 17:34:28.984 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/matchers/_exception.py", line 101, in match
2014-09-03 17:34:28.984 | result = matchee()
2014-09-03 17:34:28.984 | File "/home/jenkins/workspace/gate-trove-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 955, in __call__
2014-09-03 17:34:28.984 | return self._callable_object(*self._args, **self._kwargs)
2014-09-03 17:34:28.984 | File "trove/guestagent/pkg.py", line 223, in pkg_remove
2014-09-03 17:34:28.984 | result = self._remove(package_name, time_out)
2014-09-03 17:34:28.984 | File "trove/guestagent/pkg.py", line 172, in _remove
2014-09-03 17:34:28.984 | i, match = self.pexpect_run(cmd, output_expects, time_out)
2014-09-03 17:34:28.985 | File "trove/guestagent/pkg.py", line 97, in pexpect_run
2014-09-03 17:34:28.985 | match = child.match
2014-09-03 17:34:28.985 | AttributeError: 'spawn' object has no attribute 'match'
2014-09-03 17:34:28.985 | Ran 776 tests in 10.846s
2014-09-03 17:34:28.985 | FAILED (id=0, failures=1, skips=1)
2014-09-03 17:34:28.985 | error: testr failed (1)
2014-09-03 17:34:29.060 | ERROR: InvocationError: '/home/jenkins/workspace/gate-trove-python26/.tox/py26/bin/python setup.py testr --slowest'
2014-09-03 17:34:29.060 | ___________________________________ summary ____________________________________

Amrith Kumar (amrith)
Changed in trove:
assignee: nobody → Amrith (amrith)
milestone: none → ongoing
importance: Undecided → Low
Revision history for this message
Amrith Kumar (amrith) wrote :

This is not a dup of 1348601 as this error occurred in a version with that fix in place.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/119483

Changed in trove:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/119483
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=ddd7c0dd27fcddf94defc21502185520fd1d5303
Submitter: Jenkins
Branch: master

commit ddd7c0dd27fcddf94defc21502185520fd1d5303
Author: Amrith Kumar <email address hidden>
Date: Fri Sep 5 17:18:05 2014 -0400

    Fix issue with intermittent test failures in test_pkg.py

    The test failures were a result of randomized test order and the way
    in which these tests were setting up mocks for pexpect.spawn.expect
    and pexpect.spawn.match.

    The code now mocks pexpect.spawn and then sets return values and match
    in each test as appropriate. Code in setUp establishes a patch and a
    cleanUp function is added to reverse the patch. No code is required in
    tearDown as a result.

    execute() was being Mocked using code in setUp and tearDown and this
    was replaced that with a similar patch in setUp with a corresponding
    cleanUp function to reverse its effects.

    Since we're close to Juno, I've not gone down the path of converting
    this test to use a fixture which would further reduce duplicated code.

    Change-Id: I3edfd499823f2c2f4591e709384a24f1b55abe5a
    Closes-Bug: 1365531

Changed in trove:
status: In Progress → Fix Committed
Changed in trove:
milestone: ongoing → juno-rc1
importance: Low → Medium
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.