From: Adam Dickmeiss Date: Tue, 14 Jun 2005 20:02:30 +0000 (+0000) Subject: The start_up routine sets an upper-limit on CPU seconds so that X-Git-Tag: before.bug.529~393 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=e77e69cb9cf741189af0cd5ffb165c3d67cd7fa7;p=idzebra-moved-to-github.git The start_up routine sets an upper-limit on CPU seconds so that tests with bad indefinite loops stop at some point. --- diff --git a/test/api/testlib.c b/test/api/testlib.c index aee77dc..d80ab13 100644 --- a/test/api/testlib.c +++ b/test/api/testlib.c @@ -1,4 +1,4 @@ -/* $Id: testlib.c,v 1.21 2005-05-31 07:22:20 adam Exp $ +/* $Id: testlib.c,v 1.22 2005-06-14 20:02:30 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -22,6 +22,12 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA /** testlib - utilities for the api tests */ +#include +#include +#if HAVE_UNISTD_H +#include +#endif + #include #include #include @@ -59,6 +65,10 @@ void start_log(int argc, char **argv) */ ZebraService start_up(char *cfgname, int argc, char **argv) { + struct rlimit rlim; + rlim.rlim_cur = 20; + rlim.rlim_max = 20; + setrlimit(RLIMIT_CPU, &rlim); nmem_init(); start_log(argc, argv); return start_service(cfgname);