Skip to content

Commit

Permalink
Merge branch 'alibaba:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
drawing authored Nov 7, 2024
2 parents 583ceb1 + 79eb01f commit be719ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tests/nginx-tests/tengine-tests/dynamic_resolve.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ BEGIN { use FindBin; chdir($FindBin::Bin); }

use lib 'lib';
use Test::Nginx;
eval { require Net::DNS::Nameserver; };
plan(skip_all => 'Net::DNS::Nameserver not installed') if $@;

###############################################################################
Expand Down Expand Up @@ -148,7 +147,7 @@ kill $^O eq 'MSWin32' ? 9 : 'TERM', $dns_pid;
wait;

# wait for dns cache to expire
sleep(2);
sleep(3);

unlike(http_get('/stale'), qr/127\.0\.0\.2/,
'stale http server should be www.taobao.com:8081, using initial result');
Expand Down Expand Up @@ -251,14 +250,16 @@ sub reply_handler {
}

sub dns_server_daemon {
eval { require Net::DNS::Nameserver; };

my $ns = new Net::DNS::Nameserver(
LocalAddr => '127.0.0.1',
LocalPort => 53530,
ReplyHandler => \&reply_handler,
Verbose => 0
) or die "couldn't create nameserver object\n";

$ns->main_loop;
$ns->start_server(1);
}

###############################################################################
7 changes: 4 additions & 3 deletions tests/nginx-tests/tengine-tests/vnswrr4dynamic_ups.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ BEGIN { use FindBin; chdir($FindBin::Bin); }

use lib 'lib';
use Test::Nginx;
eval { require Net::DNS::Nameserver; };
plan(skip_all => 'Net::DNS::Nameserver not installed') if $@;

###############################################################################
Expand Down Expand Up @@ -153,7 +152,7 @@ kill $^O eq 'MSWin32' ? 9 : 'TERM', $dns_pid;
wait;

# wait for dns cache to expire
sleep(2);
sleep(3);

unlike(http_get('/stale'), qr/127\.0\.0\.2/,
'stale http server should be www.taobao.com:8081, using initial result');
Expand Down Expand Up @@ -248,14 +247,16 @@ sub reply_handler {
}

sub dns_server_daemon {
eval { require Net::DNS::Nameserver; };

my $ns = new Net::DNS::Nameserver(
LocalAddr => '127.0.0.1',
LocalPort => 53530,
ReplyHandler => \&reply_handler,
Verbose => 0
) or die "couldn't create nameserver object\n";

$ns->main_loop;
$ns->start_server(1);
}

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

0 comments on commit be719ad

Please sign in to comment.