laruence / yar

Light, concurrent RPC framework for PHP & C
Other
1.43k stars 319 forks source link

Fix test suite for Windows #155

Closed cmb69 closed 4 years ago

cmb69 commented 4 years ago

While loading the yar extension via the $cmd_args argument of yar_server_start() would work for running the tests via nmake test, that would require in-tree extension builds. At least for AppVeyor, the builds are done with phpsize for performance reasons, and as such we have to set TEST_PHP_ARGS anyway, which would then cause warnings regarding multiple loading of the extension. Therefore we do not use any default command line arguments.

Furthermore, we must not connect stderr of the child processes to stderr of the parent, because that would yield spurious output, which breaks the test cases.

Because eleven test cases are hanging on Windows for some yet unknown reason, and since dynamic XFAIL is only available as of PHP 7.4.0, we skip these tests for now.

cmb69 commented 4 years ago

I should note that 2 tests are still failing (on AppVeyor as well as locally for me). I have no idea why that is, though.

laruence commented 4 years ago

thanks very much, I will try to get a windows box tomorrow, try to figure out why the tests fail... thanks again, it is really great helpful :)

laruence commented 4 years ago

about the concurrent call failures, I think there must be some difference in select() between linux and windows, will figure it out tomorrow I think

laruence commented 4 years ago

not sure why this happen, but this may be the cause of tcp tests hang

001+ Warning: fopen(C:\projects\yar\tests\yar_tcp_server.php.): failed to open stream: Permission denied in C:\projects\yar\tests\yar.inc on line 51
laruence commented 4 years ago

hahahahaha, finally, all tcp tests are passed now on windows, it’s really a nightmare for me to setup a windows box for debugging :), fortunately , no bug in source codes, only test script are fixed.

thanks again :)