kjdev / php-ext-zstd

Zstd Extension for PHP
MIT License
201 stars 27 forks source link

Tests on armhf fails sometimes #26

Closed andypost closed 4 years ago

andypost commented 4 years ago

Used to build package for Alpinelinux and faced that some tests failed

Research shows that they fails for zstd_compress() when no level specified (see https://dev.alpinelinux.org/archive/php7-pecl-zstd-tests.tar archive tests directory)

Maybe it because maxLevel defined as 16 bits https://github.com/kjdev/php-ext-zstd/blob/master/zstd.c#L78 (but zstd using int)

andypost commented 4 years ago

using bundled lib same tests are failed so looks the issue with zstd itself on this platform

kjdev commented 4 years ago
% cat /etc/redhat-release
Fedora release 31 (Thirty One)
% docker run -it --rm -v $PWD:/app -w /app alpine:3.10 ash
$ apk --no-cache add php7-dev automake autoconf gcc make musl-dev php7-openssl
$ phpize
$ ./configure
$ make
$ : "Copy and Activate of openssl extension"
$ cp /usr/lib/php7/modules/openssl.so modules/
$ sed -i 's/\(\$(PHP_TEST_SHARED_EXTENSIONS)\)/-d extension=openssl \1/' Makefile
$ : "Extcute Test"
$ make test
..
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   13
---------------------------------------------------------------------

Number of tests :   24                21
Tests skipped   :    3 ( 12.5%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   21 ( 87.5%) (100.0%)
---------------------------------------------------------------------
Time taken      :    1 seconds
=====================================================================
andypost commented 4 years ago

Yes, the problem is that I can't reproduce it locally with qemu (chroot) - only running in builders fails tests. Meantime I found that zstd itself fails to run tests in armhf so will notify when get more details https://gitlab.alpinelinux.org/alpine/aports/issues/11077

andypost commented 4 years ago

The [backtrace]|(https://gitlab.alpinelinux.org/alpine/aports/issues/11077#note_58801) pointed that it was issue with zstd lib build related, now everything works fine

Thank you!