bzrlib.tests.blackbox.test_serve.TestBzrServe.test_server_exception_with_hook is fragile

Bug #789167 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
Vincent Ladeuil

Bug Description

This just failed for me on PQM while trying to submit something unrelated.
======================================================================
FAIL: bzrlib.tests.blackbox.test_serve.TestBzrServe.test_server_exception_with_hook (subunit.RemotedTestCase)
bzrlib.tests.blackbox.test_serve.TestBzrServe.test_server_exception_with_hook
----------------------------------------------------------------------
_StringException: Text attachment: log
------------
226.218 creating config directory: '/tmp/testbzr-z3PLaD.tmp/bzrlib.tests.blackbox.test_serve.TestBzrServe.test_server_exception_with_hook/home/.bazaar'
226.220 run bzr: ['serve']
226.220 bazaar version: 2.4.0dev4
226.220 bzr arguments: [u'serve']
226.236 encoding stdout as sys.stdout encoding 'UTF-8'
    INFO catching exception
226.237 errors:
'catching exception\n'
226.260 opening working tree '/tmp/testbzr-z3PLaD.tmp'
------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/testtools/runtest.py", line 144, in _run_user
    return fn(*args)
  File "/usr/lib/python2.6/dist-packages/testtools/testcase.py", line 465, in _run_test_method
    testMethod()
  File "/home/pqm/bzr-pqm-workdir/home/+trunk/bzrlib/tests/blackbox/test_serve.py", line 107, in test_server_exception_with_hook
    self.assertEqual('listening on port: 4155\ncatching exception\n', err)
AssertionError: not equal:
a = 'listening on port: 4155\ncatching exception\n'
b = 'catching exception\n'

Note that it got the exception before it started listening on the port. I think the fix is that the test should wait until it sees "listening on port" before it triggers the exception.

Either that, or it is a simple stdout/stderr buffering issue. Depending on when the listening line gets flushed, it can not be written before the exception occurs.

Marking this critical because it will cause bouncing from the PQM for things that aren't otherwise broken.

Tags: babune test

Related branches

Revision history for this message
Vincent Ladeuil (vila) wrote :

Hmm, it also listens on port4155 instead of using a random port which should be fixed too.

Revision history for this message
Vincent Ladeuil (vila) wrote :

For the record, this just happened on babune so +1 on Critical ;)

http://babune.ladeuil.net:24842/job/selftest-chroot-natty/38/

tags: added: babune test
Revision history for this message
Vincent Ladeuil (vila) wrote :
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila)
Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b4
status: In Progress → Fix Released
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.