From: Vsevolod Stakhov Date: Wed, 7 Oct 2015 17:08:55 +0000 (+0100) Subject: Fix http test. X-Git-Tag: 1.0.5~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f221e03ee2f293d2b26c7423e343b753a8d8e72;p=rspamd.git Fix http test. --- diff --git a/test/rspamd_http_test.c b/test/rspamd_http_test.c index f4712b224..625eef7a7 100644 --- a/test/rspamd_http_test.c +++ b/test/rspamd_http_test.c @@ -126,7 +126,7 @@ rspamd_client_finish (struct rspamd_http_connection *conn, struct client_cbdata *cb = conn->ud; struct timespec ts; - *(cb->lat) = rspamd_get_ticks () * 1000.; + *(cb->lat) = rspamd_get_ticks () * 1000. - cb->ts; close (conn->fd); rspamd_http_connection_unref (conn); g_free (cb); @@ -161,7 +161,7 @@ rspamd_http_client_func (const gchar *path, rspamd_inet_addr_t *addr, } cb = g_malloc (sizeof (*cb)); - cb->ts = rspamd_get_ticks (); + cb->ts = rspamd_get_ticks () * 1000.; cb->lat = latency; rspamd_http_connection_write_message (conn, msg, NULL, NULL, cb, fd, NULL, ev_base); @@ -241,7 +241,8 @@ rspamd_http_test_func (void) exit (EXIT_SUCCESS); } - rspamd_mempool_lock_mutex (mtx); + //rspamd_mempool_lock_mutex (mtx); + usleep (100000); /* Do client stuff */ for (i = 0; i < ntests; i ++) { @@ -303,7 +304,8 @@ rspamd_http_test_func (void) exit (EXIT_SUCCESS); } - rspamd_mempool_lock_mutex (mtx); + //rspamd_mempool_lock_mutex (mtx); + usleep (100000); total_diff = 0.0; for (i = 0; i < ntests; i ++) {