tengine
tengine copied to clipboard
image_filter.t case failed: tengine feature image_filter_crop_offset
Ⅰ. Issue Description
With macro #(T_NGX_HTTP_IMAGE_FILTER) in image_filter module, the compiled nginx binary failed to run image_filter.t
Ⅳ. How to reproduce it (as minimally and precisely as possible)
When we disable source included in this macro, this case will pass.
TEST_NGINX_LEAVE=yes \
TEST_NGINX_UNSAFE=yes \
TEST_NGINX_BINARY=$nginx_binary \
prove -v -I $nginx_tests_lib_path $proxy_connect_test_cases
ok 36 - rotate after resize
not ok 37 - resize rotate nested
# Failed test 'resize rotate nested'
# at tests/nginx-tests/nginx-tests/image_filter.t line 254.
# got: '12 10'
# expected: '10 12'
ENV prepared for this case
sudo cpanm --notest GD
sudo apt install -y libgd-dev
this pr https://github.com/alibaba/tengine/pull/380 broke default value of conf->angle
, then made the case failed.
-
log format: log_format time "$request_uri:$status:$upstream_response_time"; like(http_get('/time.log'), qr!/t3:.*, [1-9].!, 'upstream response time');
-
Normal output of t3 time log is something like this:
/bad:404:-
/t1:204:0.001
/t2:204:0.004
/big:200:-
/slow:200:- < ----- from case: http_get('/slow');
/slow:444:- <----- from case http_get('/t3');
/slow:444:- |
/slow:444:- | same request (multiple upstream tries)
/slow:200:- '---------------------
/empty:204:-
/t3:204:0.000, 0.000, 0.001, 0.000, 2.406 : 0.001
- Wrong output of incorrect case like this:
/bad:404:-
/t1:204:0.000
/t2:204:0.000
/big:200:-
/slow:200:- < ----- from case: http_get('/slow');
/slow:200:- <----- from case http_get('/t3'); // not upstream retry
/empty:204:-
/t3:204:2.408 : 0.000
-> It seems that tengine randomize upstream peers. ( ఠൠఠ )ノ
I think I find out the point, this issue is caused by tengine feature random initialization of upstream peers.
This logic is enabled by default, see this C macro in source:
auto/modules:have=T_NGX_HTTP_UPSTREAM_RANDOM . auto/have