comparison tests/test-setdiscovery.t @ 23233:c1f370dab456

discovery: test coverage for issue4438 / 86c35b7ae300 / 73cfaa348650 The randomness in the discovery protocol made this problem hard to reproduce. The test mocks random.sample to make sure we hit the problem every time. The set iteration order also made the output unstable ... but with the issue fixed, it is stable.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 06 Nov 2014 01:48:29 +0100
parents ced632394371
children 96c3cbec006f
comparison
equal deleted inserted replaced
23230:7f4f4217c924 23233:c1f370dab456
355 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db 355 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db
356 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477 356 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477
357 $ cat errors.log 357 $ cat errors.log
358 358
359 $ cd .. 359 $ cd ..
360
361
362 Issue 4438 - test coverage for 3ef893520a85 issues.
363
364 $ mkdir issue4438
365 $ cd issue4438
366 #if false
367 generate new bundles:
368 $ hg init r1
369 $ for i in `seq 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done
370 $ hg clone -q r1 r2
371 $ for i in `seq 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done
372 $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change
373 $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg
374 $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg
375 #else
376 use existing bundles:
377 $ hg clone -q $TESTDIR/bundles/issue4438-r1.hg r1
378 $ hg clone -q $TESTDIR/bundles/issue4438-r2.hg r2
379 #endif
380
381 Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650:
382
383 $ hg -R r1 outgoing r2 -T'{rev} '
384 comparing with r2
385 searching for changes
386 101 102 103 104 105 106 107 108 109 110 (no-eol)
387
388 The case where all the 'initialsamplesize' samples already were common would
389 give 'all remote heads known locally' without checking the remaining heads -
390 fixed in 86c35b7ae300:
391
392 $ cat >> $TESTTMP/unrandomsample.py << EOF
393 > import random
394 > def sample(population, k):
395 > return sorted(population)[:k]
396 > random.sample = sample
397 > EOF
398
399 $ cat >> r1/.hg/hgrc << EOF
400 > [extensions]
401 > unrandomsample = $TESTTMP/unrandomsample.py
402 > EOF
403
404 $ hg -R r1 outgoing r2 -T'{rev} '
405 comparing with r2
406 searching for changes
407 101 102 103 104 105 106 107 108 109 110 (no-eol)
408 $ cd ..