Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

00-startup test hangs for 30 secs in binary protocol version with gcov usage #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The binary protocol version has added test code coverage (gcov, tcov) to
the memcached-debug binary. When running "make test" the first test,
00-startup, will hang for approx. 30 secs. This only happens with gcov (not
tcov). The 00-startup test starts two memcached instances and when the test
is finished both instances will receive SIGINT at the same time. The gcov
processing taking place simultaneously in both memcached instances before
exit makes the processes hang. One possible fix is to send SIGINT to the
first memcached instance before starting up the next instance.

In 00-startup.t 
add the line "kill 2, $server->{pid};" :

#!/usr/bin/perl

use strict;
use Test::More tests => 3;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;

my $server = new_memcached();

ok($server, "started the server");
kill 2, $server->{pid};

eval {
    my $server = new_memcached("-l fooble");
};
ok($@, "Died with illegal -l args");

eval {
    my $server = new_memcached("-l 127.0.0.1");
};
is($@,'', "-l 127.0.0.1 works");

Original issue reported on code.google.com by victor.k...@sun.com on 19 Feb 2009 at 12:52

GoogleCodeExporter commented 9 years ago
Where do you see this?  I don't think I've seen this happen.

Original comment by dsalli...@gmail.com on 26 Feb 2009 at 5:38

GoogleCodeExporter commented 9 years ago
uname -a :
Linux loki55 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:56:11 EDT 2008 x86_64 
x86_64
x86_64 GNU/Linux

/usr/bin/gcov -v
gcov (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

Original comment by victor.k...@sun.com on 26 Feb 2009 at 10:27

GoogleCodeExporter commented 9 years ago
I wasn't able to reproduce the exact problem, but I did at least ensure that the
tests are cleaned up as soon as they're finished (which I think it should do 
anyway).

Please try a34f78e0e753bd51bf1c48bf9cdda6688ae6aa92 and confirm that it makes 
things
better for you.

Original comment by dsalli...@gmail.com on 1 Mar 2009 at 6:48

GoogleCodeExporter commented 9 years ago
Works now. Thank you!

Now 00-startup takes 4 secs:
-------------------------------
[victor@loki]~/memcachedGIT/mar02-dustin-linux-rewritten-bin/memcached: prove
./t/00-startup.t
./t/00-startup....ok 1/4getaddrinfo(): Name or service not known
failed to listen on TCP port 40441
tcp listen: No such file or directory
./t/00-startup....ok
All tests successful.
Files=1, Tests=4,  4 wallclock secs ( 0.04 cusr +  0.01 csys =  0.05 CPU)

Before 00-startup took 32 secs:
-------------------------------
[victor@loki]~/memcachedGIT/feb23-dustin-linux-rewritten-bin/memcached: prove
./t/00-startup.t
./t/00-startup....ok 1/3getaddrinfo(): Name or service not known
failed to listen on TCP port 34303
tcp listen: No such file or directory
./t/00-startup....ok
All tests successful.
Files=1, Tests=3, 32 wallclock secs ( 0.04 cusr +  0.01 csys =  0.05 CPU)

Original comment by victor.k...@sun.com on 2 Mar 2009 at 10:33