]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
stats: Make sure unit tests don't fail with fast CPUs
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 2 Jan 2020 18:20:24 +0000 (20:20 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 2 Jan 2020 18:20:24 +0000 (20:20 +0200)
src/stats/test-stats-common.c

index 4e55de0cb29212263647eb208d27f2dc06152f94..f6e8f290acfa3f42f826ff6e43a602893498d213 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2019 Dovecot authors, see the included COPYING file */
 
 #include "test-stats-common.h"
+#include <unistd.h>
 
 struct event_category test_category = {
        .name = "test",
@@ -65,6 +66,7 @@ void test_event_send(struct event *event)
                 .type = LOG_TYPE_DEBUG,
         };
 
+       usleep(1); /* make sure duration>0 always */
         event_send(event, &ctx, "hello");
 }