Merge lp://staging/~mbp/bzr/test-timeout into lp://staging/bzr

Proposed by Martin Pool
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 6320
Proposed branch: lp://staging/~mbp/bzr/test-timeout
Merge into: lp://staging/bzr
Diff against target: 109 lines (+45/-1)
5 files modified
Makefile (+2/-1)
bzrlib/config.py (+8/-0)
bzrlib/tests/__init__.py (+10/-0)
bzrlib/tests/fixtures.py (+20/-0)
doc/en/release-notes/bzr-2.5.txt (+5/-0)
To merge this branch: bzr merge lp://staging/~mbp/bzr/test-timeout
Reviewer Review Type Date Requested Status
Vincent Ladeuil Needs Fixing
Review via email: mp+83559@code.staging.launchpad.net

Commit message

bzr selftest tests fail after a configurable timeout

Description of the change

We had some problems recently where tests got stuck indefinitely on pqm.

This adds an option selftest.timeout that will cause the tests to abort after that much time, on unix only.

I'm not sure what the default should be. It will be annoying if you're debugging the test and it aborts. On the other hand for most contexts blocking indefinitely is not good.

This will only cover Unix since it relies on alarm().

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

[beware] of conflicts

[cautious] I would set the alarm even before checking the test features, something can go wrong there too

[PEP8] line too long
36 + timeout_fixture = fixtures.TimeoutFixture(config.GlobalStack().get('selftest.timeout'))

[clarity]
72 + self.alarm_fn = getattr(signal, 'alarm', None)

This could go into __init__ and the other methods can then use 'if self.alarm_fn is not None'.

This is worth a news entry explaining how it will manifest itself ?

review: Needs Fixing
Revision history for this message
Martin Pool (mbp) wrote :

thanks, all done.

Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Revision history for this message
Martin Pool (mbp) wrote :

similar code is now in python-fixtures, though we don't yet depend on that. if we did, we could split it out.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.