Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(util) apply a fix to Test::Nginx as a patch #553

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions t/TestWasmX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ add_block_preprocessor(sub {
}

if (defined $skip_n) {
$block->set_value("skip_eval", sprintf('%d: (%s)', $skip_n,
join " || ", @block_skip));
my $eval_str = sprintf('%d: (%s)', $skip_n,
join " || ", @block_skip);
#warn $eval_str;
$block->set_value("skip_eval", $eval_str);
}

# --- timeout_expected: 1
Expand Down
44 changes: 34 additions & 10 deletions util/setup_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,40 @@ EOF
worker_processes $Workers;
-daemon $DaemonEnabled;
master_process $MasterProcessEnabled;
EOF
patch --forward --ignore-whitespace lib/perl5/Test/Nginx/Util.pm <<'EOF'
@@ -484,6 +484,7 @@ sub master_process_enabled (@) {
}

our @EXPORT = qw(
+ gen_rand_port
use_http2
use_http3
env_to_nginx
EOF
patch --forward --ignore-whitespace lib/perl5/Test/Nginx/Socket.pm <<'EOF'
@@ -1468,6 +1468,10 @@ sub check_shutdown_error_log ($$) {

my %found;
$lines ||= error_log_data();
+ if (!defined $lines) {
+ return;
+ }
+
# warn "error log data: ", join "\n", @$lines;
for my $line (@$lines) {
for my $pat (@$pats) {
@@ -1505,6 +1509,10 @@ sub check_shutdown_error_log ($$) {
}

$lines ||= error_log_data();
+ if (!defined $lines) {
+ return;
+ }
+
#warn "error log data: ", join "\n", @$lines;
for my $line (@$lines) {
for my $pat (@$pats) {
EOF
patch --forward --ignore-whitespace lib/perl5/Test/Nginx/Socket.pm <<'EOF'
@@ -813,6 +813,10 @@ again:
Expand All @@ -126,16 +160,6 @@ EOF
check_error_log($block, $res, $dry_run, $repeated_req_idx, $need_array);

if (!defined $block->ignore_response) {
EOF
patch --forward --ignore-whitespace lib/perl5/Test/Nginx/Util.pm <<'EOF'
@@ -484,6 +484,7 @@ sub master_process_enabled (@) {
}

our @EXPORT = qw(
+ gen_rand_port
use_http2
use_http3
env_to_nginx
EOF
set -e
popd
Expand Down