Merge pull request #7621 from corda/feature/arshad/ent-11294-fix-checkpoint-failing-test

ENT-11294  Fix failing tests in - FlowCheckpointVersionNodeStartupCheckTest
This commit is contained in:
Adel El-Beik 2023-12-19 11:26:10 +00:00 committed by GitHub
commit 7cbfc71a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 12 deletions

View File

@ -30,7 +30,6 @@ import net.corda.testing.driver.driver
import net.corda.testing.node.internal.assertUncompletedCheckpoints
import net.corda.testing.node.internal.enclosedCordapp
import org.assertj.core.api.Assertions.assertThat
import org.junit.Ignore
import org.junit.Test
import java.nio.file.Path
import kotlin.io.path.createDirectories
@ -40,7 +39,6 @@ import kotlin.io.path.readText
import kotlin.test.assertFailsWith
// TraderDemoTest already has a test which checks the node can resume a flow from a checkpoint
@Ignore("TODO JDK17: Fixme")
class FlowCheckpointVersionNodeStartupCheckTest {
companion object {
val defaultCordapp = enclosedCordapp()

View File

@ -9,11 +9,9 @@ import net.corda.core.utilities.getOrThrow
import net.corda.testing.driver.driver
import net.corda.testing.driver.logFile
import org.assertj.core.api.Assertions
import org.junit.Ignore
import org.junit.Test
import java.time.Duration
@Ignore("TODO JDK17: Fixme")
class DuplicateSerializerLogTest{
@Test(timeout=300_000)
fun `check duplicate serialisers are logged`() {

View File

@ -12,11 +12,9 @@ import net.corda.testing.driver.driver
import net.corda.testing.driver.logFile
import net.corda.testing.node.internal.enclosedCordapp
import org.assertj.core.api.Assertions
import org.junit.Ignore
import org.junit.Test
import java.time.Duration
@Ignore("TODO JDK17: Fixme")
class DuplicateSerializerLogWithSameSerializerTest {
@Test(timeout=300_000)
fun `check duplicate serialisers are logged not logged for the same class`() {

View File

@ -1,5 +1,6 @@
package net.corda.node.internal
import com.esotericsoftware.kryo.KryoException
import net.corda.core.cordapp.Cordapp
import net.corda.core.crypto.SecureHash
import net.corda.core.flows.FlowLogic
@ -42,13 +43,14 @@ object CheckpointVerifier {
it.forEach { (_, serializedCheckpoint) ->
val checkpoint = try {
serializedCheckpoint.deserialize(checkpointSerializationContext)
} catch (e: ClassNotFoundException) {
val message = e.message
} catch (e: KryoException) {
if (e.cause is ClassNotFoundException) {
val message = (e.cause as ClassNotFoundException).message
if (message != null) {
throw CheckpointIncompatibleException.CordappNotInstalledException(message)
} else {
throw CheckpointIncompatibleException.CannotBeDeserialisedException(e)
}
}
throw CheckpointIncompatibleException.CannotBeDeserialisedException(e)
} catch (e: Exception) {
throw CheckpointIncompatibleException.CannotBeDeserialisedException(e)
}