SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help Creating a timeout interval for a testcase

    Hi.

    I've got a SilkTest script called from a windows scheduler that is on a 10 minute interval.

    Once in a great while, the script will take 10 minutes or more to execute. As a result, SilkTest blows up because it opens QaPartner.exe and tries to execute the script that is already executing.

    For specific reasons, I'd like to abort the testcase 10 seconds before the next interval, regardless of it's state. (suicide)

    I thought of trying to run a timer in a separate thread while the test is performed.

    however, I can't figure out a way to intercept the timeout interval while the test is running.

    the rendezvous statement waits for both threads to complete, so I can't intercept the thread that return first.

    Anyone have any ideas (or other approaches)?

    thanks!!!

    ------------------

  2. #2
    Senior Member
    Join Date
    Jun 1999
    Location
    Fremont, CA, USA
    Posts
    355
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help Creating a timeout interval for a testcase

    If your using the Windows scheduler, then one thing you can set it to "Stop the task if running for longer than X hours and Y minutes". You can't set seconds though.

    So, have the schedule start the task, and kill the task if it is still running after 9 minutes.



    ------------------
    David Genrich
    david@e2Open.com
    david_kim@usa.net

  3. #3
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help Creating a timeout interval for a testcase

    yeah, unfortunately I'm looking to do this with SilkTest instead of the scheduler....

    Any thoughts??

    ------------------

  4. #4
    Senior Member
    Join Date
    Jun 1999
    Location
    Fremont, CA, USA
    Posts
    355
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help Creating a timeout interval for a testcase

    There are DOS based Process listers and killers that you can get (email me and I can send you them).

    You can then kill the process that way.

    But, after re-reading what you have said, I think that isn't what your looking for.

    The process as I understand it is:

    1. Start timer
    2. start testcases
    3. Check timer
    4. if timer > 9:50, abort run

    So, the timer you can create in SilkTest (look up TimerCreate() and releated functions).

    The part of checking the timer is where you might find the problem. You can check each time a testcase starts or ends, but what about during a testcase?


    How about this for a HACK!

    In your window tags, replace the tag with a function. This function would check the timer, and abort if needed. If not, it will return the tag. It gets the tab by the parameter that you pass in.

    For example, suppose you had the following:

    Now, whenever TextEditor.Help is called, you want to also check your timer. So, you could re-write that as:


    Do that with all top level window objects. Whenever you call any child object, the CheckTimer code will execute. This then gives you a "somewhat" real-time evaluation of your timer. (timer would need to be made global)


    Would that work?




    ------------------
    David Genrich
    david@e2Open.com
    david_kim@usa.net

  5. #5
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help Creating a timeout interval for a testcase

    I figured this out a couple days after the previous post.

    essencially, I do a combination of things:
    1) spawn two tasks:
    a) a timer
    b) the testcase

    in part a, the timer is polled for my timeout interval. If the timeout interval is reached, I do my error handling and use the exit statement to force the testcase to abort.

    in part b, I run the test case as usual and also force an exit statement when finished.

    then the rendezvous statement is placed at the end (not techincally necessary because I always exit first, but I do it for readability)

    Just for eveyone's future reference, don't try to combine your home-made timer with spawn statements. I originally tried to spawn 2 tasks and used my own timer (a while loop w/ sleep(1) inside). Because the spawn statements share processing time, I wasn't exiting the while loop at the specified timeout interval. So my home-made timer wasn't accurate. It turns out that the timer function built into SilkTest keeps track of the time correctly despite sharing the processing time.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:08 AM.

Copyright BetaSoft Inc.