[darcs-users] darcs patch: Help the test harness clean to up after ... (and 1 more)

David Roundy daveroundy at gmail.com
Thu Oct 9 10:13:02 UTC 2008

On Thu, Oct 9, 2008 at 6:05 AM, Eric Kow <kowey at darcs.net> wrote:
> On Thu, Oct 09, 2008 at 05:54:41 -0400, David Roundy wrote:
>> >   If tests are run in parallel, each instance of the diff test may
>> >   attempt to create temporary directories for use by darcs diff.
>> >   Darcs itself handles this fine; only the test script gets confused
>> >   by the spurious difference that results.
>> This sounds to me like a workaround for a bug in darcs.  Do you really
>> think it's appropriate to give spurious results?
> As we know, darcs diff generates temporary directories repobasename-old
> and repobasename-new.
> The diff test works by running darcs diff two ways and comparing the
> outputs to make sure they are the same.  It does this because it wants
> to make sure that two different ways of calling darcs diff give the same
> result.  This relies on an implicit (unreasonable) assumption that the
> temporary directories created by darcs will have the same names between
> the two diffs.  This assumption breaks down if you run the diff test in
> parallel, which darcs check is liable to do.
> It seems that darcs itself is doing the right thing here; it avoids
> clobbering pre-existing temporary files by giving new names.  If you
> simultaneously run darcs diff on repositories /a/foo and /b/foo, darcs
> has no choice but to call them different things
>   /tmp/foo-old   /tmp/foo-new
> vs /tmp/foo-old-1 /tmp/foo-new-1
> So darcs itself seems to be doing the right thing.  The test is just
> making a silly assumption.  With my patch, the test continues to make
> the same assumption, but at least the repository basename is armoured
> against accidental similarity.

Hmmm.  Okay, that makes sense.  I hadn't quite followed what was going
on, and was thinking that darcs diff was giving spurious output,
rather than diff of the output of darcs diff giving spurious output...
 Wouldn't a cleaner fix be to grep out the filenames before comparing?


More information about the darcs-users mailing list