From f0bdaa07785f216d660f3372fc8260c57e45222d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 23 Feb 2018 15:49:49 +0100 Subject: [PATCH] Increase test timeout. --- tests/issue-58-task-already-scheduled.d | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/issue-58-task-already-scheduled.d b/tests/issue-58-task-already-scheduled.d index 2b99a38..80cc9f6 100644 --- a/tests/issue-58-task-already-scheduled.d +++ b/tests/issue-58-task-already-scheduled.d @@ -12,6 +12,8 @@ import core.atomic; shared ManualEvent ev; shared size_t counter; +enum ntasks = 500; + shared static this() { ev = createSharedManualEvent(); @@ -22,17 +24,16 @@ void main() setTaskStackSize(64*1024); runTask({ - foreach (x; 0 .. 500) { + foreach (x; 0 .. ntasks) runWorkerTask(&worker); - } }); setTimer(dur!"msecs"(10), { ev.emit(); }); - setTimer(dur!"seconds"(20), { assert(false, "Timers didn't fire within the time limit"); }); + setTimer(dur!"seconds"(60), { assert(false, "Timers didn't fire within the time limit"); }); runApplication(); - assert(atomicLoad(counter) == 500, "Event loop exited prematurely."); + assert(atomicLoad(counter) == ntasks, "Event loop exited prematurely."); } void worker() @@ -41,6 +42,6 @@ void worker() ev.emit(); setTimer(dur!"seconds"(1), { auto c = atomicOp!"+="(counter, 1); - if (c == 500) exitEventLoop(true); + if (c == ntasks) exitEventLoop(true); }); }