Patchwork D6658: py3: fix test-setdiscovery.t on Python 3 by conditionalizing two lines

login
register
mail settings
Submitter phabricator
Date July 18, 2019, 6:24 p.m.
Message ID <differential-rev-PHID-DREV-rzytgoj5utc3wbndftkw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40975/
State Superseded
Headers show

Comments

phabricator - July 18, 2019, 6:24 p.m.
durin42 created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm not clear why this behaves very slightly differently on Python 3,
  but I'm also not concerned about it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6658

AFFECTED FILES
  tests/test-setdiscovery.t

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mjpieters, mercurial-devel
phabricator - July 21, 2019, 2:24 p.m.
This revision is now accepted and ready to land.
martinvonz added a comment.
martinvonz accepted this revision.


  Heh, I wrote a patch for this before I saw yours. The problem is that `random.sample()` (and other integer-based functions) changed, see https://bugs.python.org/issue27742.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6658/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6658

To: durin42, #hg-reviewers, martinvonz
Cc: martinvonz, mjpieters, mercurial-devel
phabricator - July 22, 2019, 12:25 a.m.
martinvonz added inline comments.

INLINE COMMENTS

> test-setdiscovery.t:988
> +  query 5; still undecided: 185, sample size is: 185 (no-py3 !)
> +  query 5; still undecided: 187, sample size is: 185 (py3 !)
>    5 total queries in *.????s (glob)

Fixing this in flight to be 187 in both places :)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6658/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6658

To: durin42, #hg-reviewers, martinvonz
Cc: martinvonz, mjpieters, mercurial-devel
phabricator - July 22, 2019, 4:54 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> martinvonz wrote in test-setdiscovery.t:988
> Fixing this in flight to be 187 in both places :)

But then the old commit was accepted, so the bad version is now public. I'll send a fix instead.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6658/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6658

To: durin42, #hg-reviewers, martinvonz
Cc: martinvonz, mjpieters, mercurial-devel

Patch

diff --git a/tests/test-setdiscovery.t b/tests/test-setdiscovery.t
--- a/tests/test-setdiscovery.t
+++ b/tests/test-setdiscovery.t
@@ -980,10 +980,12 @@ 
   query 3; still undecided: 980, sample size is: 200
   sampling from both directions
   searching: 4 queries
-  query 4; still undecided: 435, sample size is: 210
+  query 4; still undecided: 435, sample size is: 210 (no-py3 !)
+  query 4; still undecided: 430, sample size is: 210 (py3 !)
   sampling from both directions
   searching: 5 queries
-  query 5; still undecided: 185, sample size is: 185
+  query 5; still undecided: 185, sample size is: 185 (no-py3 !)
+  query 5; still undecided: 187, sample size is: 185 (py3 !)
   5 total queries in *.????s (glob)
   elapsed time:  * seconds (glob)
   heads summary: