From cb22af9a160596d3fe39d2c66ca03bff0dc33b5d Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Wed, 23 Apr 2014 14:25:42 -0700 Subject: [PATCH] tests: Use insecure random for acceptance tests This reduces startup time for JUnit tests which need random data to seed the SSHD PRNG. Using /dev/./urandom is necessary as a workaround on modern Java versions[1]. [1] https://bugs.openjdk.java.net/browse/JDK-6202721 Change-Id: I944f73e93dca131c6947779a3f9f4fb8d87b9a54 --- gerrit-acceptance-tests/tests.defs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gerrit-acceptance-tests/tests.defs b/gerrit-acceptance-tests/tests.defs index 176fa38614..7bd2430679 100644 --- a/gerrit-acceptance-tests/tests.defs +++ b/gerrit-acceptance-tests/tests.defs @@ -10,9 +10,12 @@ def acceptance_tests( labels = [], source_under_test = [], vm_args = ['-Xmx256m']): - from os import environ + from os import environ, path if not environ.get('NO_BOUNCYCASTLE'): deps = BOUNCYCASTLE + deps + if path.exists('/dev/urandom'): + vm_args = vm_args + ['-Djava.security.egd=file:/dev/./urandom'] + for j in srcs: java_test( name = j[:-len('.java')],