wireapp / wire-server

🇪🇺 Wire back-end services
https://wire.com
GNU Affero General Public License v3.0
2.6k stars 325 forks source link

Tests fail due to commitBuffer: invalid argument (invalid character) #764

Open baerbock opened 5 years ago

baerbock commented 5 years ago

While building this occurred. Distro is ArchLinux:

Test suite failure for package cannon-0.31.0
    cannon-tests:  exited with: ExitFailure 1
[.. full log ..]
    benchmarking Cannon.Dict/slices 1
    time                 31.03 ms   (20.21 ms .. 43.63 ms)
                         0.656 Rcannon-tests: <stdout>: commitBuffer: invalid argument (invalid character)

Test suite failure for package types-common-0.16.0
    tests:  exited with: ExitFailure 1
[.. full log ..]
    Tests
      Properties
        Ascii
          validate (toText x) == Right x:                             OK (0.02s)
            +++ OK, passed 100 tests.
          unsafeFromByteString (toByteString x) == x:                 OK (0.01s)
            +++ OK, passed 100 tests.
          validate (toText x <> "tests: <stdout>: commitBuffer: invalid argument (invalid character)
fisx commented 5 years ago

I think we've seen this and decided it's not a serious problem, so fixing got postponed. I don't suppose you still have the full log? It also contains the quickcheck seed that we would need to reproduce this.

Thanks for reporting!

baerbock commented 5 years ago

Logs for the failing tests (tests below each): cannon-0.31.0.log

benchmarking Cannon.Dict/slices 1
time                 29.01 ms   (20.87 ms .. 35.96 ms)
                     0.737 Rcannon-tests: <stdout>: commitBuffer: invalid argument (invalid character)

types-common-0.16.0.log

Tests
  Properties
    Ascii
      validate (toText x) == Right x:                             OK (0.09s)
        +++ OK, passed 100 tests.
      unsafeFromByteString (toByteString x) == x:                 OK (0.01s)
        +++ OK, passed 100 tests.
      validate (toText x <> "tests: <stdout>: commitBuffer: invalid argument (invalid character)

And for the records: types-common-journal-0.1.0.log

baerbock commented 5 years ago

@fisx Have you read this? Sorry for asking.

fisx commented 5 years ago

Yes, still here. i can't find the error in the log files you post, though. Am i reading them right? Can you paste the quickcheck seed here?

This PR should fix your issue, though: https://github.com/wireapp/wire-server/pull/770

Please close this issue if you agree, or add more details if you disagree.

baerbock commented 5 years ago

@fisx I've just cloned from master again and the error is still there.

May you please tell me where I can find the quickcheck seed?

fisx commented 5 years ago

@fisx I've just cloned from master again and the error is still there.

May you please tell me where I can find the quickcheck seed?

it's not merged on master yet, sorry! only for the next release, which is not scheduled yet. you can either check out develop, or merge the change to whichever branch you can best work on.

baerbock commented 5 years ago

@fisx I've just tried to compile the develop branch and the error remained.

chazanov commented 5 years ago

@fisx There is a similar error occurring for me:

Test suite failure for package types-common-0.16.0
    tests:  exited with: ExitFailure 1
Logs printed to console

<stderr>: commitAndReleaseBuffer: invalid argument (invalid character)
Progress 389/396

What about reopenin this issue?

fisx commented 5 years ago

Sure. I'm pretty certain this is an issue with the test, but of course that means it's still an issue.

Do you have time to investigate this? Let me know if you want help!

fisx commented 5 years ago

I've re-read this issue, but I still don't know how to reproduce it. Perhaps you can start by giving us more information?

chazanov commented 5 years ago

@fisx I've just cloned git master, and ran make. Do you know where I can find the Logs printed to console? There is a file called pkgdb/types-common-journal-0.1.0-GiJaXkYmImM7baKj2Pgty7.conf, but it says not much to me (Pastebin).

If there would be a way to completely disable these tests!

fisx commented 5 years ago

could you please, after the test failed:

cd libs/types-common
git status >> everything.log 2>&1
stack test . >> everything.log 2>&1

and attach everything.log here?

chazanov commented 4 years ago

That's weird: all passed:

Tests
  Properties
    Ascii
      validate (toText x) == Right x:                             OK (0.04s)
        +++ OK, passed 100 tests.
      unsafeFromByteString (toByteString x) == x:                 OK
        +++ OK, passed 100 tests.
      validate (toText x <> "𝄞") /= Right x:                      OK
        +++ OK, passed 100 tests.
    Ascii (Printable)
      contains Printable c ==> contains Standard c:               OK
        +++ OK, passed 100 tests.
    Ascii (Base16)
      validate (toText (encode x)) == Right (encode x):           OK
        +++ OK, passed 100 tests.
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
      contains Base16 c ==> contains Standard c:                  OK
        +++ OK, passed 100 tests.
    Ascii (Base64)
      validate (toText (encode x)) == Right (encode x):           OK
        +++ OK, passed 100 tests.
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
      contains Base64 c ==> contains Standard c:                  OK
        +++ OK, passed 100 tests.
    Ascii (Base64Url)
      validate (toText (encode x)) == Right (encode x):           OK
        +++ OK, passed 100 tests.
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
      contains Base64Url c ==> contains Standard c:               OK
        +++ OK, passed 100 tests.
    Base64ByteString
      validate (Aeson.decode . Aeson.encode) == pure . id:        OK
        +++ OK, passed 100 tests.
      examples:                                                   OK
    UTCTimeMillis
      validate (Aeson.decode . Aeson.encode) == pure . id:        OK
        +++ OK, passed 100 tests.
      toUTCTimeMillis:                                            OK
        +++ OK, passed 100 tests.
      validate Eq
        ("1918-04-14T09:58:58.457Z","1918-04-14T09:58:58.457Z"):  OK
        ("1918-04-14T09:58:58.4574Z","1918-04-14T09:58:58.457Z"): OK
        ("1918-04-14T09:58:58.4579Z","1918-04-14T09:58:58.457Z"): OK
      validate Eq
        ("1918-04-14T09:58:58.457Z","1918-04-14T09:58:58.457Z"):  OK
        ("1918-04-14T09:58:58.4574Z","1918-04-14T09:58:58.457Z"): OK
        ("1918-04-14T09:58:58.4579Z","1918-04-14T09:58:58.457Z"): OK
        ("1918-04-14T09:58:58Z","1918-04-14T09:58:58.000Z"):      OK
        ("1918-04-14T09:58:58.1Z","1918-04-14T09:58:58.100Z"):    OK
        ("1918-04-14T09:58:58.12Z","1918-04-14T09:58:58.120Z"):   OK
    UUID
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
    ClientId
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
    AssetId
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
    ConvId
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
    InvitationId
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
    UserId
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.
    Id NoId
      decode . encode = id:                                       OK
        +++ OK, passed 100 tests.

All 33 tests passed (0.08s)

types-common> Test suite tests passed

But the HAS failed. <stderr>: commitAndReleaseBuffer: invalid argument (invalid character)

fisx commented 4 years ago

Then my money is on something is wrong with your working copy, or your ./.stack-work or ~/.stack/.

Can you please try this:

mkdir empty-directory
cd empty-directory
git clone https://github.com/wireapp/wire-server -b develop
cd wire-server
make >> everything.log 2>&1

and attach everything.log. if that reproduces your earlier problem, i will re-open this issue.

chazanov commented 4 years ago

Here it is: https://pastebin.com/W5NpKCKi → same error (the path "/tmp/empty-directory/wire-server" was shortened)

Is this maybe a UTF-8 problem?

fisx commented 4 years ago

Yes, it looks like you've tripped over #456, but it's weird since that should be fixed in the Makefile.

Can you add the line:

    echo $LANG

to the make rule you are running, and tell me the output?

What OS / shell / terminal are you running on?

Or can you try this?

docker pull quay.io/wire/alpine-builder
DOCKER_TAG=latest make run-docker-builder
make