MockNetwork remove hibernate sessions on stop (#7857)

This commit is contained in:
Chris Cochrane 2024-10-28 13:25:52 +00:00 committed by GitHub
parent af83cb9c8c
commit 5b9d65ad51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,6 +84,7 @@ import java.time.Clock
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
import org.hibernate.internal.SessionFactoryRegistry
val MOCK_VERSION_INFO = VersionInfo(PLATFORM_VERSION, "Mock release", "Mock revision", "Mock Vendor") val MOCK_VERSION_INFO = VersionInfo(PLATFORM_VERSION, "Mock release", "Mock revision", "Mock Vendor")
@ -621,6 +622,7 @@ open class InternalMockNetwork(cordappPackages: List<String> = emptyList(),
} }
messagingNetwork.stop() messagingNetwork.stop()
} }
SessionFactoryRegistry.INSTANCE.clearRegistrations()
} }
/** Block until all scheduled activity, active flows and network activity has ceased. */ /** Block until all scheduled activity, active flows and network activity has ceased. */