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