From: knutroy Date: Fri, 17 Aug 2007 12:23:45 +0000 (+0000) Subject: * Work-around for VCL-loading issue (apparently a race condition somewhere). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=017ab00831cb127db445be65475770891ca32d28;p=varnish * Work-around for VCL-loading issue (apparently a race condition somewhere). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1851 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-tools/regress/lib/Varnish/Test/Case.pm b/varnish-tools/regress/lib/Varnish/Test/Case.pm index cd353dc3..fbded823 100644 --- a/varnish-tools/regress/lib/Varnish/Test/Case.pm +++ b/varnish-tools/regress/lib/Varnish/Test/Case.pm @@ -83,7 +83,11 @@ sub init($) { my $vcl = $varnish->backend_block('main') . ${ref($self)."::VCL"}; $varnish->send_vcl(ref($self), $vcl); - $self->run_loop('ev_varnish_command_ok'); + my ($ev, $resp) = $self->run_loop('ev_varnish_command_ok', 'ev_varnish_command_unknown'); + if ($ev eq 'ev_varnish_command_unknown') { + $self->{'failed'} += 1; + die "Unable to load VCL.\n" + } $varnish->use_vcl(ref($self)); $self->run_loop('ev_varnish_command_ok'); } @@ -182,7 +186,9 @@ sub results($) { 'count' => $self->{'count'}, 'pass' => $self->{'successful'}, 'fail' => $self->{'failed'}, - 'time' => tv_interval($self->{'start'}, $self->{'stop'}), + 'time' => ((defined($self->{'start'}) and defined($self->{'stop'})) + ? tv_interval($self->{'start'}, $self->{'stop'}) + : 0), }; } diff --git a/varnish-tools/regress/lib/Varnish/Test/Report/report.html b/varnish-tools/regress/lib/Varnish/Test/Report/report.html index 59d59366..856c418e 100644 --- a/varnish-tools/regress/lib/Varnish/Test/Report/report.html +++ b/varnish-tools/regress/lib/Varnish/Test/Report/report.html @@ -34,7 +34,7 @@ tr.fail { background-color: #ffeeee; } - +