summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-09-05 23:02:33 -0400
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-09-05 23:02:33 -0400
commit5262a288df07daa050a0e17669c3f103f47a8640 (patch)
treebc8c1b0f3086d08567b2a1fee09f121c4dfee6a5
parent3f53cac520d6a4f87b7b8e45eeb06921a58c515f (diff)
Fixed #18687: Removed test_performance_scalability
Even after repeated adjustment of the constants, this test still fails randomly. It has educated us to ignore messages from Jenkins, to a point where we missed some actual failures. In addition, it accounts for a non-negligible percentage of the run time of the test suite just by itself. Since no one has proposed a convincing patch in months, I'm going to remove the patch. We can't keep a randomly failing test forever.
-rw-r--r--tests/regressiontests/utils/crypto.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/tests/regressiontests/utils/crypto.py b/tests/regressiontests/utils/crypto.py
index 4c6b722ca9..5cf2934ab0 100644
--- a/tests/regressiontests/utils/crypto.py
+++ b/tests/regressiontests/utils/crypto.py
@@ -144,21 +144,3 @@ class TestUtilsCryptoPBKDF2(unittest.TestCase):
result = pbkdf2(**vector['args'])
self.assertEqual(binascii.hexlify(result).decode('ascii'),
vector['result'])
-
- def test_performance_scalability(self):
- """
- Theory: If you run with 100 iterations, it should take 100
- times as long as running with 1 iteration.
- """
- # These values are chosen as a reasonable tradeoff between time
- # to run the test suite and false positives caused by imprecise
- # measurement.
- n1, n2 = 200000, 800000
- elapsed = lambda f: timeit.Timer(f,
- 'from django.utils.crypto import pbkdf2').timeit(number=1)
- t1 = elapsed('pbkdf2("password", "salt", iterations=%d)' % n1)
- t2 = elapsed('pbkdf2("password", "salt", iterations=%d)' % n2)
- measured_scale_exponent = math.log(t2 / t1, n2 / n1)
- # This should be less than 1. We allow up to 1.2 so that tests don't
- # fail nondeterministically too often.
- self.assertLess(measured_scale_exponent, 1.2)