orthecreedence / cl-async

Asynchronous IO library for Common Lisp.
MIT License
272 stars 40 forks source link

Tests and example code fails on macOS (Catalina 10.5) #172

Closed mdbergmann closed 4 years ago

mdbergmann commented 4 years ago

Hi.

I was trying the tcp-client example code and was wondering why it failed.

 TCP-SIMPLE-CLIENT-SERVER [Test both tcp-connect and tcp-server]: 
      Unexpected Error: #<TYPE-ERROR expected-type: NUMBER datum: NIL>
The value
  NIL
is not of type
  NUMBER
when binding SB-KERNEL::X..

Then I've seen on the web page how to run the test suite and I did that. It shows the same issue as the tcp-client example:

 Failure Details:
 --------------------------------
 PROCESS-ENV []: 
      Unexpected Error: #<SIMPLE-ERROR "test timeout" {1005A50473}>
test timeout..
 --------------------------------
 --------------------------------
 SPAWN-REDIRECT-STREAM []: 
      Unexpected Error: #<TYPE-ERROR expected-type: NUMBER datum: NIL>
The value
  NIL
is not of type
  NUMBER
when binding SB-KERNEL::X..
 --------------------------------
 --------------------------------
 SPAWN-REDIRECT-ERROR-OUTPUT []: 
      Unexpected Error: #<TYPE-ERROR expected-type: NUMBER datum: NIL>
The value
  NIL
is not of type
  NUMBER
when binding SB-KERNEL::X..
 --------------------------------
 --------------------------------
 SPAWN-REDIRECT-OUTPUT []: 
      Unexpected Error: #<TYPE-ERROR expected-type: NUMBER datum: NIL>
The value
  NIL
is not of type
  NUMBER
when binding SB-KERNEL::X..

etc...
mdbergmann commented 4 years ago

Version of libuv:

brew info libuv  
libuv: stable 1.34.2 (bottled), HEAD
rtvd commented 4 years ago

They fail on Linux too. I have tried debugging one of the tests - "test-tcp-server-close".

Somewhere down the chain the following seems to happen:

  1. (write-socket-data ...) is called, which does (apply #'streamish-write socket data args)

  2. The signature of streamish-write method has start and end keys, so they are NIL here. By the way, what are they supposed to do? But in the end, write-to-uvstream is called and those NILs are passed to it as its explicit arguments. This happens on line 188 of streamish.lisp.

  3. Unsurprisingly, write-to-uvstream fails as even though it declares default values for start and end, they are not used as the NILs were passed explicitly.

rtvd commented 4 years ago

Raised a pull request #173.

Unfortunately, one test is still broken for me and I am not quite sure why.

mdbergmann commented 4 years ago

Looks much better.

I have 3 failing tests still, the IPv6 test may not count though:

 Did 131 checks.
    Pass: 128 (97%)
    Skip: 0 ( 0%)
    Fail: 3 ( 2%)

 Failure Details:
 --------------------------------
 PROCESS-ENV []: 
      Unexpected Error: #<SIMPLE-ERROR "test timeout" {1002BE7A63}>
test timeout..
 --------------------------------
 --------------------------------
 PIPE-CONNECT-FAIL [Make sure a pipe connection fails]: 
      Unexpected Error: #<CL-ASYNC:STREAMISH-ERROR {1002AA2063}>
#<STREAMISH-ERROR #<PIPE {1002AA1703}>: -2: ENOENT {1002AA2063}>..
 --------------------------------
 --------------------------------
 DNS-LOOKUP-IPV6 [Test IPV6 family (can fail in *nix)]: 

IPV6

 evaluated to 

"::ffff:216.58.212.142"

 which does not satisfy 
mdbergmann commented 4 years ago

Also added a PR for the the 'process-env' test on macOS. Seems to have failed only on macOS, but nonetheless.

mdbergmann commented 4 years ago

Does anyone see those IPv6 DNs issues? Or is it only on Mac?

Plisp commented 4 years ago

currently all tests are passing on my linux system

mdbergmann commented 4 years ago

'PIPE-CONNECT-FAIL' also fails on my openSUSE Tumbleweed with sbcl 2.0.4.

 Did 133 checks.
    Pass: 132 (99%)
    Skip: 0 ( 0%)
    Fail: 1 ( 0%)

 Failure Details:
 --------------------------------
 PIPE-CONNECT-FAIL [Make sure a pipe connection fails]: 
      Unexpected Error: #<CL-ASYNC:STREAMISH-ERROR {10028D53F3}>
#<STREAMISH-ERROR #<PIPE {100288E573}>: -2: ENOENT {10028D53F3}>..
 --------------------------------

I will have a look at the DNS IPV6 error on Mac.

mdbergmann commented 4 years ago

I think this ticket can be closed. Tests are now generally working on macOS except the tests that are known to not work. But there are dedicated tickets for that. DNS: #115 Pipe-connext-fail: #174