mirror of
https://github.com/corda/corda.git
synced 2025-04-07 11:27:01 +00:00
ENT-3827: Temporarily disable the HSM timeouts (#5291)
This commit is contained in:
parent
9bcaecfbe3
commit
76631132ca
@ -67,11 +67,13 @@ abstract class CryptoService(private val timeout: Duration? = null) : AutoClosea
|
||||
* @throws TimedCryptoServiceException if we reach the timeout
|
||||
*/
|
||||
private fun <A> withTimeout(timeout: Duration?, func: () -> A) : A {
|
||||
try {
|
||||
return executor.submit(func).getOrThrow(timeout)
|
||||
} catch (e: TimeoutException) {
|
||||
throw TimedCryptoServiceException("Timed-out while waiting for ${timeout?.toMillis()} milliseconds")
|
||||
}
|
||||
return func()
|
||||
// TODO: Bring back timeouts. (See ENT-3827 & ENT-3658)
|
||||
// try {
|
||||
// return executor.submit(func).getOrThrow(timeout)
|
||||
// } catch (e: TimeoutException) {
|
||||
// throw TimedCryptoServiceException("Timed-out while waiting for ${timeout?.toMillis()} milliseconds")
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5,6 +5,7 @@ import net.corda.core.internal.times
|
||||
import org.bouncycastle.operator.ContentSigner
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
import java.security.PublicKey
|
||||
import java.time.Duration
|
||||
@ -53,12 +54,14 @@ class CryptoServiceTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("When ENT-3658 is revisited")
|
||||
@Test
|
||||
fun `if no timeout is reached then correct value is returned`() {
|
||||
sleepTime = Duration.ZERO
|
||||
expect(true) { stub.containsKey("Test") }
|
||||
}
|
||||
|
||||
@Ignore("When ENT-3658 is revisited")
|
||||
@Test
|
||||
fun `when timeout is reached the correct exception is thrown`() {
|
||||
sleepTime = TEST_TIMEOUT.times(2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user