Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

handling test hangs/crashes/freezes

by bulk88 (Priest)
on Apr 30, 2012 at 05:55 UTC ( #967999=perlquestion: print w/replies, xml ) Need Help??
bulk88 has asked for the wisdom of the Perl Monks concerning the following question:

In a ExtUtils::MakeMaker based module, whats the best or the or a way of dealing with the problem if your pretty sure most of the test failure will result in indefinitely hanging/freezing in OS calls, or crashing the perl process running the .t file? Or dont deal with it, the user installing the module knows how to kill processes?

Replies are listed 'Best First'.
Re: handling test hangs/crashes/freezes
by Corion (Pope) on Apr 30, 2012 at 07:08 UTC

    One approach would be to try to make the test files themselves more robust (or more fragile) using alarm and potentially spawning a second Perl process to be watched.

    Personally, I would let things crash, as most smoke testers have such watchdogs already and will abort a test suite after 5 minutes or so. If a user wants to install a module that crashes the interpreter, they will have to skip tests.

      Alarm wouldnt work for me. This is Windows. Alarm on Windows cant break syscalls. The reasons for hanging are I/O and OS threading related. Well, they were until I fixed the reasons for the hangs, but my problem is, if it does "fail" it will fail by hanging. So best idea is not plan for hangs and crashes in tests, since a user shouldnt "normally" see the test fail, and in the rare case it does hang, the user has an automatic watchdog or Ctrl-C/Task Manager to kill it?

        Yes. On Windows, alarm won't help you much, but all the automated testers should have provisions against hanging test suites.

        kill will terminate processes on Windows.

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Re: handling test hangs/crashes/freezes
by Anonymous Monk on Apr 30, 2012 at 07:27 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://967999]
Approved by Old_Gray_Bear
[PriNet]: i think i found the problem, the "source" array that sets the individual key values isn't being cleared, it's keeping the previous values...
[atcroft]: PriNet: You might consider posting a small, self-contained snippet of that segment of your code, and see if someone else has a better idea.....
[atcroft]: PriNet: Ahhh... interesting.
[PriNet]: small would be a problem *heh*... the program reads all the lines from a pdf and converts the individual colum data to a seperate key/value pair... that's where the "previous" array from the pdf is not being cleared properly before reading the next pdf
[atcroft]: PriNet: It was a thought....
[PriNet]: thanx... actually just having someone to talk to was making me think... *heh*
[PriNet]: a regular array would just be "delete @array" correct? no need for the post "()" ?

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2017-06-28 03:18 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (620 votes). Check out past polls.