Skip to content

Test failing depending o Kernel and OS configurations #146

@nawarian

Description

@nawarian

Hi, all!

I was running the tests at my local environment because I wanted to improve somethings and I like to start by making sure everything is running properly ^^
Thing is that the test \React\Tests\EventLoop\AbstractLoopTest::testRemoveReadAndWriteStreamFromLoopOnceResourceClosesOnEndOfFileEndsLoop is failing for all implementations with the following message:

fwrite(): send of 8192 bytes failed with errno=35 Resource temporarily unavailable

This happens at line 231, which runs this: fwrite($other, str_repeat('.', 60000));

I did some basic research and looks like Mac OS can have very low values for buffer sizes, but changing those values via sysctl didn't take much effect.

According to this errors list errno=35 Resource temporarily unavailable means kPOSIXErrorEAGAIN and according to here the EAGAIN error says that possibly it would work in further attempts (not desirable for unit testing) and can be caused because a) a resource could be doing a blocking operation and was set as non-blocking before, which is plausible because for both streams we call stream_set_blocking with false or b) due to a resource shortage, which for me would make sense with the sysctl stuff. Documentation says that maybe delaying certain operations would help.

I suppose this kind of error would be super hard to reproduce, but I have something else that may help:

nawarian@phoenix event-loop (master) $ sysctl -a | egrep "space|maxsockbuf"
kern.ipc.maxsockbuf: 8388608
net.local.stream.recvspace: 8192
net.local.stream.sendspace: 8192
net.local.dgram.recvspace: 4096
net.inet.tcp.sendspace: 131072
net.inet.tcp.recvspace: 131072
net.inet.udp.recvspace: 196724
net.inet.raw.recvspace: 8192
net.stats.sendspace: 2048
net.stats.recvspace: 8192

It might be possible to reproduce such error if you run something like sysctl -w variable.name=new-value using those keys and values. But again: I'm not sure.

Could also be useful:

nawarian@phoenix event-loop (master) $ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G1114

Oh yes, almost forgot: lowering the string length at fwrite($other, str_repeat('.', 60000)); solve the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions