[NOTICK] Add a detekt rule to catch tests with no timeout (#5959)

* [NOTICK] Add a custom detekt rule for tests with no timeout, and fix remaining missing timeouts

* [NOTICK] Add a test for custom detekt rules and tidying

* add timeout annotation to new test

Co-authored-by: Stefano Franz <roastario@gmail.com>
This commit is contained in:
James Higgs
2020-02-14 17:31:02 +00:00
committed by GitHub
parent 014a03575e
commit 3547b629c3
44 changed files with 248 additions and 82 deletions

View File

@ -664,7 +664,7 @@ class CryptoUtilsTest {
assertFalse(Crypto.publicKeyOnCurve(EDDSA_ED25519_SHA512, EdDSAPublicKey(pubKeySpec)))
}
@Test(expected = IllegalArgumentException::class)
@Test(expected = IllegalArgumentException::class, timeout = 300_000)
fun `Unsupported EC public key type on curve`() {
val keyGen = KeyPairGenerator.getInstance("EC") // sun.security.ec.ECPublicKeyImpl
keyGen.initialize(256, newSecureRandom())

View File

@ -69,7 +69,7 @@ class ClassLoadingUtilsTest {
.doesNotContain(AbstractClass::class.java.name)
}
@Test(expected = IllegalArgumentException::class)
@Test(expected = IllegalArgumentException::class,timeout=300_000)
fun throwsExceptionWhenClassDoesNotContainProperConstructors() {
createInstancesOfClassesImplementing(BaseInterface::class.java.classLoader, BaseInterface2::class.java)
}