Patchwork [RFC] tests: remaining Windows failures

login
register
mail settings
Submitter Matt Harbison
Date April 20, 2017, 3:04 a.m.
Message ID <512163f5338fc89676c3.1492657457@Envy>
Download mbox | patch
Permalink /patch/20269/
State Not Applicable
Headers show

Comments

Matt Harbison - April 20, 2017, 3:04 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1492656801 14400
#      Wed Apr 19 22:53:21 2017 -0400
# Branch stable
# Node ID 512163f5338fc89676c3f9d6a6b00ae67454ab24
# Parent  59afb0750aecaff6c2b2e4edaab04eb91eca8a88
tests: remaining Windows failures

These are the last of the failing tests, but I'm stumped by them.  Just throwing
them out there, in case anybody either has thoughts, or knows that certain
things won't work on Windows.  I have an hghaveaddon.py that overrides
hghave.has_serve() to True on Windows to see some of these.

It's unclear to me what test-bookmarks-pushpull is trying to do.  It's not an
issue with the hook not being directly executable, like some previous fixes.

The hghave failure already has its own thread [1].

I don't know anything about the wire protocol to explain http-proxy.  The
first thing missing is hgtagsfnodes.  Killing the daemon prior to catting
doesn't help, so it isn't a case of unflushed I/O.

If DETACHED_PROCESS is commented out of logtoprocess [3], a new console is shown
with the output, and the text gets added to the test output properly.  But
that's probably not the desired behavior.  Should this just #require no-windows?

The test-worker failure just popped up, and I haven't investgated yet.


