lua-resty-core icon indicating copy to clipboard operation
lua-resty-core copied to clipboard

Random test failures in t/stream/os-getenv-hup.t

Open agentzh opened this issue 3 years ago • 1 comments

I'm seeing the following random test failures on Fedora x86_64:

t/stream/os-getenv-hup.t ........... 1/13
#   Failed test 'TEST 2: HUP reload changes env value (1/3) - response_body - response is expected (repeated req 0, req 0)'
#   at /home/agentzh/git/lua-resty-core.orig/../test-nginx/lib/Test/Nginx/Socket.pm line 1594.
#          got: "old\x{0a}"
#       length: 4
#     expected: "new\x{0a}"
#       length: 4
#     strings begin to differ at char 1 (line 1 column 1)
t/stream/os-getenv-hup.t ........... 10/13
#   Failed test 'TEST 5: HUP reload changes visible environment variable (1/2) - response_body - response is expected (repeated req 0, req 0)'
#   at /home/agentzh/git/lua-resty-core.orig/../test-nginx/lib/Test/Nginx/Socket.pm line 1594.
#          got: "nil\x{0a}"
#       length: 4
#     expected: "old\x{0a}"
#       length: 4
#     strings begin to differ at char 1 (line 1 column 1)

#   Failed test 'TEST 6: HUP reload changes visible environment variable (2/2) - response_body - response is expected (repeated req 0, req 0)'
#   at /home/agentzh/git/lua-resty-core.orig/../test-nginx/lib/Test/Nginx/Socket.pm line 1594.
#          got: "old\x{0a}"
#       length: 4
#     expected: "new\x{0a}"
#       length: 4
#     strings begin to differ at char 1 (line 1 column 1)
# Looks like you failed 3 tests of 13.
t/stream/os-getenv-hup.t ........... Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/13 subtests

agentzh avatar Oct 08 '20 07:10 agentzh

The random failures can be reproduced by setting the env TEST_NGINX_SLEEP=0.001. The tests should be made more robust.

agentzh avatar Oct 08 '20 07:10 agentzh