]> err.no Git - varnish/commitdiff
* Work-around for VCL-loading issue (apparently a race condition somewhere).
authorknutroy <knutroy@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 17 Aug 2007 12:23:45 +0000 (12:23 +0000)
committerknutroy <knutroy@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 17 Aug 2007 12:23:45 +0000 (12:23 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1851 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-tools/regress/lib/Varnish/Test/Case.pm
varnish-tools/regress/lib/Varnish/Test/Report/report.html

index cd353dc39215d9fb3b6976478abe4f6a573cb161..fbded8238b80a440ed7bf4edf49ddac01d1ef671 100644 (file)
@@ -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),
     };
 }
 
index 59d59366733e69bd862502721213701027606230..856c418e179eee9d946268b6a01f46591abf3963 100644 (file)
@@ -34,7 +34,7 @@ tr.fail { background-color: #ffeeee; }
        </tr>
       </thead>
 <!-- FOREACH case = cases -->
-<!-- IF case.pass == case.count -->
+<!-- IF case.fail == 0 -->
       <tr class="pass">
 <!-- ELSE -->
       <tr class="fail">