diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-03-30 20:12:33 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-03-30 20:12:33 +0000 |
commit | f6566eaf280d882e0f25a4be4b69d2b4d91a83bb (patch) | |
tree | efcbb2b0bd62ea6d89ab5857b64fce748841dee8 /regress/sys/kern | |
parent | 5035665281fe1e7a715b5bde26b2f7a7f3194c41 (diff) |
Make forking socket splicing tests more reliable on slow machines.
Their intention is to test kernel stability. Instead of failing,
add a timeout and ignore errors.
Diffstat (limited to 'regress/sys/kern')
-rw-r--r-- | regress/sys/kern/sosplice/tcp/args-relay-read-forked.pl | 7 | ||||
-rw-r--r-- | regress/sys/kern/sosplice/tcp/args-relay-write-forked.pl | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/regress/sys/kern/sosplice/tcp/args-relay-read-forked.pl b/regress/sys/kern/sosplice/tcp/args-relay-read-forked.pl index 374e07c26ee..32680417e51 100644 --- a/regress/sys/kern/sosplice/tcp/args-relay-read-forked.pl +++ b/regress/sys/kern/sosplice/tcp/args-relay-read-forked.pl @@ -7,14 +7,20 @@ use Time::HiRes; our %args = ( client => { + func => sub { errignore(@_); write_stream(@_); }, len => 2**20, + nocheck => 1, }, relay => { + # terminate in time on slow machines + alarm => 25, + down => "Alarm|Shutdown", nonblocking => 1, func => sub { defined(my $pid = fork()) or die "relay func: fork failed: $!"; if ($pid == 0) { + alarm(25); my $n; do { $n = sysread(STDIN, my $buf, 10); @@ -25,6 +31,7 @@ our %args = ( sleep .1; relay(@_); kill 9, $pid; + waitpid($pid, 0); }, # As sysread() may extract data from the socket before splicing starts, # the spliced content length is not reliable. Disable the checks. diff --git a/regress/sys/kern/sosplice/tcp/args-relay-write-forked.pl b/regress/sys/kern/sosplice/tcp/args-relay-write-forked.pl index 5496bd3291e..0e18573fa04 100644 --- a/regress/sys/kern/sosplice/tcp/args-relay-write-forked.pl +++ b/regress/sys/kern/sosplice/tcp/args-relay-write-forked.pl @@ -7,13 +7,19 @@ use Time::HiRes; our %args = ( client => { + func => sub { errignore(@_); write_stream(@_); }, len => 2**20, + nocheck => 1, }, relay => { + # terminate in time on slow machines + alarm => 25, + down => "Alarm|Shutdown", func => sub { defined(my $pid = fork()) or die "relay func: fork failed: $!"; if ($pid == 0) { + alarm(25); my $n; do { $n = syswrite(STDOUT, "\n foo bar\n"); @@ -25,7 +31,9 @@ our %args = ( sleep .1; relay(@_); kill 9, $pid; + waitpid($pid, 0); }, + nocheck => 1, }, server => { func => sub { sleep 2; read_stream(@_); }, |