#9739: Handle duplicate file basenames when testing multiple files in parallel
-----------------------------------------------+----------------------------
   Reporter:  mpatel                           |          Owner:  mvngu         
             
       Type:  defect                           |         Status:  needs_review  
             
   Priority:  critical                         |      Milestone:  sage-4.7.1    
             
  Component:  doctest                          |       Keywords:  doctest 
scripts            
Work_issues:                                   |       Upstream:  N/A           
             
   Reviewer:  Robert Bradshaw, Leif Leonhardy  |         Author:  Mitesh Patel, 
John Palmieri
     Merged:                                   |   Dependencies:                
             
-----------------------------------------------+----------------------------

Comment(by jhpalmieri):

 What still needs to be done here?

 Replying to [comment:70 leif]:
 > Replying to [comment:68 jhpalmieri]:
 > > Replying to [comment:67 leif]:
 > > > I'd prefer `sage-doctest`'s PID, appended (separated by an
 underscore) as [comment:62 above].
 > >
 > > Do we also need to add this PID to the output from `filename_mangler`,
 in case someone is doctesting the same file in the Sage library several
 times simultaneously?
 >
 > Yes; you apparently already did so in the new patch.
 >
 > But we actually don't have to mangle any path into the filename if we do
 that, since every file is tested by its own `sage-doctest` instance, in a
 directory unique to the host and the `sage-ptest` instance.

 I can remove the pathname from the mangling. If we're just adding the pid,
 I may discard the function `filename_mangler` and deal with it like this:
 {{{
 #!diff
 -        f = os.path.splitext(filename_mangler(file))[0] + '.py'
 +        f = os.path.join(SAGE_TESTDIR, "doctest_%s_%s.py" % (os.getpid(),
 name))
 }}}
 `filename_mangler` only gets used in this one place anyway.

 > > Regarding deleting files on interruption: it's not clear how to easily
 determine whether there was an error before the interruption — do you need
 to use `post_process`? — so I'm just adding some comments and not touching
 the code.
 >
 > Ok. I actually didn't think about doctest errors ''in the same file''
 that may have occurred prior to interruption; it would IMHO be ok to just
 "discard" them, but we can decide on that on the corresponding follow-up.

 Well, some library files can take a long time to doctest, so I can imagine
 someone doctesting a file, seeing that it fails and then interrupting it,
 but wanting to keep the temporary file for some reason.  (As I said, I'm
 not planning on modifying this code anyway.)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9739#comment:72>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to