Ticket #4699: trac_4699_fix.patch

File trac_4699_fix.patch, 2.1 KB (added by gfurnish, 13 years ago)
  • sage-doctest

    # HG changeset patch
    # User Gary Furnish <gfurnish@gfurnish.net>
    # Date 1229004228 28800
    # Node ID 999f713f7e0629155583d4560ab872966b233332
    # Parent  fa025d02ab5e65b8224ad6fc0e6e982276fc3855
    trac #4699
    
    diff -r fa025d02ab5e -r 999f713f7e06 sage-doctest
    a b  
    468468                import subprocess
    469469                proc = subprocess.Popen(cmd,shell=True)
    470470                while time.time()-tm <= TIMEOUT and proc.poll() == None:
    471                     time.sleep(1.0)
     471                    time.sleep(0.1)
    472472                if time.time()-tm >=TIMEOUT:
    473473                    os.kill(proc.pid, 9)
    474474                    print "*** *** Error: TIMED OUT! PROCESS KILLED! *** ***"
     
    478478                import subprocess
    479479                proc = subprocess.Popen(cmd,shell=True, stdout=outf.file.fileno(), stderr = outf.file.fileno())
    480480                while time.time()-tm <= TIMEOUT and proc.poll() == None:
    481                     time.sleep(1.0)
     481                    time.sleep(0.1)
    482482                if time.time()-tm >=TIMEOUT:
    483483                    os.kill(proc.pid, 9)
    484484                    print "*** *** Error: TIMED OUT! PROCESS KILLED! *** ***"
  • sage-ptest

    diff -r fa025d02ab5e -r 999f713f7e06 sage-ptest
    a b  
    116116    """
    117117    This is the function that actually tests a file
    118118    """
    119     t = time.time()
    120119    outfile = tempfile.NamedTemporaryFile()
    121120    base, ext = os.path.splitext(F)
    122121    if use_sage_only or ext == '.sage':
     
    128127        os.chdir(os.path.dirname(F))
    129128        s = 'bash -c "%s/local/bin/sage-%s %s > %s" ' %(SAGE_ROOT, cmd, filestr, outfile.name)
    130129        try:
     130            t = time.time()
    131131            ret = os.system(s)
     132            finished_time = time.time() - t
    132133            if ret>=256:
    133134                ret=ret/256
    134135            ret = -ret
     
    138139        ol = outfile.read()
    139140        if ret != 0:
    140141            break
    141     finished_time = time.time() - t
    142142    return (F, ret, finished_time, ol)
    143143
    144144def process_result(result):