[PATCH V3] hgweb: don't attempt to show hidden bookmarks (issue3774)

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Jan 25 16:17:43 CST 2013


On 25 Jan 2013, at 4:07 PM, Greg Ward wrote:

> On 25 January 2013, Kevin Bullock said:
>> # HG changeset patch
>> # User Kevin Bullock <kbullock at ringworld.org>
>> # Date 1359135834 21600
>> # Branch stable
>> # Node ID f8a44ed8139d3f07038969845a3ef527d6c0b826
>> # Parent  075143f60807c96fd051fd1dde5830852e4e6099
>> hgweb: don't attempt to show hidden bookmarks (issue3774)
>> diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
>> --- a/tests/test-bookmarks-pushpull.t
>> +++ b/tests/test-bookmarks-pushpull.t
>> @@ -288,6 +288,16 @@ hgweb
>> 
>>   $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
>>   $ cat ../hg.pid >> $DAEMON_PIDS
>> +
>> +issue3774
>> +
>> +  $ hg phase -fs X
>> +  $ "$TESTDIR/get-with-headers.py" --headeronly 127.0.0.1:$HGPORT 'bookmarks'
>> +  200 Script output follows
>> +  $ sleep 0.1
>> +  $ cat errors.log
>> +  $ hg phase -d X
>> +
> 
> Rule 1 of concurrent programming: if your code requires a sleep to
> work correctly, it's racy. That applies to tests just as much as to
> production code.
> 
> Also, I strongly suspect that floating point sleep times are a GNUism.
> Portability requires "sleep 1", which will slow the test down
> annoyingly, which will cause you to delete the sleep, which should
> make the race condition more obvious! ;-)

The only race here is waiting for the traceback from hg serve to show up in its error log. It's not my ideal way of exposing the bug. I'm open to other suggestions.

Mads suggested creating a thin wrapper for hgweb that could be called from the cmdline, à la test-newcgi.t. That'd be a fairly large patch, and should really be something we provide generically to help avoid the use of 'hg serve' in the testsuite, so I'm not keen to do it just to fix this one bug during a freeze.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list