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
[Corion]: Hurr. Yesterday I played around with ffmpeg as a new toy and found its "scene" filter great - it detects scene changes. Now I could write a module that splits a given video on its cuts into different scenes. Except I have no use case for that :)
[Corion]: (and also, writing yet another FFmpeg module just to wrap system() and grep through its output isn't all that great ...)
[erix]: cut out advertisements from movies? :)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2018-05-24 11:10 GMT
Find Nodes?
    Voting Booth?