Skip to content

Commit

Permalink
[TMP] review(*) skip_no_hup fix
Browse files Browse the repository at this point in the history
  • Loading branch information
casimiro committed Jun 11, 2024
1 parent 0313c03 commit cc10f5d
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
64 changes: 64 additions & 0 deletions t/07-metrics/003-metrics_sighup_fail.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# vim:set ft= ts=4 sts=4 sw=4 et fdm=marker:
use strict;
use lib '.';
use t::TestWasmX;

skip_no_hup();


our $metrics = "c2,g2,h2";

no_shuffle();
plan_tests(6);
run_tests();

__DATA__

=== TEST 1: SIGHUP metrics - define metrics
--- valgrind
--- load_nginx_modules: ngx_http_echo_module
--- wasm_modules: hostcalls
--- config eval
qq{
location /t {
proxy_wasm hostcalls 'on_configure=define_and_increment_counters \
metrics=$::metrics';
echo ok;
}
}
--- error_log eval
qr/c2_Configure: $::workers.*/
--- no_error_log
[error]
[crit]
[emerg]
[alert]



=== TEST 2: SIGHUP metrics - decreased slab_size - not enough memory
--- reload_fails
--- valgrind
--- load_nginx_modules: ngx_http_echo_module
--- main_config eval
qq{
wasm {
module hostcalls $ENV{TEST_NGINX_CRATES_DIR}/hostcalls.wasm;

metrics {
slab_size 12k;
}
}
}
--- config eval
qq{
location /t {
echo ok;
}
}
--- error_log: failed redefining metric
--- no_error_log
[stub]
[stub]
[stub]
[stub]
2 changes: 1 addition & 1 deletion t/TestWasmX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ sub skip_hup {

sub skip_no_hup {
if ($ENV{TEST_NGINX_USE_HUP} == 0) {
plan(skip_all => "skip in default mode");
plan(skip_all => "skip without HUP mode");
}
}

Expand Down

0 comments on commit cc10f5d

Please sign in to comment.