[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/096471.html
[2] https://bz.mercurial-scm.org/show_bug.cgi?id=5543
[3] https://www.mercurial-scm.org/repo/hg/file/ed42e00a5c4e/hgext/logtoprocess.py#l57
Jun Wu - April 20, 2017, 2:42 p.m.
Excerpts from Matt Harbison's message of 2017-04-19 23:04:17 -0400:
> [...]
> diff --git a/tests/test-worker.t b/tests/test-worker.t
> --- a/tests/test-worker.t
> +++ b/tests/test-worker.t
> @@ -81,7 +81,6 @@
>    $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=2' \
>    > test 100000.0 abort --traceback 2>&1 | grep '^Traceback'
>    Traceback (most recent call last):
> -  Traceback (most recent call last):

This is because worker only works for POSIX. Related code are:

    if pycompat.osname == 'posix':
        _startupcost = 0.01
    else:
        _startupcost = 1e30

    def worthwhile(ui, costperop, nops):
        '''try to determine whether the benefit of multiple processes can
        outweigh the cost of starting them'''
        linear = costperop * nops
        workers = _numworkers(ui)
        benefit = linear - (_startupcost * workers + linear / workers)
        return benefit >= 0.15

worthwhile return False because benefit is negative.

    if pycompat.osname != 'nt':
        _platformworker = _posixworker
        _exitstatus = _posixexitstatus

_platformworker is undefined on Windows.

>  
>  Traceback must be printed for unknown exceptions
Matt Harbison - April 21, 2017, 1:19 a.m.
On Thu, 20 Apr 2017 10:42:50 -0400, Jun Wu <quark@fb.com> wrote:

> Excerpts from Matt Harbison's message of 2017-04-19 23:04:17 -0400:
>> [...]
>> diff --git a/tests/test-worker.t b/tests/test-worker.t
>> --- a/tests/test-worker.t
>> +++ b/tests/test-worker.t
>> @@ -81,7 +81,6 @@
>>    $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=2' \
>>    > test 100000.0 abort --traceback 2>&1 | grep '^Traceback'
>>    Traceback (most recent call last):
>> -  Traceback (most recent call last):
>
> This is because worker only works for POSIX. Related code are:
>
>     if pycompat.osname == 'posix':
>         _startupcost = 0.01
>     else:
>         _startupcost = 1e30
>
>     def worthwhile(ui, costperop, nops):
>         '''try to determine whether the benefit of multiple processes can
>         outweigh the cost of starting them'''
>         linear = costperop * nops
>         workers = _numworkers(ui)
>         benefit = linear - (_startupcost * workers + linear / workers)
>         return benefit >= 0.15
>
> worthwhile return False because benefit is negative.
>
>     if pycompat.osname != 'nt':
>         _platformworker = _posixworker
>         _exitstatus = _posixexitstatus
>
> _platformworker is undefined on Windows.

Thanks for the detailed explanation.

>
>>
>>  Traceback must be printed for unknown exceptions

Patch

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
@@ -364,24 +364,18 @@ 
   $ hg -R $TESTTMP/pull-race book
      @                         1:0d2164f0ce0d
      X                         1:0d2164f0ce0d
-   * Y                         5:35d1ef0a8d1b
+   * Y                         4:b0a5eff05604
      Z                         1:0d2164f0ce0d
   $ hg update -r Y
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (activating bookmark Y)
   $ hg pull -B .
   pulling from http://localhost:$HGPORT/
-  searching for changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 1 changes to 1 files
-  updating bookmark Y
-  (run 'hg update' to get a working copy)
+  no changes found
   $ hg book
      @                         1:0d2164f0ce0d
      X                         1:0d2164f0ce0d
-   * Y                         5:35d1ef0a8d1b
+   * Y                         4:b0a5eff05604
      Z                         1:0d2164f0ce0d
 
 (done with this section of the test)
diff --git a/tests/test-hghave.t b/tests/test-hghave.t
--- a/tests/test-hghave.t
+++ b/tests/test-hghave.t
@@ -19,7 +19,11 @@ 
   >   foo
   > EOF
   $ run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
+  warning: Testing with unexpected mercurial lib: c:\Users\Matt\Projects\hg\mercurial
+           (expected C:\Users\Matt\AppData\Local\Temp\hgtests.6bowmx\install\lib\python\mercurial)
   .
+  warning: Tested with unexpected mercurial lib: c:\Users\Matt\Projects\hg\mercurial
+           (expected C:\Users\Matt\AppData\Local\Temp\hgtests.6bowmx\install\lib\python\mercurial)
   # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
 
 (invocation via command line)
diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t
--- a/tests/test-http-proxy.t
+++ b/tests/test-http-proxy.t
@@ -100,6 +100,9 @@ 
   added 1 changesets with 1 changes to 1 files
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ killdaemons.py
+
   $ cat proxy.log
   * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
@@ -117,4 +120,4 @@ 
   * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
   * - - [*] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
-  * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=phases%2Cbookmarks x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
+  * - - [*] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250 (no-eol) (glob)
diff --git a/tests/test-logtoprocess.t b/tests/test-logtoprocess.t
--- a/tests/test-logtoprocess.t
+++ b/tests/test-logtoprocess.t
@@ -40,22 +40,6 @@ 
 
 Use sort to avoid ordering issues between the various processes we spawn:
   $ hg foo | cat | sort
-  
-  
-  
-  0
-  a message: spam
-  command
-  commandfinish
-  foo
-  foo
-  foo
-  foo
-  foo exited 0 after * seconds (glob)
-  logtoprocess command output:
-  logtoprocess commandfinish output:
-  logtoprocess foo output:
-  spam
 
 Confirm that logging blocked time catches stdio properly:
   $ cp $HGRCPATH.bak $HGRCPATH
@@ -70,4 +54,3 @@ 
   > EOF
 
   $ hg log | cat
-  uiblocked stdio [0-9]+.[0-9]* ms command [0-9]+.[0-9]* ms (re)
diff --git a/tests/test-worker.t b/tests/test-worker.t
--- a/tests/test-worker.t
+++ b/tests/test-worker.t
@@ -81,7 +81,6 @@ 
   $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=2' \
   > test 100000.0 abort --traceback 2>&1 | grep '^Traceback'
   Traceback (most recent call last):
-  Traceback (most recent call last):
 
 Traceback must be printed for unknown exceptions