ok! i've tested exporting SAGE_TIMEOUT and it does have an effect, for 
example: 

**********************************************************************
Tests run before process (pid=3019) timed out:
sage: integrate(exp(-x)*sinh(sqrt(x)), x, 0, oo, 
algorithm='maxima').simplify() ## line 10 ##

**********************************************************************

the thing is that there could be tests which are ok after this one, so 
ideally i'd like only that the test fails (without killing the process). 
the behavior i had in mind is analogue to say # abs tol 1e-3  but with a 
time constraint.

El lunes, 8 de mayo de 2017, 10:44:33 (UTC+2), David Roe escribió:
>
>
>
> On Mon, May 8, 2017 at 4:35 AM, mforets <mfo...@gmail.com <javascript:>> 
> wrote:
>
>> Hi, 
>> i wanted to know if there is a keyword that can be put next to a doctest 
>> to measure performance with respect to computation time, like:
>>
>> sage: possibly_long_calculation(..)  # timeout 600s
>> 0
>>
>> this is seems item 1) in this thread's OP, hence i'm attaching this 
>> question here (but please remove if it's not the case). so i didn't 
>> understand how to apply the proposed solution. where are all supported 
>> doctest keywords stored, to begin with? thanks!
>>
>
> These are environment variables, so they're set at the command line before 
> running tests. Something like 
>
> $ export SAGE_TIMEOUT = 900  
> $ sage -t long_time_file.py
>
> should set the timeout for 15 minutes, though I haven't tested it.
>
>
> I don't see a reasonable way to do this for a single line, since the 
> timeout is implemented by killing the process that's running tests.  I'm 
> not 100% clear what kind of behavior you're seeking, so feel free to 
> clarify the question!  The current code that handles this is at 
> $SAGE_ROOT/src/sage/doctest/control.py, lines 269-279.
> David
>
>
>> El jueves, 8 de octubre de 2009, 22:15:01 (UTC+2), John H Palmieri 
>> escribió:
>>>
>>> On Oct 8, 8:43 am, William Stein <wst...@gmail.com> wrote: 
>>> > On Thu, Oct 8, 2009 at 8:37 AM, Dr. David Kirkby 
>>> > 
>>> > <david.kir...@onetel.net> wrote: 
>>> > 
>>> > > It is possible to increases the timeout time allocated for doctests. 
>>> > 
>>> > > 1) For an individual test? 
>>> > > 2) For all of them? 
>>> > 
>>> > > Perhaps this should be an environment variable, or similar if it is 
>>> not 
>>> > > already. 
>>> > 
>>> > The top of local/bin/sage-doctest says: 
>>> > 
>>> > # if any of the following environment variables are set, use them for 
>>> > # the timeout lengths. 
>>> > TIMEOUT = os.getenv('SAGE_TIMEOUT') 
>>> > TIMEOUT_LONG = os.getenv('SAGE_TIMEOUT_LONG') 
>>> > TIMEOUT_VALGRIND = os.getenv('SAGE_TIMEOUT_VALGRIND') 
>>>
>>> This should be documented somewhere else, too.  In the developer's 
>>> guide somewhere? 
>>>
>>>   John 
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com <javascript:>.
>> To post to this group, send email to sage-...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to