From 9bb808b747d340a9614abe5122c3693b5ff2bdd1 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 1 Sep 2013 00:04:40 +0000 Subject: [PATCH] speed up the test_privacy test a bit --- test/test_privacy.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_privacy.cpp b/test/test_privacy.cpp index dd092a8b3..2cd21fb7a 100644 --- a/test/test_privacy.cpp +++ b/test/test_privacy.cpp @@ -93,6 +93,9 @@ void test_proxy(proxy_settings::proxy_type proxy_type, int flags) session* s = new libtorrent::session(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48875, 49800), "0.0.0.0", 0, alert_mask); session_settings sett; + sett.stop_tracker_timeout = 1; + sett.tracker_completion_timeout = 1; + sett.tracker_receive_timeout = 1; sett.half_open_limit = 1; sett.announce_to_all_trackers = true; sett.announce_to_all_tiers = true; @@ -143,6 +146,11 @@ void test_proxy(proxy_settings::proxy_type proxy_type, int flags) { print_alerts(*s, "s", false, false, false, &alert_predicate); test_sleep(100); + + if (g_udp_tracker_requests >= prev_udp_announces + 1 + && g_http_tracker_requests >= prev_http_announces + 1 + && num_peer_hits() > 0) + break; } // we should have announced to the tracker by now