Commit db9f7a5e authored by Tollef Fog Heen's avatar Tollef Fog Heen

Remove r00663, this test is flaky and should be unneeded.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5473 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2023864a
# for emacs, -*- perl -*- comes closest to VTC syntax
# $Id$
test "Test that errno is thread-local"
server s1 {
rxreq
txresp -bodylen 1
sema r1 sync 2
rxreq
txresp -bodylen 2
} -start
varnish v1 -vcl+backend {
C{
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
}C
# create a race between two requests to see if errno behaves
# thread-local: The first client triggers an error and then
# sleeps. the second client should win the race and clear its
# errno
sub vcl_deliver {
if (req.http.client == "one") {
C{
char buf[16];
int fd;
fd = open("/foobar/dont/tell/me/this/path/really/exists/"
"on/your/system/by/purpose", O_RDONLY);
sleep(2);
sprintf(buf, "%d", errno);
VRT_SetHdr(sp, HDR_RESP, "\006errno:", buf, vrt_magic_string_end);
if (fd)
close(fd);
}C
} elsif (req.http.client == "two") {
C{
char buf[16];
int fd;
fd = open("/dev/null", O_RDONLY);
sprintf(buf, "%d", errno);
VRT_SetHdr(sp, HDR_RESP, "\006errno:", buf, vrt_magic_string_end);
if (fd)
close(fd);
}C
} else {
error 505 "invalid client header";
}
}
} -start
client c1 {
txreq -url "/one" -hdr "Client: one"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.errno != "0"
} -start
client c2 {
sema r1 sync 2
txreq -url "/two" -hdr "Client: two"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1002"
expect resp.http.errno == "0"
} -run
client c1 -wait
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment