From patchwork Tue Jan 26 15:46:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 60466 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2039002lbb; Tue, 26 Jan 2016 07:47:18 -0800 (PST) X-Received: by 10.107.35.209 with SMTP id j200mr25473759ioj.127.1453823238404; Tue, 26 Jan 2016 07:47:18 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id xh1si5699970igb.81.2016.01.26.07.47.17; Tue, 26 Jan 2016 07:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 04F1E61659; Tue, 26 Jan 2016 15:47:17 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=dixuP+FQ; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id F39FA615FD; Tue, 26 Jan 2016 15:47:07 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5C0A361606; Tue, 26 Jan 2016 15:47:05 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id 57D77605DB for ; Tue, 26 Jan 2016 15:47:04 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id cl12so94094891lbc.1 for ; Tue, 26 Jan 2016 07:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=CD6+yQY9GbzxsZXBake2qlelGkVzt98gu/ywZQTpZHI=; b=dixuP+FQ2EYiH3MzfmoJOZlVY7EieDs2NpOFvl5WcM+OtJc2eJAn7tf8En2bA/dkm/ T56EkSwb7ahCsQkBeHEH9vq3gNq0G35d/MwyWykcrE6c/u9e0Qlc/lhgDQRAfEydZEow oABJ3A0Ut1kGYo2uQKWaxnImt+8E8rDoGeseM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CD6+yQY9GbzxsZXBake2qlelGkVzt98gu/ywZQTpZHI=; b=i6ucWcsTMLrjqK9ffVtfQE/U8gZNdyNZScXhRlrEdPjHLRwPkAOPbo/gaIoUO67wf1 zQ12FAPG5iIDYOb7L+MPgmw91Qs5zfreiLLOomobK7j1/ZI0z7if5iZl9/V4IAEYETDX /rgOZvBE9ZjefDM8Ci6b4FDUwIQHzuNSUZpFv4FcOCy5NG9GSQE6Yy35Fa1e4fdDTzQL ltwTmNfsiFFWr7jGMZ72DW4ukbl4to8X3R5JDh+TL4F4Vqv+vXLBxH/AWuyN0kG0MLx9 VQTCi3r7VNoTNCl1NQpFEpuf2Sa6fNKfiQ6yhrPJiTYBdGxDAM/PsKP0y22z3Oy/xelE dnpw== X-Gm-Message-State: AG10YOQBaIKxfuPAElI8icNjv73dXRLbiH3BfnoJBSj1xaVDL8YgTCRZZZecxwkg3fcrnmiP+QY= X-Received: by 10.112.132.66 with SMTP id os2mr9135385lbb.111.1453823223206; Tue, 26 Jan 2016 07:47:03 -0800 (PST) Received: from localhost.localdomain (ppp91-76-173-134.pppoe.mtu-net.ru. [91.76.173.134]) by smtp.gmail.com with ESMTPSA id j130sm261348lfe.23.2016.01.26.07.47.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jan 2016 07:47:02 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 26 Jan 2016 18:46:55 +0300 Message-Id: <1453823216-23167-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch Subject: [lng-odp] [API-NEXT PATCHv2] validation: timer: fix delay after loop X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Maxim Uvarov Reviewed-by: Ivan Khoronzhuk --- test/validation/timer/timer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 5d89700..0bd67fb 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -405,12 +405,14 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) thr, nstale); /* Delay some more to ensure timeouts for expired timers can be - * received */ + * received. Can not use busy loop here to make background timer + * thread finish their work. */ struct timespec ts; ts.tv_sec = 0; - ts.tv_nsec = 1000000; /* 1ms */ + ts.tv_nsec = (3 * RANGE_MS / 10 + 50) * ODP_TIME_MSEC_IN_NS; if (nanosleep(&ts, NULL) < 0) CU_FAIL_FATAL("nanosleep failed"); + while (nstale != 0) { odp_event_t ev = odp_queue_deq(queue); if (ev != ODP_EVENT_INVALID) {