aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2010-09-29 08:55:11 -0700
committerMike Perry <mikeperry-git@fscked.org>2010-09-29 11:49:43 -0700
commit11910cf5b32edfd6b900386d37bb69c7592174c1 (patch)
tree1b740c0062fc0eca5e269bd7248db8ec407e0395 /src/test
parent0744a175afa559435bd0e3cdb53891282469e0ee (diff)
downloadtor-11910cf5b32edfd6b900386d37bb69c7592174c1.tar
tor-11910cf5b32edfd6b900386d37bb69c7592174c1.tar.gz
Do away with the complexity of the network liveness detection.
We really should ignore any timeouts that have *no* network activity for their entire measured lifetime, now that we have the 95th percentile measurement changes. Usually this is up to a minute, even on fast connections.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/test/test.c b/src/test/test.c
index d9528328b..8d8c46fca 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -499,28 +499,14 @@ test_circuit_timeout(void)
build_times_idx = estimate.build_times_idx;
total_build_times = estimate.total_build_times;
- for (i = 0; i < CBT_NETWORK_NONLIVE_TIMEOUT_COUNT; i++) {
- test_assert(circuit_build_times_network_check_live(&estimate));
- test_assert(circuit_build_times_network_check_live(&final));
-
- circuit_build_times_count_close(&estimate, 0,
- (time_t)(approx_time()-estimate.close_ms/1000.0-1));
- circuit_build_times_count_close(&final, 0,
- (time_t)(approx_time()-final.close_ms/1000.0-1));
- }
-
- test_assert(!circuit_build_times_network_check_live(&estimate));
- test_assert(!circuit_build_times_network_check_live(&final));
- for ( ; i < CBT_NETWORK_NONLIVE_DISCARD_COUNT; i++) {
- circuit_build_times_count_close(&estimate, 0,
- (time_t)(approx_time()-estimate.close_ms/1000.0-1));
+ test_assert(circuit_build_times_network_check_live(&estimate));
+ test_assert(circuit_build_times_network_check_live(&final));
- if (i < CBT_NETWORK_NONLIVE_DISCARD_COUNT-1) {
- circuit_build_times_count_close(&final, 0,
- (time_t)(approx_time()-final.close_ms/1000.0-1));
- }
- }
+ circuit_build_times_count_close(&estimate, 0,
+ (time_t)(approx_time()-estimate.close_ms/1000.0-1));
+ circuit_build_times_count_close(&final, 0,
+ (time_t)(approx_time()-final.close_ms/1000.0-1));
test_assert(!circuit_build_times_network_check_live(&estimate));
test_assert(!circuit_build_times_network_check_live(&final));