diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoService.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoService.kt index f0a9d1b1e7..771a9b2222 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoService.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoService.kt @@ -67,11 +67,13 @@ abstract class CryptoService(private val timeout: Duration? = null) : AutoClosea * @throws TimedCryptoServiceException if we reach the timeout */ private fun 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") +// } } /** diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoServiceTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoServiceTest.kt index 58f9aef1fb..79c4bdc6cc 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoServiceTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/CryptoServiceTest.kt @@ -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)