[darcs-users] darcs patch: Add test for issue27.

Trent W. Buck trentbuck at gmail.com
Fri Sep 19 01:06:22 UTC 2008


Eric Kow <kowey at darcs.net> writes:

> On Thu, Sep 18, 2008 at 17:28:34 +0400, Dmitry Kurochkin wrote:
>> Could you explain this in more detail? In the test we pull patch with
>> the same patchinfo as in the current repo. So in the end we get repo
>> with two patches with the same patchinfo - that is tested with
>> 'changes --count'.
>
> Oh actually I had misread your test, and now I understand that it's
> two patches in the same repository.  Then I guess my request is silly.
>
> For what it's worth, the 'wibble problem' is my attempt at demonstrating
> that it is possible to get into trouble without any automation.
>
> darcs init
> touch a b
> darcs add a b
> echo a > a
> echo b > b
> darcs record -am Wibble a; darcs record -am Wibble b
> darcs check

That's not actually asynchronous; try

darcs init
touch a b
darcs record -am Wibble a &
darcs record -am Wibble b &
wait
darcs check

It still won't happen at the same microsecond, in most cases.  I can't
think of a way to write an automated test script this race condition
that doesn't involve editing files in _darcs/patches with an ed (or
whatever) script.

I suppose there might be a way to lie to darcs' get-time procedure, but
offhand I don't know how.  It probably wouldn't be reliable to just set
the epoch time to 0 before you run each test, because of the microsecond
granularity.

PS: Oops, on rereading I see you were showing a potential human
interaction, not a test case.  I'm posting anyway because I think what
I've written is useful.



More information about the darcs-users mailing list