Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Timeout on prove

by perlfan (Vicar)
on Jul 02, 2014 at 23:53 UTC ( [id://1092061]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # mock returned data
    *Package::method = sub { return 'some expected data' };
    
  2. or download this
    # mock a timeout, but wrap this in an eval/alarm
    my $a_long_time = 900; # seconds
    *Package::method = sub { sleep $a_long_time; return; };
    
  3. or download this
    # mock a die from timeout, but wrap this in an eval/alarm
    *Package::method = sub { die "Timed out!\n"; };
    
  4. or download this
    # mock a timeout exception, but wrap this in an eval/alarm
    *Package::method = sub { throw My::Exception::Timeout; };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1092061]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (None)
    As of 2024-04-25 00:02 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found