Ticket #171 (closed enhancement: fixed)

Opened 7 months ago

Last modified 6 months ago

TestCases need timeout values

Reported by: fcohen Assigned to:
Priority: critical Milestone:
Version: 5.1 Keywords:
Cc:

Description

Ron Warshawski of DBA InfoPower recommends we add a time-out parameter to TestScenarios?. We were watching a test operate where the <run> element of a TestScenario runs a TestCase? that makes a call to a Stored Procedure in a database. The Stored Procedure did a full table scan and did not return for 5+ minutes. The test ended before the TestCase? was done. Adding a timeout value to the <run> element in a TestScenario would make debugging issues like this easier.

An example:

<usecases>

<usecase name="Examples_usecase">

<sequence name="Examples_sequence" proportion="100">

<test>

<run name="MyTest?" testclass="PTT_Examples_UnitTest.testgen4web"

method="testGen4Web" langtype="testgen4web" timeout="1500"/>

</test>

</sequence>

</usecase>

</usecases>

If the <run> element call takes more than 1500 milliseconds then a TimeoutException? throws.

-Frank

Attachments

franktest.py (1.4 kB) - added by fcohen on 11/08/07 07:59:47.
Unit test script that takes more than 5 seconds to process
loadtest.xml (1.7 kB) - added by fcohen on 11/08/07 08:00:08.
TestScenario with timeout="3000"

Change History

10/29/07 21:34:58 changed by fcohen

  • priority changed from major to critical.
  • type changed from defect to enhancement.

11/08/07 07:59:47 changed by fcohen

  • attachment franktest.py added.

Unit test script that takes more than 5 seconds to process

11/08/07 08:00:08 changed by fcohen

  • attachment loadtest.xml added.

TestScenario with timeout="3000"

11/08/07 08:00:57 changed by fcohen

Frank wrote:

I could not confirm that ticket 171 - the timeout function on test use cases - is functioning. See the ticket (http://bugs.pushtotest.com/ticket/171) for the TestScenario and unit test script.

While the test operates I see the Output panel reporting successes. The unit test script calls:

http://examples.pushtotest.com/responder/htmlresponder?sleeptime=5000

This URL tells the htmlresponder servlet to sleep for 5000 milliseconds before returning a response. The TestScenario <run> method has the timeout value set to 3000.

<run module="frankmodule" name="test1" testclass="franktest" method="runTest" langtype="jython" timeout="3000"/>

So the <run> should timeout and indicate that this test usecase is a failure.

-Frank

11/09/07 22:23:12 changed by fcohen

  • status changed from new to closed.
  • resolution set to fixed.

Confirmed works. Also, the new TestMaker_home/example_agents/timeoutExample illustrates the timeout function. Nicely done.

-Frank