Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lhanjian committed Aug 27, 2024
1 parent 0f31d31 commit 10f1492
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/nginx-tests/tengine-tests/dynamic_resolve.t
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ foreach my $ip (@server_addrs) {
$t->run_daemon(\&http_daemon, $ip);
}

$t->run_daemon(\&dns_server_daemon);
my $dns_pid = pop @{$t->{_daemons}};
my $dns = dns_server_daemon();
$dns->start_server(60);

$t->run();

Expand All @@ -142,9 +142,7 @@ like(http_get('/'), qr/127\.0\.0\.2/,
# test variable in proxy_pass argument
like(http_get('/proxy_pass_var'), qr/127\.0\.0\.2/,
'http server should be 127.0.0.2 for /proxy_pass_var');

# kill dns daemon
kill $^O eq 'MSWin32' ? 9 : 'TERM', $dns_pid;
$dns->stop_server();
wait;

# wait for dns cache to expire
Expand Down Expand Up @@ -258,7 +256,7 @@ sub dns_server_daemon {
Verbose => 0
) or die "couldn't create nameserver object\n";

$ns->main_loop;
return $ns;
}

###############################################################################

0 comments on commit 10f1492

Please sign in to comment.