EFForg / cryptobot-email

GNU Affero General Public License v3.0
61 stars 11 forks source link

Generating keys in tests is very slow #24

Closed wearpants closed 10 years ago

wearpants commented 10 years ago

Generating a keypair in tests is extremely slow. This is related to #18 & #23.

Ideally, we reduce # of tests that generate keys in the first place. At a quick glance, the only test that seems to require generating a new key is GnuPGTest.test_gen_key.

Key generation is slow b/c the kernel lacks entropy (this is often a problem on servers & VMs without a lot of I/O). Possible approaches:

Alternately, the slow tests could be moved to a separate file, so that they can be run selectively.

mfb commented 10 years ago

would running haveged in the test environment be enough of a solution?

wearpants commented 10 years ago

Cool, that did the trick :-). I'll make a note in the docs

http://www.issihosts.com/haveged/

garrettr commented 10 years ago

Additionally, you could consider using a smaller key size (say RSA-1024) for tests only. These are much faster to generate than 2048 or 4096 bit keys. We do this for the Securedrop unit tests.