summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-22 11:17:01 -0400
committerNick Mathewson <nickm@torproject.org>2019-03-22 11:17:01 -0400
commit4b79b43e3e821eaddb7a6a6e8fff3aef050fd3f9 (patch)
tree446299137bbc3d9d5fa7057d5b449b614c5cfc37 /src
parentebc7556dd0af1b7cc3e12ecc04d1db567d348b2e (diff)
parenta5df9402b611f9fcfcbd22e486ae0ae16246ecd0 (diff)
downloadtor-4b79b43e3e821eaddb7a6a6e8fff3aef050fd3f9.tar.gz
tor-4b79b43e3e821eaddb7a6a6e8fff3aef050fd3f9.zip
Merge branch 'bug29693_040_radical_squashed' into maint-0.4.0
Diffstat (limited to 'src')
-rw-r--r--src/test/test_prob_distr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/test/test_prob_distr.c b/src/test/test_prob_distr.c
index 42cc6d70f6..37cfdae7d9 100644
--- a/src/test/test_prob_distr.c
+++ b/src/test/test_prob_distr.c
@@ -878,11 +878,14 @@ test_uniform_interval(void *arg)
* is higher: 1 - Binom(0; n, alpha) = 1 - (1 - alpha)^n. For n = 10,
* this is about 10%, and for n = 100 it is well over 50%.
*
- * We can drive it down by running each test twice, and accepting it if
- * it passes at least once; in that case, it is as if we used Binom(2;
- * 2, alpha) = alpha^2 as the false positive rate for each test, and
- * for n = 10 tests, it would be 0.1%, and for n = 100 tests, still
- * only 1%.
+ * Given that these tests will run with every CI job, we want to drive down the
+ * false positive rate. We can drive it down by running each test four times,
+ * and accepting it if it passes at least once; in that case, it is as if we
+ * used Binom(4; 2, alpha) = alpha^4 as the false positive rate for each test,
+ * and for n = 10 tests, it would be 9.99999959506e-08. If each CI build has 14
+ * jobs, then the chance of a CI build failing is 1.39999903326e-06, which
+ * means that a CI build will break with probability 50% after about 495106
+ * builds.
*
* The critical value for a chi^2 distribution with 100 degrees of
* freedom and false positive rate alpha = 1% was taken from:
@@ -895,7 +898,7 @@ test_uniform_interval(void *arg)
static const size_t NSAMPLES = 100000;
/* Number of chances we give to the test to succeed. */
-static const unsigned NTRIALS = 2;
+static const unsigned NTRIALS = 4;
/* Number of times we want the test to pass per NTRIALS. */
static const unsigned NPASSES_MIN = 1;