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 10f1492 commit ac5cca9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,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 @@ -148,8 +148,7 @@ like(http_get('/'), qr/127\.0\.0\.2/,
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 @@ -255,7 +254,7 @@ sub dns_server_daemon {
Verbose => 0
) or die "couldn't create nameserver object\n";

$ns->main_loop;
return $ns;
}

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

0 comments on commit ac5cca9

Please sign in to comment.