Ticket #2675 (new defect )

Opened 2 years ago

Last modified 1 year ago

Test timeout policy should be decided by runner

Reported by: jml Assigned to: jml
Type: defect Priority: high
Milestone: Component: trial
Keywords: Cc:
Branch: Author:
Launchpad Bug:

Description

At the moment, any test made from t.trial.unittest.TestCase will have a two minute default timeout. This is incorrect. The default timeout for tests should be specified by the runner, not by the Trial API. By default, tests should not timeout.

Attachments

Change History

  2007-05-24 08:48:40+00:00 changed by glyph

I'm not sure I agree with:

"By default, tests should not timeout."

but then I'm not sure what you're referring to. I think I agree with the general sentiment here of who should decide and why, but the default configuration of the default runner should specify a reasonable timeout.

  2007-05-24 12:23:25+00:00 changed by exarkun

Like glyph, most of this ticket makes sense to me, but the last sentence of the description also confuses me. This test suite:

from twisted.trial.unittest import TestCase
from twisted.internet.defer import Deferred
class HangingTests(TestCase):
    def test_hangs(self):
        return Deferred()

should not result in trial test_hangs requiring a ^C (or other signal) to cause it to complete.

  2007-05-24 23:04:37+00:00 changed by jml

Right. The default configuration of the default runner should timeout tests.

What I meant was that, HangingTests('test_hangs').run(TestResult()) should hang unless an explicit timeout-ing API is called.

  2008-01-06 00:12:32+00:00 changed by exarkun

  • priority changed from normal to high
  • branch deleted
  • author deleted

It would also be very useful if the timeout could be specified as a command line argument to the trial program.

I kind of want this for a number of reasons, so I'm bumping the priority.

Note: See TracTickets for help on using tickets.