aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_workqueue.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-07-03 14:37:16 -0400
committerNick Mathewson <nickm@torproject.org>2015-07-03 14:38:14 -0400
commit19440b9e58b3d824057abd3a0faf08fd7cb891ff (patch)
treeeb212de230aab4fd620ab7704c89e48503dddf5b /src/test/test_workqueue.c
parent65a1e27bc42a1cdbb4a920597b3424f7fe065d9c (diff)
downloadtor-19440b9e58b3d824057abd3a0faf08fd7cb891ff.tar.gz
tor-19440b9e58b3d824057abd3a0faf08fd7cb891ff.zip
Make test_workqueue.c faster, and on-by-default.
Instead of having a 30-second timer be the only way to end the test, add a 2 second shutdown timer when the test is actually about to be over.
Diffstat (limited to 'src/test/test_workqueue.c')
-rw-r--r--src/test/test_workqueue.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/test_workqueue.c b/src/test/test_workqueue.c
index 77053b0760..edefb292c0 100644
--- a/src/test/test_workqueue.c
+++ b/src/test/test_workqueue.c
@@ -214,6 +214,7 @@ add_n_work_items(threadpool_t *tp, int n)
while (n_queued++ < n) {
ent = add_work(tp);
if (! ent) {
+ puts("Z");
tor_event_base_loopexit(tor_libevent_get_base(), NULL);
return -1;
}
@@ -287,6 +288,10 @@ replysock_readable_cb(tor_socket_t sock, short what, void *arg)
shutting_down = 1;
threadpool_queue_update(tp, NULL,
workqueue_do_shutdown, NULL, NULL);
+ {
+ struct timeval limit = { 2, 0 };
+ tor_event_base_loopexit(tor_libevent_get_base(), &limit);
+ }
}
}
@@ -392,7 +397,7 @@ main(int argc, char **argv)
}
{
- struct timeval limit = { 30, 0 };
+ struct timeval limit = { 180, 0 };
tor_event_base_loopexit(tor_libevent_get_base(), &limit);
}