From: YAMAMOTO Takashi Date: Fri, 20 Dec 2013 10:31:05 +0000 (+0900) Subject: timeval: Workaround for threaded test failures X-Git-Tag: v2.1.0~75 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=ac3c0be096b7aa8d3681dd1e298c37cc932e0da5;hp=bf06c4fe3977f98cad16cecc891d50f826fcd5e3;p=cascardo%2Fovs.git timeval: Workaround for threaded test failures BFD tests have the code like the following. # wait for a while to stablize everything. for i in `seq 0 9`; do ovs-appctl time/warp 500; done They no longer work as intended because BFD code is run in a separate monitor thread these days. The loop merely "warp" the time by 5000. The monitor thread should have been woken at least once, but it's far from "wait for a while to stablize everything." This commit mitigates the problem by sleeping a little in the appctl handler. This is not ideal but makes BFD tests success on my environment. Signed-off-by: YAMAMOTO Takashi Signed-off-by: Ben Pfaff --- diff --git a/lib/timeval.c b/lib/timeval.c index 2ce45fc6d..5d0170867 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -535,6 +535,7 @@ timeval_warp_cb(struct unixctl_conn *conn, timespec_add(&monotonic_clock.warp, &monotonic_clock.warp, &ts); ovs_mutex_unlock(&monotonic_clock.mutex); seq_change(timewarp_seq); + poll(NULL, 0, 10); /* give threads (eg. monitor) some chances to run */ unixctl_command_reply(conn, "warped"); }