Ticket #2675 (new defect)

Opened 3 years ago

Last modified 3 years ago

Test timeout policy should be decided by runner

Reported by: jml Owned by: jml
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.

Change History

Changed 3 years ago 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.

Changed 3 years ago 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.

Changed 3 years ago 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.

Changed 3 years ago by exarkun

  • priority changed from normal to high

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.