Patchwork [10,of,11] py3: conditionalize some LFS test output

login
register
mail settings
Submitter Matt Harbison
Date Jan. 28, 2019, 5:20 a.m.
Message ID <9ee17fc21ed1a6ebf0c7.1548652856@Envy>
Download mbox | patch
Permalink /patch/38136/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 28, 2019, 5:20 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1548640698 18000
#      Sun Jan 27 20:58:18 2019 -0500
# Node ID 9ee17fc21ed1a6ebf0c7180561f004f98a72c248
# Parent  fa54bec6b7c74114cfe1d59abdf429fff5c3dd22
py3: conditionalize some LFS test output

I'm not sure why the one stackframe is py2 only, but that seems harmless.  The
remaining failure is LfsCorruptionError printing the fully qualified name, as
well as b'' around its message.
Matt Harbison - Jan. 28, 2019, 5:33 a.m.
On Mon, 28 Jan 2019 00:20:56 -0500, Matt Harbison <mharbison72@gmail.com>  
wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1548640698 18000
> #      Sun Jan 27 20:58:18 2019 -0500
> # Node ID 9ee17fc21ed1a6ebf0c7180561f004f98a72c248
> # Parent  fa54bec6b7c74114cfe1d59abdf429fff5c3dd22
> py3: conditionalize some LFS test output
>
> I'm not sure why the one stackframe is py2 only, but that seems  
> harmless.  The
> remaining failure is LfsCorruptionError printing the fully qualified  
> name, as
> well as b'' around its message.

I think the fire is out here, but there are a couple more failures in  
addition to this.

Most concerning is this message in test-lfs-test-server#git-server:

   31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b:  
{"message":"invalid byte in chunk length"}

It's near the top, and I suspect is the cause of the subsequent extensive  
failures, because the same test to the hg server code passes.  So the  
client seems to be sending something bad, and the hg server isn't  
detecting this.

Second is this:

   --- c:/Users/Matt/hg/tests/test-lfs-serve.t
   +++ c:/Users/Matt/hg/tests/test-lfs-serve.t#lfsremote-on.err
   @@ -665,7 +665,7 @@
    #if lfsremote-on
      $ cat $TESTTMP/errors.log | grep '^[A-Z]'
      Traceback (most recent call last):
   -  ValueError: no common changegroup version
   +  ValueError: b'no common changegroup version'
    #else
      $ cat $TESTTMP/errors.log
    #endif

Some ValueErrors have translated strings, but most don't.  Very few have  
r'' prefixes.  So IDK if it's a reasonable plan to add a subclass of  
ValueError to the errors module that would take bytes in the constructor  
and translate to str for the native class.  But it seems like a general  
issue beyond LFS, so I'm punting on that.
Yuya Nishihara - Jan. 28, 2019, 11:57 a.m.
On Mon, 28 Jan 2019 00:33:21 -0500, Matt Harbison wrote:
> Second is this:
> 
>    --- c:/Users/Matt/hg/tests/test-lfs-serve.t
>    +++ c:/Users/Matt/hg/tests/test-lfs-serve.t#lfsremote-on.err
>    @@ -665,7 +665,7 @@
>     #if lfsremote-on
>       $ cat $TESTTMP/errors.log | grep '^[A-Z]'
>       Traceback (most recent call last):
>    -  ValueError: no common changegroup version
>    +  ValueError: b'no common changegroup version'
>     #else
>       $ cat $TESTTMP/errors.log
>     #endif
> 
> Some ValueErrors have translated strings, but most don't.  Very few have  
> r'' prefixes.  So IDK if it's a reasonable plan to add a subclass of  
> ValueError to the errors module that would take bytes in the constructor  
> and translate to str for the native class.

Maybe we shouldn't abuse ValueError for our custom errors.

Patch

diff --git a/tests/test-lfs-serve-access.t b/tests/test-lfs-serve-access.t
--- a/tests/test-lfs-serve-access.t
+++ b/tests/test-lfs-serve-access.t
@@ -340,13 +340,13 @@  Test a checksum failure during the proce
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
   $LOCALIP - - [$ERRDATE$] HG error:      verifies = store.verify(oid) (glob)
   $LOCALIP - - [$ERRDATE$] HG error:      raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8")) (glob)
-  $LOCALIP - - [$ERRDATE$] HG error:  IOError: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob)
+  $LOCALIP - - [$ERRDATE$] HG error:  *Error: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob)
   $LOCALIP - - [$ERRDATE$] HG error:   (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Exception happened while processing request '/.git/info/lfs/objects/batch': (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
   $LOCALIP - - [$ERRDATE$] HG error:      verifies = store.verify(oid) (glob)
   $LOCALIP - - [$ERRDATE$] HG error:      raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8")) (glob)
-  $LOCALIP - - [$ERRDATE$] HG error:  IOError: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob)
+  $LOCALIP - - [$ERRDATE$] HG error:  *Error: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob)
   $LOCALIP - - [$ERRDATE$] HG error:   (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Exception happened while processing request '/.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c': (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)
@@ -362,12 +362,12 @@  Test a checksum failure during the proce
       for chunk in self.server.application(env, self._start_response):
       for r in self._runwsgi(req, res, repo):
       rctx, req, res, self.check_perm)
-      return func(*(args + a), **kw)
+      return func(*(args + a), **kw) (no-py3 !)
       lambda perm:
       res.setbodybytes(localstore.read(oid))
       blob = self._read(self.vfs, oid, verify)
       raise IOError(errno.EIO, r'%s: I/O error' % oid.decode("utf-8"))
-  IOError: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error
+  *Error: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error (glob)
   
   $LOCALIP - - [$ERRDATE$] HG error:  Exception happened while processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob)
   $LOCALIP - - [$ERRDATE$] HG error:  Traceback (most recent call last): (glob)