summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-05-11 17:57:59 -0400
committerNick Mathewson <nickm@torproject.org>2018-05-11 17:57:59 -0400
commitf6c96fd0cacfb44b4a97ac2a9887a80920937da1 (patch)
treeb50eb9d3724f285c16c123deaae382298b4f38a3
parent962c2f87766f200eb364e839038fafe50ddb0a93 (diff)
parent24299d385d38a254eabde531a8f4f7830ecb088d (diff)
downloadtor-f6c96fd0cacfb44b4a97ac2a9887a80920937da1.tar.gz
tor-f6c96fd0cacfb44b4a97ac2a9887a80920937da1.zip
Merge remote-tracking branch 'public/bug25994'
-rw-r--r--changes/ticket259945
-rw-r--r--src/test/test_channel.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/changes/ticket25994 b/changes/ticket25994
new file mode 100644
index 0000000000..135417401f
--- /dev/null
+++ b/changes/ticket25994
@@ -0,0 +1,5 @@
+ o Minor bugfixes (tests):
+ - Change the behavior of the "channel/outbound" test so that it never
+ causes a 10-second rollover for the EWMA circuitmux code. Previously,
+ this behavior would happen randomly, and result in fluctuating test
+ coverage. Fixes bug 25994; bugfix on 0.3.3.1-alpha.
diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index 8e5a5fa470..76124a6e75 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -545,6 +545,11 @@ test_channel_outbound_cell(void *arg)
(void) arg;
+ /* Set the test time to be mocked, since this test assumes that no
+ * time will pass, ewma values will not need to be re-scaled, and so on */
+ monotime_enable_test_mocking();
+ monotime_set_mock_time_nsec(U64_LITERAL(1000000000) * 12345);
+
cmux_ewma_set_options(NULL,NULL);
/* The channel will be freed so we need to hijack this so the scheduler
@@ -661,6 +666,7 @@ test_channel_outbound_cell(void *arg)
tor_free(p_cell);
channel_free_all();
UNMOCK(scheduler_release_channel);
+ monotime_disable_test_mocking();
}
/* Test inbound cell. The callstack is: