Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/carp Put some sleeps between forking the hosts. O...



details:   https://anonhg.NetBSD.org/src/rev/24b05df59b56
branches:  trunk
changeset: 757041:24b05df59b56
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Aug 11 13:10:03 2010 +0000

description:
Put some sleeps between forking the hosts.  Otherwise a race may
be triggered which appears to cause one host to go berzerk with
sending carp advertisements and ignore ping requests.

I'll get to the bottom of this eventually, but this is a stopgap
to prevent the test from failing, hopefully -- the race doesn't
appear to trigger for me even with 0.1s on a loaded machine, so
0.5s should be better than fine.

(hi jmmv ;)

diffstat:

 tests/net/carp/t_basic.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r fbdc564a9064 -r 24b05df59b56 tests/net/carp/t_basic.c
--- a/tests/net/carp/t_basic.c  Wed Aug 11 13:02:59 2010 +0000
+++ b/tests/net/carp/t_basic.c  Wed Aug 11 13:10:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_basic.c,v 1.1 2010/08/10 21:55:28 pooka Exp $        */
+/*     $NetBSD: t_basic.c,v 1.2 2010/08/11 13:10:03 pooka Exp $        */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: t_basic.c,v 1.1 2010/08/10 21:55:28 pooka Exp $");
+__RCSID("$NetBSD: t_basic.c,v 1.2 2010/08/11 13:10:03 pooka Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -155,6 +155,8 @@
                break;
        }
 
+       usleep(500000);
+
        /* fork backup */
        switch (cpid = fork()) {
        case -1:
@@ -168,6 +170,8 @@
                break;
        }
 
+       usleep(500000);
+
        rump_init();
        netcfg_rump_makeshmif(THEBUS, ifname);
        netcfg_rump_if(ifname, "10.1.1.240", "255.255.255.0");



Home | Main Index | Thread Index | Old Index