From b23af5f0d208502a4154b2757ed8e95440b7c8d0 Mon Sep 17 00:00:00 2001 From: Stefano Franz Date: Tue, 11 Feb 2020 10:14:05 +0000 Subject: [PATCH] add timeouts to all tests (#5875) --- .ci/Dockerfile | 3 + .../net/corda/client/jackson/AmountTest.kt | 36 +- .../client/jackson/JacksonSupportTest.kt | 232 ++++---- .../client/jackson/StateMachineRunIdTest.kt | 8 +- .../jackson/StringToMethodCallParserTest.kt | 20 +- .../client/jfx/model/ExchangeRateModelTest.kt | 4 +- .../client/jfx/utils/AggregatedListTest.kt | 12 +- .../client/jfx/utils/AssociatedListTest.kt | 12 +- .../client/jfx/utils/ConcatenatedListTest.kt | 12 +- .../client/jfx/utils/FlattenedListTest.kt | 16 +- .../jfx/utils/LeftOuterJoinedMapTest.kt | 8 +- .../corda/client/jfx/utils/MappedListTest.kt | 12 +- .../client/jfx/utils/ReplayedListTest.kt | 12 +- .../client/rpc/BlacklistKotlinClosureTest.kt | 4 +- .../corda/client/rpc/CordaRPCClientTest.kt | 36 +- .../client/rpc/FlowsExecutionModeRpcTest.kt | 12 +- .../client/rpc/RPCMultipleInterfacesTests.kt | 4 +- .../net/corda/client/rpc/RPCStabilityTests.kt | 72 +-- .../client/rpc/RpcCustomSerializersTest.kt | 12 +- .../CordaRPCClientReconnectionTest.kt | 14 +- .../kotlin/rpc/StandaloneCordaRPClientTest.kt | 44 +- .../rpc/ClientRPCInfrastructureTests.kt | 28 +- .../corda/client/rpc/RPCConcurrencyTests.kt | 12 +- .../net/corda/client/rpc/RPCFailureTests.kt | 16 +- .../rpc/RPCHighThroughputObservableTests.kt | 4 +- .../corda/client/rpc/RPCPerformanceTests.kt | 12 +- .../corda/client/rpc/RPCPermissionsTests.kt | 28 +- .../parsing/internal/PropertyTest.kt | 60 +-- .../internal/PropertyValidationTest.kt | 72 +-- .../parsing/internal/SchemaTest.kt | 24 +- .../parsing/internal/SpecificationTest.kt | 24 +- .../parsing/internal/UtilsTest.kt | 4 +- .../versioned/VersionExtractorTest.kt | 20 +- .../versioned/VersionedParsingExampleTest.kt | 8 +- .../confidential/IdentitySyncFlowTests.kt | 8 +- .../confidential/SwapIdentitiesFlowTests.kt | 16 +- .../corda/deterministic/data/GenerateData.kt | 2 +- .../corda/deterministic/CordaExceptionTest.kt | 20 +- .../deterministic/contracts/AttachmentTest.kt | 8 +- .../contracts/PrivacySaltTest.kt | 16 +- .../contracts/UniqueIdentifierTest.kt | 12 +- .../deterministic/crypto/MerkleTreeTest.kt | 4 +- .../deterministic/crypto/SecureHashTest.kt | 16 +- .../deterministic/crypto/SecureRandomTest.kt | 4 +- .../crypto/TransactionSignatureTest.kt | 12 +- .../TransactionWithSignaturesTest.kt | 4 +- .../txverify/VerifyTransactionTest.kt | 8 +- .../verifier/LocalSerializationRule.kt | 6 +- .../net/corda/coretests/NodeVersioningTest.kt | 8 +- .../coretests/cordapp/CordappSmokeTest.kt | 8 +- .../corda/coretests/contracts/AmountTests.kt | 28 +- .../contracts/ConstraintsPropagationTests.kt | 64 +-- .../contracts/ContractHierarchyTest.kt | 4 +- .../coretests/contracts/ContractsDSLTests.kt | 48 +- .../PackageOwnershipVerificationTests.kt | 12 +- .../coretests/contracts/TimeWindowTest.kt | 20 +- ...VerificationExceptionSerialisationTests.kt | 80 +-- .../coretests/crypto/CompositeKeyTests.kt | 52 +- .../coretests/crypto/PartialMerkleTreeTest.kt | 80 +-- .../corda/coretests/crypto/SignedDataTest.kt | 4 +- .../crypto/TransactionSignatureTest.kt | 12 +- .../crypto/X509NameConstraintsTest.kt | 12 +- .../corda/coretests/flows/AttachmentTests.kt | 12 +- .../flows/CollectSignaturesFlowTests.kt | 28 +- .../flows/ContractUpgradeFlowRPCTest.kt | 4 +- .../flows/ContractUpgradeFlowTest.kt | 8 +- .../coretests/flows/FastThreadLocalTest.kt | 24 +- .../coretests/flows/FinalityFlowTests.kt | 16 +- .../flows/FlowExternalAsyncOperationTest.kt | 40 +- .../FlowExternalOperationStartFlowTest.kt | 8 +- .../flows/FlowExternalOperationTest.kt | 56 +- .../coretests/flows/ReceiveAllFlowTests.kt | 12 +- .../flows/ReceiveFinalityFlowTest.kt | 4 +- .../flows/ReferencedStatesFlowTests.kt | 20 +- .../indentity/PartyAndCertificateTest.kt | 12 +- .../corda/coretests/indentity/PartyTest.kt | 4 +- .../corda/coretests/internal/CertRoleTests.kt | 12 +- .../NetworkParametersResolutionTest.kt | 20 +- .../internal/ResolveTransactionsFlowTest.kt | 48 +- .../coretests/node/NetworkParametersTest.kt | 20 +- .../net/corda/coretests/node/NodeInfoTests.kt | 8 +- .../corda/coretests/node/VaultUpdateTests.kt | 28 +- ...ppedSchemasCrossReferenceDetectionTests.kt | 36 +- .../AttachmentSerializationTest.kt | 16 +- .../CommandsSerializationTests.kt | 4 +- .../NotaryExceptionSerializationTest.kt | 4 +- .../TransactionSerializationTests.kt | 16 +- ...ttachmentsClassLoaderSerializationTests.kt | 16 +- .../AttachmentsClassLoaderTests.kt | 84 +-- .../CompatibleTransactionTests.kt | 24 +- .../LedgerTransactionQueryTests.kt | 80 +-- .../transactions/ReferenceInputStateTests.kt | 16 +- .../transactions/TransactionBuilderTest.kt | 16 +- .../TransactionEncumbranceTests.kt | 36 +- .../transactions/TransactionTests.kt | 24 +- .../coretests/utilities/KotlinUtilsTest.kt | 20 +- .../coretests/utilities/NonEmptySetTest.kt | 12 +- .../utilities/ProgressTrackerTest.kt | 68 +-- .../test/kotlin/net/corda/core/UtilsTest.kt | 20 +- .../core/concurrent/ConcurrencyUtilsTest.kt | 24 +- .../corda/core/contracts/PrivacySaltTest.kt | 4 +- .../corda/core/contracts/StructuresTests.kt | 12 +- .../net/corda/core/crypto/Base58Test.kt | 12 +- .../net/corda/core/crypto/CryptoUtilsTest.kt | 140 ++--- .../net/corda/core/crypto/EdDSATests.kt | 4 +- .../net/corda/core/crypto/SecureHashTest.kt | 4 +- .../corda/core/identity/CordaX500NameTest.kt | 84 +-- .../net/corda/core/identity/X500UtilsTest.kt | 4 +- .../core/internal/ClassLoadingUtilsTest.kt | 16 +- .../corda/core/internal/InternalUtilsTest.kt | 52 +- .../core/internal/LegalNameValidatorTest.kt | 36 +- .../net/corda/core/internal/NamedCacheTest.kt | 4 +- .../net/corda/core/internal/PathUtilsTest.kt | 28 +- .../core/internal/StatePointerSearchTests.kt | 24 +- .../corda/core/internal/ToggleFieldTest.kt | 36 +- .../concurrent/CordaFutureImplTest.kt | 40 +- .../internal/cordapp/CordappResolverTest.kt | 16 +- .../core/node/services/VaultEnumTypesTest.kt | 4 +- .../corda/core/utilities/ByteArraysTest.kt | 8 +- .../corda/core/utilities/EncodingUtilsTest.kt | 32 +- .../core/utilities/LazyMappedListTest.kt | 12 +- .../core/utilities/NetworkHostAndPortTest.kt | 16 +- detekt-baseline.xml | 220 ++++---- .../test/KotlinIntegrationTestingTutorial.kt | 4 +- .../test/TutorialFlowAsyncOperationTest.kt | 4 +- .../net/corda/docs/ExampleConfigTest.kt | 4 +- .../kotlin/FxTransactionBuildTutorialTest.kt | 4 +- .../tutorial/testdsl/TutorialTestDSL.kt | 32 +- .../WorkflowTransactionBuildTutorialTest.kt | 4 +- .../docs/kotlin/vault/CustomVaultQueryTest.kt | 8 +- .../cryptoblk/core/StatusTransitionsTest.kt | 48 +- .../corda/finance/contracts/universal/Cap.kt | 24 +- .../finance/contracts/universal/Caplet.kt | 12 +- .../contracts/universal/ContractDefinition.kt | 8 +- .../contracts/universal/FXFwdTimeOption.kt | 12 +- .../finance/contracts/universal/FXSwap.kt | 36 +- .../corda/finance/contracts/universal/IRS.kt | 12 +- .../contracts/universal/RollOutTests.kt | 24 +- .../finance/contracts/universal/Swaption.kt | 8 +- .../contracts/universal/ZeroCouponBond.kt | 24 +- .../finance/contracts/CommercialPaperTests.kt | 24 +- .../finance/contracts/FinanceTypesTest.kt | 56 +- .../finance/contracts/asset/CashTests.kt | 140 ++--- .../contracts/asset/ObligationTests.kt | 116 ++-- .../CashExceptionSerialisationTest.kt | 4 +- .../net/corda/finance/CurrenciesTests.kt | 12 +- .../corda/finance/flows/CashExitFlowTests.kt | 8 +- .../corda/finance/flows/CashIssueFlowTests.kt | 8 +- .../finance/flows/CashPaymentFlowTests.kt | 12 +- .../corda/finance/flows/CashSelectionTest.kt | 16 +- .../corda/finance/flows/CompatibilityTest.kt | 4 +- .../internal/CashConfigDataFlowTest.kt | 4 +- .../selection/CashSelectionH2ImplTest.kt | 16 +- ...tachmentsClassLoaderStaticContractTests.kt | 8 +- .../nodeapi/internal/CordaPersistenceTest.kt | 18 +- .../nodeapi/internal/SignedNodeInfoTest.kt | 28 +- .../internal/config/ConfigParsingTest.kt | 120 ++--- .../internal/crypto/AliasPrivateKeyTest.kt | 4 +- .../internal/crypto/DevCertificatesTest.kt | 4 +- .../internal/crypto/TlsDiffAlgorithmsTest.kt | 4 +- .../internal/crypto/TlsDiffProtocolsTest.kt | 4 +- .../internal/crypto/X509UtilitiesTest.kt | 52 +- .../bouncycastle/BCCryptoServiceTests.kt | 40 +- ...cycleEventsDistributorMultiThreadedTest.kt | 4 +- .../network/NetworkBootstrapperTest.kt | 80 +-- .../network/NodeInfoFilesCopierTest.kt | 16 +- .../network/WhitelistGeneratorTest.kt | 52 +- .../persistence/MissingSchemaMigrationTest.kt | 12 +- .../protonwrapper/netty/SSLHelperTest.kt | 4 +- .../client/rpc/FlowsExecutionModeRpcTest.kt | 4 +- ...owCheckpointVersionNodeStartupCheckTest.kt | 4 +- .../node/logging/IssueCashLoggingTests.kt | 4 +- .../persistence/NodeStatePersistenceTests.kt | 8 +- .../distributed/DistributedServiceTests.kt | 12 +- .../node/services/rpc/RpcReconnectTests.kt | 4 +- .../StatemachineFinalityErrorHandlingTest.kt | 16 +- .../StatemachineGeneralErrorHandlingTest.kt | 56 +- .../StatemachineKillFlowErrorHandlingTest.kt | 12 +- .../StatemachineSubflowErrorHandlingTest.kt | 16 +- .../registration/NodeRegistrationTest.kt | 4 +- .../corda/services/vault/VaultRestartTest.kt | 4 +- .../SignatureConstraintGatingTests.kt | 12 +- ...traintMigrationFromHashConstraintsTests.kt | 24 +- ...ntMigrationFromWhitelistConstraintTests.kt | 20 +- .../corda/node/AddressBindingFailureTests.kt | 20 +- .../kotlin/net/corda/node/AuthDBTests.kt | 28 +- .../kotlin/net/corda/node/BootTests.kt | 12 +- .../node/ContractWithCordappFixupTest.kt | 8 +- .../node/ContractWithCustomSerializerTest.kt | 4 +- ...ContractWithMissingCustomSerializerTest.kt | 12 +- .../net/corda/node/CordappConstraintsTests.kt | 20 +- .../corda/node/CordappScanningDriverTest.kt | 4 +- .../net/corda/node/NodeConfigParsingTests.kt | 20 +- .../net/corda/node/NodeKeystoreCheckTest.kt | 8 +- .../net/corda/node/NodePerformanceTests.kt | 12 +- .../kotlin/net/corda/node/NodeRPCTests.kt | 4 +- .../corda/node/NodeStartupPerformanceTests.kt | 4 +- .../net/corda/node/amqp/AMQPBridgeTest.kt | 8 +- .../CertificateRevocationListNodeTests.kt | 44 +- .../net/corda/node/amqp/ProtonWrapperTests.kt | 36 +- .../net/corda/node/flows/FlowOverrideTests.kt | 8 +- .../net/corda/node/flows/FlowRetryTest.kt | 32 +- .../node/logging/ErrorCodeLoggingTests.kt | 8 +- .../FlowsDrainingModeContentionTest.kt | 4 +- .../draining/P2PFlowsDrainingModeTest.kt | 16 +- .../draining/RpcFlowsDrainingModeTest.kt | 4 +- .../persistence/DbSchemaInitialisationTest.kt | 8 +- .../corda/node/persistence/H2SecurityTests.kt | 36 +- .../node/services/AttachmentLoadingTests.kt | 8 +- .../node/services/CordaServiceFlowTests.kt | 4 +- .../CordaServiceIssueOnceAtStartupTests.kt | 4 +- .../CordaServiceLifecycleFatalTests.kt | 2 +- .../services/CordaServiceLifecycleTests.kt | 4 +- .../DeterministicContractCryptoTest.kt | 4 +- ...inisticContractWithCustomSerializerTest.kt | 8 +- ...cContractWithSerializationWhitelistTest.kt | 8 +- .../JavaCordaServiceLifecycleTests.kt | 4 +- .../NonDeterministicContractVerifyTest.kt | 24 +- .../node/services/SandboxAttachmentsTest.kt | 8 +- .../events/ScheduledFlowIntegrationTests.kt | 4 +- .../messaging/ArtemisMessagingTest.kt | 32 +- .../node/services/network/NetworkMapTest.kt | 12 +- .../network/PersistentNetworkMapCacheTest.kt | 44 +- .../CordaPersistenceServiceTests.kt | 4 +- .../node/services/rpc/ArtemisRpcTests.kt | 16 +- .../node/services/rpc/DumpCheckpointsTest.kt | 4 +- .../node/services/rpc/NodeHandleTests.kt | 4 +- .../services/rpc/RpcExceptionHandlingTest.kt | 16 +- .../net/corda/node/services/rpc/RpcSslTest.kt | 16 +- .../services/statemachine/FlowHospitalTest.kt | 20 +- .../statemachine/FlowVersioningTest.kt | 4 +- .../services/statemachine/HardRestartTest.kt | 16 +- .../statemachine/LargeTransactionsTest.kt | 4 +- .../vault/VaultObserverExceptionTest.kt | 52 +- .../messaging/AdditionP2PAddressModeTest.kt | 4 +- .../messaging/MQSecurityAsNodeTest.kt | 28 +- .../services/messaging/MQSecurityAsRPCTest.kt | 4 +- .../services/messaging/MQSecurityTest.kt | 20 +- .../services/messaging/P2PMQSecurityTest.kt | 28 +- .../services/messaging/P2PMessagingTest.kt | 4 +- .../services/messaging/RPCMQSecurityTest.kt | 28 +- .../net/corda/node/CordaRPCOpsImplTest.kt | 99 ++-- .../net/corda/node/SerialFilterTests.kt | 8 +- .../corda/node/internal/AbstractNodeTests.kt | 8 +- .../corda/node/internal/CordaServiceTest.kt | 32 +- .../node/internal/FlowRegistrationTest.kt | 8 +- .../node/internal/NodeFlowManagerTest.kt | 4 +- .../corda/node/internal/NodeRestartTests.kt | 4 +- .../corda/node/internal/NodeStartupCliTest.kt | 8 +- .../corda/node/internal/NodeStartupTest.kt | 4 +- .../net/corda/node/internal/NodeTest.kt | 20 +- .../node/internal/NodeUnloadHandlerTests.kt | 4 +- .../cordapp/CordappConfigFileProviderTests.kt | 12 +- .../cordapp/CordappProviderImplTests.kt | 44 +- .../cordapp/JarScanningCordappLoaderTest.kt | 56 +- .../cordapp/TypesafeCordappConfigTests.kt | 12 +- .../ThreadContextAdjustingRpcOpsProxyTest.kt | 4 +- .../node/internal/security/PasswordTest.kt | 24 +- .../RoundTripObservableSerializerTests.kt | 4 +- .../RpcServerObservableSerializerTests.kt | 12 +- .../node/messaging/TwoPartyTradeFlowTests.kt | 24 +- ...entityServiceToStringShortMigrationTest.kt | 4 +- ...PersistentIdentityMigrationNewTableTest.kt | 4 +- .../node/migration/VaultStateMigrationTest.kt | 56 +- .../ScheduledFlowsDrainingModeTest.kt | 4 +- .../serialization/kryo/KryoStreamsTest.kt | 20 +- .../node/serialization/kryo/KryoTests.kt | 92 ++-- .../node/services/FinalityHandlerTest.kt | 4 +- .../corda/node/services/NotaryChangeTests.kt | 20 +- .../node/services/RPCSecurityManagerTest.kt | 48 +- .../services/ServiceHubConcurrentUsageTest.kt | 4 +- .../net/corda/node/services/TimedFlowTests.kt | 16 +- .../AttachmentTrustCalculatorTest.kt | 68 +-- .../services/config/ConfigOperatorTests.kt | 4 +- .../config/NodeConfigurationImplTest.kt | 88 +-- .../diagnostics/NodeDiagnosticsServiceTest.kt | 4 +- .../events/NodeSchedulerServiceTest.kt | 48 +- .../PersistentScheduledFlowRepositoryTest.kt | 8 +- .../services/events/ScheduledFlowTests.kt | 8 +- .../identity/InMemoryIdentityServiceTests.kt | 40 +- .../PersistentIdentityServiceTests.kt | 76 +-- .../node/services/keys/FilterMyKeysTests.kt | 4 +- .../corda/node/services/keys/KMSUtilsTests.kt | 4 +- .../network/DBNetworkParametersStorageTest.kt | 16 +- .../services/network/NetworkMapCacheTest.kt | 24 +- .../services/network/NetworkMapClientTest.kt | 24 +- .../services/network/NetworkMapUpdaterTest.kt | 56 +- .../network/NetworkParametersReaderTest.kt | 12 +- .../services/network/NodeInfoWatcherTest.kt | 20 +- ...ppendOnlyPersistentMapNonConcurrentTest.kt | 16 +- .../AppendOnlyPersistentMapTest.kt | 16 +- .../persistence/DBCheckpointStorageTests.kt | 24 +- .../persistence/DBTransactionStorageTests.kt | 36 +- .../services/persistence/DbMapDeadlockTest.kt | 4 +- .../persistence/ExposeJpaToFlowsTests.kt | 8 +- .../persistence/HibernateConfigurationTest.kt | 112 ++-- .../persistence/HibernateInteractionTests.kt | 8 +- .../persistence/NodeAttachmentServiceTest.kt | 148 ++--- .../ObserverNodeTransactionTests.kt | 20 +- .../PublicKeyToOwningIdentityCacheImplTest.kt | 28 +- .../persistence/TransactionCallbackTest.kt | 8 +- .../persistence/TransactionOrderingTests.kt | 4 +- .../services/rpc/CheckpointDumperImplTest.kt | 8 +- .../services/schema/NodeSchemaServiceTest.kt | 28 +- .../schema/PersistentStateServiceTests.kt | 4 +- .../ExceptionsSerializationTest.kt | 4 +- .../statemachine/FlowAsyncOperationTests.kt | 12 +- .../FlowFrameworkPersistenceTests.kt | 16 +- .../statemachine/FlowFrameworkTests.kt | 112 ++-- .../FlowFrameworkTripartyTests.kt | 16 +- .../FlowLogicRefFactoryImplTest.kt | 28 +- .../statemachine/IdempotentFlowTests.kt | 4 +- .../statemachine/RetryFlowMockTest.kt | 24 +- ...TransactionsResolverTopologicalSortTest.kt | 20 +- .../transactions/MaxTransactionSizeTests.kt | 8 +- .../NonValidatingNotaryServiceTests.kt | 44 +- .../transactions/NotaryServiceTests.kt | 12 +- .../transactions/NotaryWhitelistTests.kt | 12 +- .../services/transactions/PathManagerTests.kt | 8 +- .../transactions/ResolveStatePointersTest.kt | 36 +- .../transactions/UniquenessProviderTests.kt | 72 +-- .../ValidatingNotaryServiceTests.kt | 56 +- .../services/vault/ExternalIdMappingTest.kt | 16 +- .../services/vault/NodeVaultServiceTest.kt | 120 ++--- .../node/services/vault/VaultFlowTest.kt | 4 +- .../vault/VaultQueryExceptionsTests.kt | 4 +- .../node/services/vault/VaultQueryTests.kt | 508 +++++++++--------- .../vault/VaultSoftLockManagerTest.kt | 16 +- .../node/services/vault/VaultWithCashTest.kt | 28 +- .../corda/node/utilities/AddressUtilsTests.kt | 4 +- .../node/utilities/AffinityExecutorTests.kt | 12 +- .../corda/node/utilities/ClockUtilsTest.kt | 52 +- .../utilities/InfrequentlyMutatedCacheTest.kt | 64 +-- .../corda/node/utilities/ObservablesTests.kt | 22 +- .../node/utilities/PersistentMapTests.kt | 28 +- .../node/utilities/TLSAuthenticationTests.kt | 28 +- .../utilities/logging/AsyncLoggingTest.kt | 4 +- .../HTTPNetworkRegistrationServiceTest.kt | 8 +- .../NetworkRegistrationHelperTest.kt | 28 +- .../bftsmart/BFTNotaryServiceTests.kt | 16 +- .../bftsmart/BFTSmartConfigTests.kt | 12 +- .../raft/RaftNotaryServiceTests.kt | 8 +- .../raft/RaftTransactionCommitLogTests.kt | 16 +- .../attachmentdemo/AttachmentDemoTest.kt | 4 +- .../kotlin/net/corda/irs/contract/IRSTests.kt | 76 +-- .../corda/irs/api/NodeInterestRatesTest.kt | 40 +- .../corda/irs/api/OracleNodeTearOffTests.kt | 12 +- .../net/corda/irs/math/InterpolatorsTest.kt | 32 +- .../kotlin/net/corda/irs/IRSDemoTest.kt | 4 +- .../kotlin/net/corda/irs/IRSDemoDockerTest.kt | 4 +- .../irs/web/IrsDemoWebApplicationTests.kt | 4 +- .../TestCommsFlowInitiatorTest.kt | 8 +- .../net/corda/vega/SimmValuationTest.kt | 4 +- .../net/corda/traderdemo/TraderDemoTest.kt | 8 +- .../flow/TransactionGraphSearchTests.kt | 12 +- .../djvm/DeserializeBigDecimalTest.kt | 4 +- .../djvm/DeserializeBigIntegerTest.kt | 2 +- .../djvm/DeserializeBitSetTest.kt | 2 +- .../djvm/DeserializeCertificatesTest.kt | 6 +- .../djvm/DeserializeClassTest.kt | 4 +- .../djvm/DeserializeCollectionsTest.kt | 14 +- .../djvm/DeserializeComposedCustomDataTest.kt | 4 +- .../djvm/DeserializeCurrencyTest.kt | 2 +- .../djvm/DeserializeCustomGenericDataTest.kt | 4 +- .../djvm/DeserializeGenericsTest.kt | 12 +- .../djvm/DeserializeInputStreamTest.kt | 2 +- .../djvm/DeserializeInstantTest.kt | 2 +- ...rializeJavaWithMultipleConstructorsTest.kt | 2 +- .../djvm/DeserializeKotlinAliasTest.kt | 4 +- .../djvm/DeserializeLocalDateTest.kt | 2 +- .../djvm/DeserializeLocalDateTimeTest.kt | 2 +- .../djvm/DeserializeLocalTimeTest.kt | 2 +- .../serialization/djvm/DeserializeMapsTest.kt | 12 +- .../djvm/DeserializeMonthDayTest.kt | 2 +- .../djvm/DeserializeObjectArraysTest.kt | 20 +- .../djvm/DeserializeOffsetDateTimeTest.kt | 2 +- .../djvm/DeserializeOffsetTimeTest.kt | 2 +- .../DeserializeOpaqueBytesSubSequenceTest.kt | 2 +- .../djvm/DeserializeOptionalTest.kt | 4 +- .../djvm/DeserializePeriodTest.kt | 2 +- .../djvm/DeserializePrimitiveArraysTest.kt | 16 +- .../djvm/DeserializePrimitivesTest.kt | 8 +- .../djvm/DeserializeProtonJTest.kt | 16 +- .../djvm/DeserializePublicKeyTest.kt | 2 +- .../djvm/DeserializeStringBufferTest.kt | 2 +- .../djvm/DeserializeStringTest.kt | 4 +- .../DeserializeWithCustomSerializerTest.kt | 4 +- ...serializeWithObjectCustomSerializerTest.kt | 2 +- ...serializeWithSerializationWhitelistTest.kt | 4 +- .../djvm/DeserializeYearMonthTest.kt | 2 +- .../serialization/djvm/DeserializeYearTest.kt | 2 +- .../djvm/DeserializeZonedDateTimeTest.kt | 2 +- .../djvm/SafeDeserialisationTest.kt | 2 +- .../ContractAttachmentSerializerTest.kt | 20 +- .../internal/CordaClassResolverTests.kt | 96 ++-- .../internal/ListsSerializationTest.kt | 20 +- .../internal/MapsSerializationTest.kt | 24 +- .../internal/PrivateKeySerializationTest.kt | 8 +- .../internal/SerializationTokenTest.kt | 8 +- .../internal/SetsSerializationTest.kt | 16 +- .../internal/amqp/AMQPRemoteTypeModelTests.kt | 4 +- .../AbstractAMQPSerializationSchemeTest.kt | 4 +- .../amqp/CustomSerializerRegistryTests.kt | 16 +- .../amqp/DeserializeQueryableStateTest.kt | 4 +- .../internal/amqp/SerializationOutputTests.kt | 368 ++++++------- .../carpenter/SerDeserCarpentryTest.kt | 8 +- .../SerializationCompatibilityTests.kt | 4 +- .../internal/amqp/AMQPExceptionsTests.kt | 8 +- .../amqp/AMQPTypeIdentifierParserTests.kt | 40 +- .../internal/amqp/CorDappSerializerTests.kt | 36 +- .../amqp/DeserializeAndReturnEnvelopeTests.kt | 12 +- .../internal/amqp/DeserializeMapTests.kt | 36 +- .../DeserializeNeedingCarpentryOfEnumsTest.kt | 8 +- ...erializeNeedingCarpentrySimpleTypesTest.kt | 104 ++-- .../amqp/DeserializeNeedingCarpentryTests.kt | 36 +- .../amqp/DeserializeSimpleTypesTests.kt | 120 ++--- .../internal/amqp/EnumEvolvabilityTests.kt | 84 +-- .../internal/amqp/EnumEvolveTests.kt | 36 +- .../serialization/internal/amqp/EnumTests.kt | 32 +- .../internal/amqp/EnumTransformationTests.kt | 16 +- .../internal/amqp/ErrorMessagesTests.kt | 16 +- .../amqp/EvolutionSerializerFactoryTests.kt | 4 +- .../internal/amqp/EvolvabilityTests.kt | 92 ++-- .../internal/amqp/FingerPrinterTesting.kt | 8 +- .../internal/amqp/GenericsTests.kt | 84 +-- .../amqp/OptionalSerializationTests.kt | 8 +- .../internal/amqp/OverridePKSerializerTest.kt | 4 +- .../internal/amqp/PrivatePropertyTests.kt | 48 +- .../internal/amqp/RoundTripTests.kt | 40 +- .../amqp/SerializationPropertyOrdering.kt | 12 +- .../amqp/SerializeAndReturnSchemaTest.kt | 4 +- ...ticInitialisationOfSerializedObjectTest.kt | 12 +- .../internal/amqp/StreamTests.kt | 8 +- .../amqp/TypeModellingFingerPrinterTests.kt | 8 +- .../amqp/custom/OptionalSerializerTest.kt | 16 +- .../carpenter/CarpenterExceptionTests.kt | 8 +- .../internal/carpenter/ClassCarpenterTest.kt | 92 ++-- .../carpenter/ClassCarpenterWhitelistTest.kt | 16 +- ...berCompositeSchemaToClassCarpenterTests.kt | 24 +- .../internal/carpenter/EnumClassTests.kt | 24 +- .../InheritanceSchemaToClassCarpenterTests.kt | 36 +- ...berCompositeSchemaToClassCarpenterTests.kt | 16 +- .../model/ClassCarpentingTypeLoaderTests.kt | 4 +- .../internal/model/LocalTypeModelTests.kt | 28 +- .../internal/model/TypeIdentifierTests.kt | 20 +- .../net/corda/testing/driver/DriverTests.kt | 40 +- .../testing/node/FlowStackSnapshotTest.kt | 24 +- .../node/MockNetworkIntegrationTests.kt | 4 +- .../InternalMockNetworkIntegrationTests.kt | 4 +- .../node/internal/ProcessUtilitiesTests.kt | 4 +- .../net/corda/testing/node/MockNetworkTest.kt | 12 +- .../node/internal/CustomCordappTest.kt | 16 +- .../node/internal/InternalMockNetworkTests.kt | 16 +- .../node/internal/InternalTestUtilsTest.kt | 4 +- .../internal/TestResponseFlowInIsolation.kt | 4 +- .../testing/CliBackwardsCompatibleTest.kt | 4 +- .../CommandLineCompatibilityCheckerTest.kt | 20 +- .../CommonSerializationTestHelpers.kt | 16 +- .../testing/internal/db/GroupAMoreTests.kt | 4 +- .../corda/testing/internal/db/GroupATests.kt | 4 +- .../corda/testing/internal/db/GroupBTests.kt | 12 +- .../core/SerializationEnvironmentRule.kt | 2 +- .../CheckpointSerializationTestHelpers.kt | 2 +- .../InternalSerializationTestHelpers.kt | 4 +- .../net/corda/testing/TestIdentityTests.kt | 8 +- .../testing/core/JarSignatureCollectorTest.kt | 32 +- .../corda/testing/internal/MatcherTests.kt | 4 +- .../testing/internal/RigorousMockTest.kt | 24 +- .../corda/webserver/WebserverDriverTests.kt | 4 +- .../corda/blobinspector/BlobInspectorTest.kt | 16 +- .../NetworkBootstrapperRunnerTests.kt | 72 +-- .../corda/demobench/model/JVMConfigTest.kt | 20 +- .../corda/demobench/model/NodeConfigTest.kt | 16 +- .../demobench/model/NodeControllerTest.kt | 60 +-- .../net/corda/demobench/pty/ZeroFilterTest.kt | 16 +- .../corda/explorer/model/SettingsModelTest.kt | 4 +- .../explorer/views/GuiUtilitiesKtTest.kt | 4 +- .../shell/StandaloneShellArgsParserTest.kt | 16 +- .../tools/shell/HashLookupCommandTest.kt | 4 +- .../shell/InteractiveShellIntegrationTest.kt | 60 +-- .../net/corda/tools/shell/SSHServerTest.kt | 20 +- .../tools/shell/CustomTypeJsonParsingTests.kt | 12 +- .../corda/tools/shell/InteractiveShellTest.kt | 52 +- .../utilities/ANSIProgressRendererTest.kt | 12 +- .../net/corda/worldmap/CityDatabaseTest.kt | 4 +- 485 files changed, 5655 insertions(+), 5625 deletions(-) create mode 100644 .ci/Dockerfile diff --git a/.ci/Dockerfile b/.ci/Dockerfile new file mode 100644 index 0000000000..d87a8eee2e --- /dev/null +++ b/.ci/Dockerfile @@ -0,0 +1,3 @@ +FROM amazoncorretto:8u242 +RUN yum install -y shadow-utils +RUN useradd -m buildUser \ No newline at end of file diff --git a/client/jackson/src/test/kotlin/net/corda/client/jackson/AmountTest.kt b/client/jackson/src/test/kotlin/net/corda/client/jackson/AmountTest.kt index 967ef28df6..80b48e5e30 100644 --- a/client/jackson/src/test/kotlin/net/corda/client/jackson/AmountTest.kt +++ b/client/jackson/src/test/kotlin/net/corda/client/jackson/AmountTest.kt @@ -18,68 +18,68 @@ class AmountTest { private val yamlMapper: ObjectMapper = ObjectMapper(YAMLFactory()).registerModule(CordaModule()) } - @Test - fun `Amount(Currency) JSON deserialization`() { + @Test(timeout=300_000) + fun `Amount(Currency) JSON deserialization`() { val str = """{ "quantity": 100, "token": "USD" }""" val amount = jsonMapper.readValue>(str, object : TypeReference>() {}) assertThat(amount.quantity).isEqualTo(100) assertThat(amount.token).isEqualTo(Currency.getInstance("USD")) } - @Test - fun `Amount(Currency) YAML deserialization`() { + @Test(timeout=300_000) + fun `Amount(Currency) YAML deserialization`() { val str = """{ quantity: 100, token: USD }""" val amount = yamlMapper.readValue>(str, object : TypeReference>() {}) assertThat(amount.quantity).isEqualTo(100) assertThat(amount.token).isEqualTo(Currency.getInstance("USD")) } - @Test - fun `Amount(CarbonCredit) JSON deserialization`() { + @Test(timeout=300_000) + fun `Amount(CarbonCredit) JSON deserialization`() { val str = """{ "quantity": 200, "token": { "type": "CO2" } }""" val amount = jsonMapper.readValue>(str, object : TypeReference>() {}) assertThat(amount.quantity).isEqualTo(200) assertThat(amount.token).isEqualTo(CO2) } - @Test - fun `Amount(CarbonCredit) YAML deserialization`() { + @Test(timeout=300_000) + fun `Amount(CarbonCredit) YAML deserialization`() { val str = """{ quantity: 250, token: { type: CO2 } }""" val amount = yamlMapper.readValue>(str, object : TypeReference>() {}) assertThat(amount.quantity).isEqualTo(250) assertThat(amount.token).isEqualTo(CO2) } - @Test - fun `Amount(Unknown) JSON deserialization`() { + @Test(timeout=300_000) + fun `Amount(Unknown) JSON deserialization`() { val str = """{ "quantity": 100, "token": "USD" }""" val amount = jsonMapper.readValue>(str, object : TypeReference>() {}) assertThat(amount.quantity).isEqualTo(100) assertThat(amount.token).isEqualTo(Currency.getInstance("USD")) } - @Test - fun `Amount(Unknown) YAML deserialization`() { + @Test(timeout=300_000) + fun `Amount(Unknown) YAML deserialization`() { val str = """{ quantity: 100, token: USD }""" val amount = yamlMapper.readValue>(str, object : TypeReference>() {}) assertThat(amount.quantity).isEqualTo(100) assertThat(amount.token).isEqualTo(Currency.getInstance("USD")) } - @Test - fun `Amount(Currency) YAML serialization`() { + @Test(timeout=300_000) + fun `Amount(Currency) YAML serialization`() { assertThat(yamlMapper.valueToTree(Amount.parseCurrency("£25000000"))).isEqualTo(TextNode("25000000.00 GBP")) assertThat(yamlMapper.valueToTree(Amount.parseCurrency("$250000"))).isEqualTo(TextNode("250000.00 USD")) } - @Test - fun `Amount(CarbonCredit) JSON serialization`() { + @Test(timeout=300_000) + fun `Amount(CarbonCredit) JSON serialization`() { assertThat(jsonMapper.writeValueAsString(Amount(123456, CO2)).trim()) .isEqualTo(""""123456 CarbonCredit(type=CO2)"""") } - @Test - fun `Amount(CarbonCredit) YAML serialization`() { + @Test(timeout=300_000) + fun `Amount(CarbonCredit) YAML serialization`() { assertThat(yamlMapper.writeValueAsString(Amount(123456, CO2)).trim()) .isEqualTo("""--- "123456 CarbonCredit(type=CO2)"""") } diff --git a/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt b/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt index d65bc20d9c..bd554c73e9 100644 --- a/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt +++ b/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt @@ -107,14 +107,14 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: doReturn(attachments).whenever(services).attachments } - @Test - fun `Amount(Currency) serialization`() { + @Test(timeout=300_000) + fun `Amount(Currency) serialization`() { assertThat(mapper.valueToTree(Amount.parseCurrency("£25000000")).textValue()).isEqualTo("25000000.00 GBP") assertThat(mapper.valueToTree(Amount.parseCurrency("$250000")).textValue()).isEqualTo("250000.00 USD") } - @Test - fun `Amount(Currency) deserialization`() { + @Test(timeout=300_000) + fun `Amount(Currency) deserialization`() { val old = mapOf( "quantity" to 2500000000, "token" to "USD" @@ -122,13 +122,13 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue>(old)).isEqualTo(Amount(2_500_000_000, USD)) } - @Test - fun `Amount(Currency) Text deserialization`() { + @Test(timeout=300_000) + fun `Amount(Currency) Text deserialization`() { assertThat(mapper.convertValue>(TextNode("$25000000"))).isEqualTo(Amount(2_500_000_000, USD)) } - @Test - fun ByteSequence() { + @Test(timeout=300_000) + fun ByteSequence() { val byteSequence: ByteSequence = OpaqueBytes.of(1, 2, 3, 4).subSequence(0, 2) val json = mapper.valueToTree(byteSequence) assertThat(json.binaryValue()).containsExactly(1, 2) @@ -136,22 +136,22 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(byteSequence) } - @Test - fun `OpaqueBytes serialization`() { + @Test(timeout=300_000) + fun `OpaqueBytes serialization`() { val opaqueBytes = OpaqueBytes(secureRandomBytes(128)) val json = mapper.valueToTree(opaqueBytes) assertThat(json.binaryValue()).isEqualTo(opaqueBytes.bytes) assertThat(json.asText()).isEqualTo(opaqueBytes.bytes.toBase64()) } - @Test - fun `OpaqueBytes deserialization`() { + @Test(timeout=300_000) + fun `OpaqueBytes deserialization`() { assertThat(mapper.convertValue(TextNode("1234"))).isEqualTo(OpaqueBytes("1234".toByteArray(UTF_8))) assertThat(mapper.convertValue(BinaryNode(byteArrayOf(1, 2, 3, 4)))).isEqualTo(OpaqueBytes.of(1, 2, 3, 4)) } - @Test - fun SerializedBytes() { + @Test(timeout=300_000) + fun SerializedBytes() { val data = TestData(BOB_NAME, "Summary", SubTestData(1234)) val serializedBytes = data.serialize() val json = mapper.valueToTree(serializedBytes) @@ -168,8 +168,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: // @CordaSerializable // data class ClassNotOnClasspath(val name: CordaX500Name, val value: Int) - @Test - fun `SerializedBytes of class not on classpath`() { + @Test(timeout=300_000) + fun `SerializedBytes of class not on classpath`() { // The contents of the file were written out as follows: // ClassNotOnClasspath(BOB_NAME, 54321).serialize().open().copyTo("build" / "class-not-on-classpath-data") @@ -184,8 +184,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue>(BinaryNode(serializedBytes.bytes))).isEqualTo(serializedBytes) } - @Test - fun DigitalSignature() { + @Test(timeout=300_000) + fun DigitalSignature() { val digitalSignature = DigitalSignature(secureRandomBytes(128)) val json = mapper.valueToTree(digitalSignature) assertThat(json.binaryValue()).isEqualTo(digitalSignature.bytes) @@ -193,8 +193,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(digitalSignature) } - @Test - fun `DigitalSignature WithKey`() { + @Test(timeout=300_000) + fun `DigitalSignature WithKey`() { val digitalSignature = DigitalSignature.WithKey(BOB_PUBKEY, secureRandomBytes(128)) val json = mapper.valueToTree(digitalSignature) val (by, bytes) = json.assertHasOnlyFields("by", "bytes") @@ -203,8 +203,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(digitalSignature) } - @Test - fun DigitalSignatureWithCert() { + @Test(timeout=300_000) + fun DigitalSignatureWithCert() { val digitalSignature = DigitalSignatureWithCert(MINI_CORP.identity.certificate, secureRandomBytes(128)) val json = mapper.valueToTree(digitalSignature) val (by, bytes) = json.assertHasOnlyFields("by", "bytes", "parentCertsChain") @@ -213,8 +213,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(digitalSignature) } - @Test - fun TransactionSignature() { + @Test(timeout=300_000) + fun TransactionSignature() { val signatureMetadata = SignatureMetadata(1, 1) val partialMerkleTree = PartialMerkleTree(PartialTree.Node( left = PartialTree.Leaf(SecureHash.randomSHA256()), @@ -235,8 +235,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(transactionSignature) } - @Test - fun `SignedTransaction (WireTransaction)`() { + @Test(timeout=300_000) + fun `SignedTransaction (WireTransaction)`() { val attachmentId = SecureHash.randomSHA256() doReturn(attachmentId).whenever(cordappProvider).getContractAttachmentID(DummyContract.PROGRAM_ID) val attachmentStorage = rigorousMock() @@ -279,8 +279,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(stx) } - @Test - fun TransactionState() { + @Test(timeout=300_000) + fun TransactionState() { val txState = createTransactionState() val json = mapper.valueToTree(txState) println(mapper.writeValueAsString(json)) @@ -288,44 +288,44 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue>(json)).isEqualTo(txState) } - @Test - fun Command() { + @Test(timeout=300_000) + fun Command() { val command = Command(DummyCommandData, listOf(BOB_PUBKEY)) val json = mapper.valueToTree(command) assertThat(mapper.convertValue>(json)).isEqualTo(command) } - @Test - fun `TimeWindow - fromOnly`() { + @Test(timeout=300_000) + fun `TimeWindow - fromOnly`() { val fromOnly = TimeWindow.fromOnly(Instant.now()) val json = mapper.valueToTree(fromOnly) assertThat(mapper.convertValue(json)).isEqualTo(fromOnly) } - @Test - fun `TimeWindow - untilOnly`() { + @Test(timeout=300_000) + fun `TimeWindow - untilOnly`() { val untilOnly = TimeWindow.untilOnly(Instant.now()) val json = mapper.valueToTree(untilOnly) assertThat(mapper.convertValue(json)).isEqualTo(untilOnly) } - @Test - fun `TimeWindow - between`() { + @Test(timeout=300_000) + fun `TimeWindow - between`() { val between = TimeWindow.between(Instant.now(), Instant.now() + 1.days) val json = mapper.valueToTree(between) assertThat(mapper.convertValue(json)).isEqualTo(between) } - @Test - fun PrivacySalt() { + @Test(timeout=300_000) + fun PrivacySalt() { val privacySalt = net.corda.core.contracts.PrivacySalt() val json = mapper.valueToTree(privacySalt) assertThat(json.textValue()).isEqualTo(privacySalt.bytes.toHexString()) assertThat(mapper.convertValue(json)).isEqualTo(privacySalt) } - @Test - fun SignatureMetadata() { + @Test(timeout=300_000) + fun SignatureMetadata() { val signatureMetadata = SignatureMetadata(2, Crypto.ECDSA_SECP256R1_SHA256.schemeNumberID) val json = mapper.valueToTree(signatureMetadata) val (platformVersion, scheme) = json.assertHasOnlyFields("platformVersion", "scheme") @@ -334,44 +334,44 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(signatureMetadata) } - @Test - fun `SignatureMetadata on unknown schemeNumberID`() { + @Test(timeout=300_000) + fun `SignatureMetadata on unknown schemeNumberID`() { val signatureMetadata = SignatureMetadata(2, Int.MAX_VALUE) val json = mapper.valueToTree(signatureMetadata) assertThat(json["scheme"].intValue()).isEqualTo(Int.MAX_VALUE) assertThat(mapper.convertValue(json)).isEqualTo(signatureMetadata) } - @Test - fun `SignatureScheme serialization`() { + @Test(timeout=300_000) + fun `SignatureScheme serialization`() { val json = mapper.valueToTree(Crypto.ECDSA_SECP256R1_SHA256) assertThat(json.textValue()).isEqualTo("ECDSA_SECP256R1_SHA256") } - @Test - fun `SignatureScheme deserialization`() { + @Test(timeout=300_000) + fun `SignatureScheme deserialization`() { assertThat(mapper.convertValue(TextNode("EDDSA_ED25519_SHA512"))).isSameAs(Crypto.EDDSA_ED25519_SHA512) assertThat(mapper.convertValue(IntNode(4))).isSameAs(Crypto.EDDSA_ED25519_SHA512) } - @Test - fun `PartialTree IncludedLeaf`() { + @Test(timeout=300_000) + fun `PartialTree IncludedLeaf`() { val includedLeaf = PartialTree.IncludedLeaf(SecureHash.randomSHA256()) val json = mapper.valueToTree(includedLeaf) assertThat(json.assertHasOnlyFields("includedLeaf")[0].textValue()).isEqualTo(includedLeaf.hash.toString()) assertThat(mapper.convertValue(json)).isEqualTo(includedLeaf) } - @Test - fun `PartialTree Leaf`() { + @Test(timeout=300_000) + fun `PartialTree Leaf`() { val leaf = PartialTree.Leaf(SecureHash.randomSHA256()) val json = mapper.valueToTree(leaf) assertThat(json.assertHasOnlyFields("leaf")[0].textValue()).isEqualTo(leaf.hash.toString()) assertThat(mapper.convertValue(json)).isEqualTo(leaf) } - @Test - fun `simple PartialTree Node`() { + @Test(timeout=300_000) + fun `simple PartialTree Node`() { val node = PartialTree.Node( left = PartialTree.Leaf(SecureHash.randomSHA256()), right = PartialTree.IncludedLeaf(SecureHash.randomSHA256()) @@ -384,8 +384,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(node) } - @Test - fun `complex PartialTree Node`() { + @Test(timeout=300_000) + fun `complex PartialTree Node`() { val node = PartialTree.Node( left = PartialTree.IncludedLeaf(SecureHash.randomSHA256()), right = PartialTree.Node( @@ -401,8 +401,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: // TODO Issued // TODO PartyAndReference - @Test - fun CordaX500Name() { + @Test(timeout=300_000) + fun CordaX500Name() { testToStringSerialisation(CordaX500Name( commonName = "COMMON", organisationUnit = "ORG UNIT", @@ -413,42 +413,42 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: )) } - @Test - fun `SecureHash SHA256`() { + @Test(timeout=300_000) + fun `SecureHash SHA256`() { testToStringSerialisation(SecureHash.randomSHA256()) } - @Test - fun NetworkHostAndPort() { + @Test(timeout=300_000) + fun NetworkHostAndPort() { testToStringSerialisation(NetworkHostAndPort("localhost", 9090)) } - @Test - fun UUID() { + @Test(timeout=300_000) + fun UUID() { testToStringSerialisation(UUID.randomUUID()) } - @Test - fun Instant() { + @Test(timeout=300_000) + fun Instant() { testToStringSerialisation(Instant.now()) } - @Test - fun `Date is treated as Instant`() { + @Test(timeout=300_000) + fun `Date is treated as Instant`() { val date = Date() val json = mapper.valueToTree(date) assertThat(json.textValue()).isEqualTo(date.toInstant().toString()) assertThat(mapper.convertValue(json)).isEqualTo(date) } - @Test - fun `Party serialization`() { + @Test(timeout=300_000) + fun `Party serialization`() { val json = mapper.valueToTree(MINI_CORP.party) assertThat(json.textValue()).isEqualTo(MINI_CORP.name.toString()) } - @Test - fun `Party serialization with isFullParty = true`() { + @Test(timeout=300_000) + fun `Party serialization with isFullParty = true`() { partyObjectMapper.isFullParties = true val json = mapper.valueToTree(MINI_CORP.party) val (name, owningKey) = json.assertHasOnlyFields("name", "owningKey") @@ -456,8 +456,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(owningKey.valueAs(mapper)).isEqualTo(MINI_CORP.publicKey) } - @Test - fun `Party deserialization on full name`() { + @Test(timeout=300_000) + fun `Party deserialization on full name`() { fun convertToParty() = mapper.convertValue(TextNode(MINI_CORP.name.toString())) // Check that it fails if it can't find the party @@ -467,8 +467,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(convertToParty()).isEqualTo(MINI_CORP.party) } - @Test - fun `Party deserialization on part of name`() { + @Test(timeout=300_000) + fun `Party deserialization on part of name`() { fun convertToParty() = mapper.convertValue(TextNode(MINI_CORP.name.organisation)) // Check that it fails if it can't find the party @@ -478,8 +478,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(convertToParty()).isEqualTo(MINI_CORP.party) } - @Test - fun `Party deserialization on public key`() { + @Test(timeout=300_000) + fun `Party deserialization on public key`() { fun convertToParty() = mapper.convertValue(TextNode(MINI_CORP.publicKey.toBase58String())) // Check that it fails if it can't find the party @@ -489,8 +489,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(convertToParty()).isEqualTo(MINI_CORP.party) } - @Test - fun `Party deserialization on name and key`() { + @Test(timeout=300_000) + fun `Party deserialization on name and key`() { val party = mapper.convertValue(mapOf( "name" to MINI_CORP.name, "owningKey" to MINI_CORP.publicKey @@ -500,23 +500,23 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(party.owningKey).isEqualTo(MINI_CORP.publicKey) } - @Test - fun PublicKey() { + @Test(timeout=300_000) + fun PublicKey() { val json = mapper.valueToTree(MINI_CORP.publicKey) assertThat(json.textValue()).isEqualTo(MINI_CORP.publicKey.toBase58String()) assertThat(mapper.convertValue(json)).isEqualTo(MINI_CORP.publicKey) } - @Test - fun `EdDSA public key`() { + @Test(timeout=300_000) + fun `EdDSA public key`() { val publicKey = Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, SEED).public val json = mapper.valueToTree(publicKey) assertThat(json.textValue()).isEqualTo(publicKey.toBase58String()) assertThat(mapper.convertValue(json)).isEqualTo(publicKey) } - @Test - fun CompositeKey() { + @Test(timeout=300_000) + fun CompositeKey() { val innerKeys = (1..3).map { i -> Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, SEED + i.toBigInteger()).public } @@ -530,22 +530,22 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(publicKey) } - @Test - fun AnonymousParty() { + @Test(timeout=300_000) + fun AnonymousParty() { val anonymousParty = AnonymousParty(ALICE_PUBKEY) val json = mapper.valueToTree(anonymousParty) assertThat(json.textValue()).isEqualTo(ALICE_PUBKEY.toBase58String()) assertThat(mapper.convertValue(json)).isEqualTo(anonymousParty) } - @Test - fun `PartyAndCertificate serialization`() { + @Test(timeout=300_000) + fun `PartyAndCertificate serialization`() { val json = mapper.valueToTree(MINI_CORP.identity) assertThat(json.textValue()).isEqualTo(MINI_CORP.name.toString()) } - @Test - fun `PartyAndCertificate serialization with isFullParty = true`() { + @Test(timeout=300_000) + fun `PartyAndCertificate serialization with isFullParty = true`() { partyObjectMapper.isFullParties = true val json = mapper.valueToTree(MINI_CORP.identity) println(mapper.writeValueAsString(json)) @@ -554,16 +554,16 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(certPath.valueAs(mapper)).isEqualTo(MINI_CORP.identity.certPath) } - @Test - fun `PartyAndCertificate deserialization on cert path`() { + @Test(timeout=300_000) + fun `PartyAndCertificate deserialization on cert path`() { val certPathJson = mapper.valueToTree(MINI_CORP.identity.certPath) val partyAndCert = mapper.convertValue(mapOf("certPath" to certPathJson)) // PartyAndCertificate.equals is defined on the Party so we must check the certPath directly assertThat(partyAndCert.certPath).isEqualTo(MINI_CORP.identity.certPath) } - @Test - fun `NodeInfo serialization`() { + @Test(timeout=300_000) + fun `NodeInfo serialization`() { val (nodeInfo) = createNodeInfoAndSigned(ALICE_NAME) val json = mapper.valueToTree(nodeInfo) val (addresses, legalIdentitiesAndCerts, platformVersion, serial) = json.assertHasOnlyFields( @@ -584,8 +584,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(serial.longValue()).isEqualTo(nodeInfo.serial) } - @Test - fun `NodeInfo deserialization on name`() { + @Test(timeout=300_000) + fun `NodeInfo deserialization on name`() { val (nodeInfo) = createNodeInfoAndSigned(ALICE_NAME) fun convertToNodeInfo() = mapper.convertValue(TextNode(ALICE_NAME.toString())) @@ -597,8 +597,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(convertToNodeInfo()).isEqualTo(nodeInfo) } - @Test - fun `NodeInfo deserialization on public key`() { + @Test(timeout=300_000) + fun `NodeInfo deserialization on public key`() { val (nodeInfo) = createNodeInfoAndSigned(ALICE_NAME) fun convertToNodeInfo() = mapper.convertValue(TextNode(nodeInfo.legalIdentities[0].owningKey.toBase58String())) @@ -610,8 +610,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(convertToNodeInfo()).isEqualTo(nodeInfo) } - @Test - fun CertPath() { + @Test(timeout=300_000) + fun CertPath() { val certPath = MINI_CORP.identity.certPath val json = mapper.valueToTree(certPath) println(mapper.writeValueAsString(json)) @@ -624,8 +624,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json).encoded).isEqualTo(certPath.encoded) } - @Test - fun `X509Certificate serialization`() { + @Test(timeout=300_000) + fun `X509Certificate serialization`() { val cert: X509Certificate = MINI_CORP.identity.certificate val json = mapper.valueToTree(cert) println(mapper.writeValueAsString(json)) @@ -639,28 +639,28 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(json["encoded"].binaryValue()).isEqualTo(cert.encoded) } - @Test - fun `X509Certificate serialization when extendedKeyUsage is null`() { + @Test(timeout=300_000) + fun `X509Certificate serialization when extendedKeyUsage is null`() { val cert: X509Certificate = spy(MINI_CORP.identity.certificate) whenever(cert.extendedKeyUsage).thenReturn(null) // should work even if extendedKeyUsage is null mapper.valueToTree(cert) } - @Test - fun `X509Certificate deserialization`() { + @Test(timeout=300_000) + fun `X509Certificate deserialization`() { val cert: X509Certificate = MINI_CORP.identity.certificate assertThat(mapper.convertValue(mapOf("encoded" to cert.encoded))).isEqualTo(cert) assertThat(mapper.convertValue(BinaryNode(cert.encoded))).isEqualTo(cert) } - @Test - fun X500Principal() { + @Test(timeout=300_000) + fun X500Principal() { testToStringSerialisation(X500Principal("CN=Common,L=London,O=Org,C=UK")) } - @Test - fun `@CordaSerializable class which has non-c'tor properties`() { + @Test(timeout=300_000) + fun `@CordaSerializable class which has non-c'tor properties`() { val data = NonCtorPropertiesData(4434) val json = mapper.valueToTree(data) val (value) = json.assertHasOnlyFields("value") @@ -668,8 +668,8 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(data) } - @Test - fun `LinearState where the linearId property does not match the backing field`() { + @Test(timeout=300_000) + fun `LinearState where the linearId property does not match the backing field`() { val funkyLinearState = FunkyLinearState(UniqueIdentifier()) // As a sanity check, show that this is a valid CordaSerializable class assertThat(funkyLinearState.serialize().deserialize()).isEqualTo(funkyLinearState) @@ -677,14 +677,14 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory: assertThat(mapper.convertValue(json)).isEqualTo(funkyLinearState) } - @Test - fun `kotlin object`() { + @Test(timeout=300_000) + fun `kotlin object`() { val json = mapper.valueToTree(KotlinObject) assertThat(mapper.convertValue(json)).isSameAs(KotlinObject) } - @Test - fun `@CordaSerializable kotlin object`() { + @Test(timeout=300_000) + fun `@CordaSerializable kotlin object`() { val json = mapper.valueToTree(CordaSerializableKotlinObject) assertThat(mapper.convertValue(json)).isSameAs(CordaSerializableKotlinObject) } diff --git a/client/jackson/src/test/kotlin/net/corda/client/jackson/StateMachineRunIdTest.kt b/client/jackson/src/test/kotlin/net/corda/client/jackson/StateMachineRunIdTest.kt index e91f8fd870..493a278782 100644 --- a/client/jackson/src/test/kotlin/net/corda/client/jackson/StateMachineRunIdTest.kt +++ b/client/jackson/src/test/kotlin/net/corda/client/jackson/StateMachineRunIdTest.kt @@ -13,15 +13,15 @@ class StateMachineRunIdTest { private val jsonMapper: ObjectMapper = ObjectMapper().registerModule(CordaModule()) } - @Test - fun `state machine run ID deserialise`() { + @Test(timeout=300_000) + fun `state machine run ID deserialise`() { val str = """"$ID"""" val runID = jsonMapper.readValue(str, StateMachineRunId::class.java) assertEquals(StateMachineRunId(UUID.fromString(ID)), runID) } - @Test - fun `state machine run ID serialise`() { + @Test(timeout=300_000) + fun `state machine run ID serialise`() { val runId = StateMachineRunId(UUID.fromString(ID)) val str = jsonMapper.writeValueAsString(runId) assertEquals(""""$ID"""", str) diff --git a/client/jackson/src/test/kotlin/net/corda/client/jackson/StringToMethodCallParserTest.kt b/client/jackson/src/test/kotlin/net/corda/client/jackson/StringToMethodCallParserTest.kt index 650c018c48..0a105b6f5f 100644 --- a/client/jackson/src/test/kotlin/net/corda/client/jackson/StringToMethodCallParserTest.kt +++ b/client/jackson/src/test/kotlin/net/corda/client/jackson/StringToMethodCallParserTest.kt @@ -32,8 +32,8 @@ class StringToMethodCallParserTest { "overload a: A, b: B" to "AB" ) - @Test - fun calls() { + @Test(timeout=300_000) + fun calls() { val parser = StringToMethodCallParser(Target::class) val target = Target() for ((input, output) in tests) { @@ -45,8 +45,8 @@ class StringToMethodCallParserTest { * It would be unreasonable to expect "[ A, B, C ]" to deserialise as "Deque" by default. * Deque is chosen as we still expect it to preserve the order of its elements. */ - @Test - fun complexNestedGenericMethod() { + @Test(timeout=300_000) + fun complexNestedGenericMethod() { val parser = StringToMethodCallParser(Target::class) val result = parser.parse(Target(), "complexNestedObject pairs: { first: 101, second: [ A, B, C ] }").invoke() @@ -66,8 +66,8 @@ class StringToMethodCallParserTest { constructor(numbers: List) : this(numbers.map(Long::toString).joinToString("+"), numbers.size) } - @Test - fun ctor1() { + @Test(timeout=300_000) + fun ctor1() { val clazz = ConstructorTarget::class.java val parser = StringToMethodCallParser(clazz) val ctor = clazz.getDeclaredConstructor(String::class.java, Int::class.java) @@ -77,8 +77,8 @@ class StringToMethodCallParserTest { assertArrayEquals(arrayOf("Blah blah blah", 12), args) } - @Test - fun ctor2() { + @Test(timeout=300_000) + fun ctor2() { val clazz = ConstructorTarget::class.java val parser = StringToMethodCallParser(clazz) val ctor = clazz.getDeclaredConstructor(String::class.java) @@ -88,8 +88,8 @@ class StringToMethodCallParserTest { assertArrayEquals(arrayOf("Foo bar!"), args) } - @Test - fun constructorWithGenericArgs() { + @Test(timeout=300_000) + fun constructorWithGenericArgs() { val clazz = ConstructorTarget::class.java val ctor = clazz.getDeclaredConstructor(List::class.java) StringToMethodCallParser(clazz).apply { diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/model/ExchangeRateModelTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/model/ExchangeRateModelTest.kt index 8539c16820..99eb056c94 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/model/ExchangeRateModelTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/model/ExchangeRateModelTest.kt @@ -23,8 +23,8 @@ class ExchangeRateModelTest { } } - @Test - fun `perform fx testing`() { + @Test(timeout=300_000) + fun `perform fx testing`() { val tenSwissies = Amount(10, BigDecimal.ONE, CHF) assertEquals(instance.exchangeAmount(tenSwissies, CHF), tenSwissies) diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AggregatedListTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AggregatedListTest.kt index ec7ab0e7a8..075623f20e 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AggregatedListTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AggregatedListTest.kt @@ -20,8 +20,8 @@ class AggregatedListTest { replayedList = ReplayedList(aggregatedList) } - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { assertEquals(replayedList.size, 0) sourceList.add(9) @@ -43,8 +43,8 @@ class AggregatedListTest { } } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { sourceList.addAll(0, 1, 2, 3, 4) assertEquals(replayedList.size, 3) @@ -82,8 +82,8 @@ class AggregatedListTest { assertEquals(replayedList.size, 0) } - @Test - fun multipleElementsWithSameHashWorks() { + @Test(timeout=300_000) + fun multipleElementsWithSameHashWorks() { sourceList.addAll(0, 0) assertEquals(replayedList.size, 1) replayedList.forEach { diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AssociatedListTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AssociatedListTest.kt index 139d8a7b20..48f720d1d7 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AssociatedListTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/AssociatedListTest.kt @@ -20,8 +20,8 @@ class AssociatedListTest { replayedMap = ReplayedMap(associatedList) } - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { assertEquals(replayedMap.size, 1) assertEquals(replayedMap[0], 0) @@ -37,8 +37,8 @@ class AssociatedListTest { assertEquals(replayedMap[1], 4) } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { sourceList.addAll(2, 4) assertEquals(replayedMap.size, 3) @@ -57,8 +57,8 @@ class AssociatedListTest { assertEquals(replayedMap.size, 0) } - @Test - fun updateWorks() { + @Test(timeout=300_000) + fun updateWorks() { sourceList.addAll(2, 4) assertEquals(replayedMap.size, 3) diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ConcatenatedListTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ConcatenatedListTest.kt index 3b69bea90d..9a20527b29 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ConcatenatedListTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ConcatenatedListTest.kt @@ -42,8 +42,8 @@ class ConcatenatedListTest { } } - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { concatenatedList.checkInvariants() assertEquals(replayedList.size, 1) assertEquals(replayedList[0], "hello") @@ -85,8 +85,8 @@ class ConcatenatedListTest { assertEquals(replayedList[6], "b") } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { sourceList.add(FXCollections.observableArrayList("a", "b")) sourceList.add(1, FXCollections.observableArrayList("c")) sourceList[0].addAll("d", "e") @@ -113,8 +113,8 @@ class ConcatenatedListTest { assertEquals(replayedList[0], "b") } - @Test - fun permutationWorks() { + @Test(timeout=300_000) + fun permutationWorks() { sourceList.addAll(FXCollections.observableArrayList("a", "b"), FXCollections.observableArrayList("c")) concatenatedList.checkInvariants() assertEquals(replayedList.size, 4) diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/FlattenedListTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/FlattenedListTest.kt index 5059c2078c..b52523148f 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/FlattenedListTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/FlattenedListTest.kt @@ -21,8 +21,8 @@ class FlattenedListTest { replayedList = ReplayedList(flattenedList) } - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { assertEquals(replayedList.size, 1) assertEquals(replayedList[0], 1234) @@ -54,8 +54,8 @@ class FlattenedListTest { assertEquals(replayedList[5], 34) } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { val firstRemoved = sourceList.removeAt(0) assertEquals(firstRemoved.get(), 1234) assertEquals(replayedList.size, 0) @@ -76,8 +76,8 @@ class FlattenedListTest { assertEquals(replayedList.size, 0) } - @Test - fun updatingObservableWorks() { + @Test(timeout=300_000) + fun updatingObservableWorks() { assertEquals(replayedList[0], 1234) sourceList[0].set(4321) assertEquals(replayedList[0], 4321) @@ -92,8 +92,8 @@ class FlattenedListTest { assertEquals(replayedList[1], 8765) } - @Test - fun reusingObservableWorks() { + @Test(timeout=300_000) + fun reusingObservableWorks() { val observable = SimpleObjectProperty(12) sourceList.add(observable) sourceList.add(observable) diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/LeftOuterJoinedMapTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/LeftOuterJoinedMapTest.kt index 5a1d8c2937..aeee169a0c 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/LeftOuterJoinedMapTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/LeftOuterJoinedMapTest.kt @@ -26,8 +26,8 @@ class LeftOuterJoinedMapTest { } // TODO perhaps these are too brittle because they test indices that are not stable. Use Expect dsl? - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { assertEquals(replayedList.size, 1) assertEquals(replayedList[0].first.name, "Alice") assertEquals(replayedList[0].second.size, 0) @@ -73,8 +73,8 @@ class LeftOuterJoinedMapTest { } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { dogs.add(Dog("Scooby", owner = "Alice")) people.add(Person("Bob", 34)) dogs.add(Dog("Bella", owner = "Bob")) diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/MappedListTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/MappedListTest.kt index 88eedf1cd9..a7050084a0 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/MappedListTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/MappedListTest.kt @@ -19,8 +19,8 @@ class MappedListTest { replayedList = ReplayedList(mappedList) } - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { assertEquals(replayedList.size, 1) assertEquals(replayedList[0], 5) @@ -36,8 +36,8 @@ class MappedListTest { assertEquals(replayedList[2], 3) } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { sourceList.add("Bob") sourceList.add(0, "Charlie") assertEquals(replayedList.size, 3) @@ -48,8 +48,8 @@ class MappedListTest { assertEquals(replayedList[1], 3) } - @Test - fun permuteWorks() { + @Test(timeout=300_000) + fun permuteWorks() { sourceList.add("Bob") sourceList.add(0, "Charlie") diff --git a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ReplayedListTest.kt b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ReplayedListTest.kt index b645221788..b2979a41e9 100644 --- a/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ReplayedListTest.kt +++ b/client/jfx/src/test/kotlin/net/corda/client/jfx/utils/ReplayedListTest.kt @@ -17,8 +17,8 @@ class ReplayedListTest { replayedList = ReplayedList(sourceList) } - @Test - fun addWorks() { + @Test(timeout=300_000) + fun addWorks() { assertEquals(replayedList.size, 1) assertEquals(replayedList[0], 1234) @@ -50,8 +50,8 @@ class ReplayedListTest { assertEquals(replayedList[5], 34) } - @Test - fun removeWorks() { + @Test(timeout=300_000) + fun removeWorks() { val firstRemoved = sourceList.removeAt(0) assertEquals(firstRemoved, 1234) assertEquals(replayedList.size, 0) @@ -70,8 +70,8 @@ class ReplayedListTest { assertEquals(replayedList.size, 0) } - @Test - fun updateWorks() { + @Test(timeout=300_000) + fun updateWorks() { assertEquals(replayedList[0], 1234) sourceList[0] = 4321 assertEquals(replayedList[0], 4321) diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt index eaff1800f8..8e3b4f9a5a 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/BlacklistKotlinClosureTest.kt @@ -28,8 +28,8 @@ class BlacklistKotlinClosureTest { @CordaSerializable data class Packet(val x: () -> Long) - @Test - fun `closure sent via RPC`() { + @Test(timeout=300_000) + fun `closure sent via RPC`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val rpc = startNode(providedName = ALICE_NAME).getOrThrow().rpc val packet = Packet { EVIL } diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt index c550709767..8777d76303 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt @@ -73,27 +73,27 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries = connection?.close() } - @Test - fun `log in with valid username and password`() { + @Test(timeout=300_000) + fun `log in with valid username and password`() { login(rpcUser.username, rpcUser.password) } - @Test - fun `log in with unknown user`() { + @Test(timeout=300_000) + fun `log in with unknown user`() { assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy { login(random63BitValue().toString(), rpcUser.password) } } - @Test - fun `log in with incorrect password`() { + @Test(timeout=300_000) + fun `log in with incorrect password`() { assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy { login(rpcUser.username, random63BitValue().toString()) } } - @Test - fun `shutdown command stops the node`() { + @Test(timeout=300_000) + fun `shutdown command stops the node`() { val nodeIsShut: PublishSubject = PublishSubject.create() val latch = CountDownLatch(1) var successful = false @@ -149,8 +149,8 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries = } } - @Test - fun `close-send deadlock and premature shutdown on empty observable`() { + @Test(timeout=300_000) + fun `close-send deadlock and premature shutdown on empty observable`() { println("Starting client") login(rpcUser.username, rpcUser.password) println("Creating proxy") @@ -165,16 +165,16 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries = println("Result: ${flowHandle.returnValue.getOrThrow()}") } - @Test - fun `check basic flow has no progress`() { + @Test(timeout=300_000) + fun `check basic flow has no progress`() { login(rpcUser.username, rpcUser.password) connection!!.proxy.startFlow(::CashPaymentFlow, 100.DOLLARS, identity).use { assertFalse(it is FlowProgressHandle<*>) } } - @Test - fun `get cash balances`() { + @Test(timeout=300_000) + fun `get cash balances`() { login(rpcUser.username, rpcUser.password) val proxy = connection!!.proxy val startCash = proxy.getCashBalances() @@ -191,8 +191,8 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries = assertEquals(123.DOLLARS, cashDollars) } - @Test - fun `flow initiator via RPC`() { + @Test(timeout=300_000) + fun `flow initiator via RPC`() { val externalTrace = Trace.newInstance() val impersonatedActor = Actor(Actor.Id("Mark Dadada"), AuthServiceId("Test"), owningLegalIdentity = BOB_NAME) login(rpcUser.username, rpcUser.password, externalTrace, impersonatedActor) @@ -230,8 +230,8 @@ class CordaRPCClientTest : NodeBasedTest(listOf("net.corda.finance"), notaries = // We run the client in a separate process, without the finance module on its system classpath to ensure that the // additional class loader that we give it is used. Cash.State objects are used as they can't be synthesised fully // by the carpenter, and thus avoiding any false-positive results. - @Test - fun `additional class loader used by WireTransaction when it deserialises its components`() { + @Test(timeout=300_000) + fun `additional class loader used by WireTransaction when it deserialises its components`() { val financeLocation = Cash::class.java.location.toPath().toString() val classPathWithoutFinance = ProcessUtilities.defaultClassPath.filter { financeLocation !in it } diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt index f0bf3df4e7..8084484735 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt @@ -27,8 +27,8 @@ class FlowsExecutionModeTests : NodeBasedTest(emptyList()) { client = CordaRPCClient(node.node.configuration.rpcOptions.address) } - @Test - fun `flows draining mode can be enabled and queried`() { + @Test(timeout=300_000) + fun `flows draining mode can be enabled and queried`() { asALoggerUser { rpcOps -> val newValue = true rpcOps.setFlowsDrainingModeEnabled(true) @@ -39,8 +39,8 @@ class FlowsExecutionModeTests : NodeBasedTest(emptyList()) { } } - @Test - fun `flows draining mode can be disabled and queried`() { + @Test(timeout=300_000) + fun `flows draining mode can be disabled and queried`() { asALoggerUser { rpcOps -> rpcOps.setFlowsDrainingModeEnabled(true) val newValue = false @@ -52,8 +52,8 @@ class FlowsExecutionModeTests : NodeBasedTest(emptyList()) { } } - @Test - fun `node starts with flows draining mode disabled`() { + @Test(timeout=300_000) + fun `node starts with flows draining mode disabled`() { asALoggerUser { rpcOps -> val defaultStartingMode = rpcOps.isFlowsDrainingModeEnabled() diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCMultipleInterfacesTests.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCMultipleInterfacesTests.kt index 407657bfb4..9971b2dcf4 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCMultipleInterfacesTests.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCMultipleInterfacesTests.kt @@ -64,8 +64,8 @@ class RPCMultipleInterfacesTests { interface ImaginaryFriend : RPCOps - @Test - fun `can talk multiple interfaces`() { + @Test(timeout=300_000) + fun `can talk multiple interfaces`() { rpcDriver { val server = startRpcServer(listOps = listOf(IntRPCOpsImpl(), StringRPCOpsImpl, MyCordaRpcOpsImpl)).get() diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt index bb45162494..b0c80244fa 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt @@ -83,8 +83,8 @@ class RPCStabilityTests { }.get() } - @Test - fun `client and server dont leak threads`() { + @Test(timeout=300_000) + fun `client and server dont leak threads`() { fun startAndStop() { rpcDriver { val server = startRpcServer(ops = DummyOps).get() @@ -115,8 +115,8 @@ class RPCStabilityTests { } } - @Test - fun `client doesnt leak threads when it fails to start`() { + @Test(timeout=300_000) + fun `client doesnt leak threads when it fails to start`() { fun startAndStop() { rpcDriver { Try.on { startRpcClient(NetworkHostAndPort("localhost", 9999)).get() } @@ -142,8 +142,8 @@ class RPCStabilityTests { } } - @Test - fun `rpc server close doesnt leak broker resources`() { + @Test(timeout=300_000) + fun `rpc server close doesnt leak broker resources`() { rpcDriver { fun startAndCloseServer(broker: RpcBrokerHandle) { startRpcServerWithBrokerRunning( @@ -165,8 +165,8 @@ class RPCStabilityTests { } } - @Test - fun `rpc client close doesnt leak broker resources`() { + @Test(timeout=300_000) + fun `rpc client close doesnt leak broker resources`() { rpcDriver { val server = startRpcServer(configuration = RPCServerConfiguration.DEFAULT, ops = DummyOps).get() RPCClient(server.broker.hostAndPort!!).start(RPCOps::class.java, rpcTestUser.username, rpcTestUser.password).close() @@ -181,8 +181,8 @@ class RPCStabilityTests { } } - @Test - fun `rpc server close is idempotent`() { + @Test(timeout=300_000) + fun `rpc server close is idempotent`() { rpcDriver { val server = startRpcServer(ops = DummyOps).get() repeat(10) { @@ -191,8 +191,8 @@ class RPCStabilityTests { } } - @Test - fun `rpc client close is idempotent`() { + @Test(timeout=300_000) + fun `rpc client close is idempotent`() { rpcDriver { val serverShutdown = shutdownManager.follower() val server = startRpcServer(ops = DummyOps).get() @@ -215,8 +215,8 @@ class RPCStabilityTests { fun leakObservable(): Observable } - @Test - fun `client cleans up leaked observables`() { + @Test(timeout=300_000) + fun `client cleans up leaked observables`() { rpcDriver { val leakObservableOpsImpl = object : LeakObservableOps { val leakedUnsubscribedCount = AtomicInteger(0) @@ -247,8 +247,8 @@ class RPCStabilityTests { fun ping(): String } - @Test - fun `client reconnects to rebooted server`() { + @Test(timeout=300_000) + fun `client reconnects to rebooted server`() { rpcDriver { val ops = object : ReconnectOps { override val protocolVersion = 1000 @@ -274,8 +274,8 @@ class RPCStabilityTests { } } - @Test - fun `connection failover fails, rpc calls throw`() { + @Test(timeout=300_000) + fun `connection failover fails, rpc calls throw`() { rpcDriver { val ops = object : ReconnectOps { override val protocolVersion = 1000 @@ -301,8 +301,8 @@ class RPCStabilityTests { } } - @Test - fun `connection exits when bad config means the exception is unrecoverable`() { + @Test(timeout=300_000) + fun `connection exits when bad config means the exception is unrecoverable`() { rpcDriver { val ops = object : ReconnectOps { override val protocolVersion = 1000 @@ -330,8 +330,8 @@ class RPCStabilityTests { fun subscribe(): Observable } - @Test - fun `observables error when connection breaks`() { + @Test(timeout=300_000) + fun `observables error when connection breaks`() { rpcDriver { val ops = object : NoOps { override val protocolVersion = 1000 @@ -371,8 +371,8 @@ class RPCStabilityTests { } } - @Test - fun `client throws RPCException after initial connection attempt fails`() { + @Test(timeout=300_000) + fun `client throws RPCException after initial connection attempt fails`() { val client = CordaRPCClient(portAllocation.nextHostAndPort()) var exceptionMessage: String? = null try { @@ -390,8 +390,8 @@ class RPCStabilityTests { fun serverId(): String } - @Test - fun `client connects to first available server`() { + @Test(timeout=300_000) + fun `client connects to first available server`() { rpcDriver { val ops = object : ServerOps { override val protocolVersion = 1000 @@ -411,8 +411,8 @@ class RPCStabilityTests { } } - @Test - fun `3 server failover`() { + @Test(timeout=300_000) + fun `3 server failover`() { rpcDriver { val ops1 = object : ServerOps { override val protocolVersion = 1000 @@ -483,8 +483,8 @@ class RPCStabilityTests { /** * In this test we create a number of out of process RPC clients that call [TrackSubscriberOps.subscribe] in a loop. */ - @Test - fun `server cleans up queues after disconnected clients`() { + @Test(timeout=300_000) + fun `server cleans up queues after disconnected clients`() { rpcDriver { val trackSubscriberOpsImpl = object : TrackSubscriberOps { override val protocolVersion = 1000 @@ -538,8 +538,8 @@ class RPCStabilityTests { } } - @Test - @Ignore // TODO: This is ignored because Artemis slow consumers are broken. I'm not deleting it in case we can get the feature fixed. + @Test(timeout=300_000) +@Ignore // TODO: This is ignored because Artemis slow consumers are broken. I'm not deleting it in case we can get the feature fixed. fun `slow consumers are kicked`() { rpcDriver { val server = startRpcServer(maxBufferedBytesPerClient = 10 * 1024 * 1024, ops = SlowConsumerRPCOpsImpl()).get() @@ -576,8 +576,8 @@ class RPCStabilityTests { } } - @Test - fun `deduplication in the server`() { + @Test(timeout=300_000) + fun `deduplication in the server`() { rpcDriver { val server = startRpcServer(ops = SlowConsumerRPCOpsImpl()).getOrThrow() @@ -617,8 +617,8 @@ class RPCStabilityTests { } } - @Test - fun `deduplication in the client`() { + @Test(timeout=300_000) + fun `deduplication in the client`() { rpcDriver { val broker = startRpcBroker().getOrThrow() diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RpcCustomSerializersTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RpcCustomSerializersTest.kt index 64c5e8f848..a66052e814 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RpcCustomSerializersTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RpcCustomSerializersTest.kt @@ -28,8 +28,8 @@ import java.io.NotSerializableException class RpcCustomSerializersTest { - @Test - fun `when custom serializers are not provided, the classpath is scanned to identify any existing ones`() { + @Test(timeout=300_000) + fun `when custom serializers are not provided, the classpath is scanned to identify any existing ones`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val server = startNode(providedName = ALICE_NAME).get() @@ -43,8 +43,8 @@ class RpcCustomSerializersTest { } } - @Test - fun `when an empty set of custom serializers is provided, no scanning is performed and this empty set is used instead`() { + @Test(timeout=300_000) + fun `when an empty set of custom serializers is provided, no scanning is performed and this empty set is used instead`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val server = startNode(providedName = ALICE_NAME).get() @@ -57,8 +57,8 @@ class RpcCustomSerializersTest { } } - @Test - fun `when a set of custom serializers is explicitly provided, these are used instead of scanning the classpath`() { + @Test(timeout=300_000) + fun `when a set of custom serializers is explicitly provided, these are used instead of scanning the classpath`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptyList())) { val server = startNode(providedName = ALICE_NAME).get() diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpcreconnect/CordaRPCClientReconnectionTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpcreconnect/CordaRPCClientReconnectionTest.kt index 102cce51dc..18e4f878cb 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpcreconnect/CordaRPCClientReconnectionTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpcreconnect/CordaRPCClientReconnectionTest.kt @@ -48,7 +48,7 @@ class CordaRPCClientReconnectionTest { val rpcUser = User("user1", "test", permissions = setOf(Permissions.all())) } - @Test + @Test(timeout=300_000) fun `rpc client calls and returned observables continue working when the server crashes and restarts`() { driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) { val latch = CountDownLatch(2) @@ -86,7 +86,7 @@ class CordaRPCClientReconnectionTest { } } - @Test + @Test(timeout=300_000) fun `a client can successfully unsubscribe a reconnecting observable`() { driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) { val latch = CountDownLatch(2) @@ -124,7 +124,7 @@ class CordaRPCClientReconnectionTest { } } - @Test + @Test(timeout=300_000) fun `rpc client calls and returned observables continue working when there is failover between servers`() { driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) { val latch = CountDownLatch(2) @@ -163,7 +163,7 @@ class CordaRPCClientReconnectionTest { } } - @Test + @Test(timeout=300_000) fun `an RPC call fails, when the maximum number of attempts is exceeded`() { driver(DriverParameters(cordappsForAllNodes = emptyList())) { val address = NetworkHostAndPort("localhost", portAllocator.nextPort()) @@ -191,7 +191,7 @@ class CordaRPCClientReconnectionTest { } } - @Test(timeout = 60_000) + @Test(timeout=300_000) fun `establishing an RPC connection fails if there is no node listening to the specified address`() { rpcDriver { assertThatThrownBy { @@ -202,7 +202,7 @@ class CordaRPCClientReconnectionTest { } } - @Test(timeout = 120_000) + @Test(timeout=300_000) fun `RPC connection can be shut down after being disconnected from the node`() { driver(DriverParameters(cordappsForAllNodes = emptyList())) { val address = NetworkHostAndPort("localhost", portAllocator.nextPort()) @@ -232,7 +232,7 @@ class CordaRPCClientReconnectionTest { } } - @Test + @Test(timeout=300_000) fun `RPC connection stops reconnecting after config number of retries`() { driver(DriverParameters(cordappsForAllNodes = emptyList())) { val address = NetworkHostAndPort("localhost", portAllocator.nextPort()) diff --git a/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt b/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt index 7cd3d6ac46..10d23f6cc4 100644 --- a/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt +++ b/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt @@ -92,8 +92,8 @@ class StandaloneCordaRPClientTest { } - @Test - fun `test attachments`() { + @Test(timeout=300_000) + fun `test attachments`() { val attachment = InputStreamAndHash.createInMemoryTestZip(attachmentSize, 1) assertFalse(rpcProxy.attachmentExists(attachment.sha256)) val id = attachment.inputStream.use { rpcProxy.uploadAttachment(it) } @@ -107,8 +107,8 @@ class StandaloneCordaRPClientTest { } @Ignore("CORDA-1520 - After switching from Kryo to AMQP this test won't work") - @Test - fun `test wrapped attachments`() { + @Test(timeout=300_000) + fun `test wrapped attachments`() { val attachment = InputStreamAndHash.createInMemoryTestZip(attachmentSize, 1) assertFalse(rpcProxy.attachmentExists(attachment.sha256)) val id = WrapperStream(attachment.inputStream).use { rpcProxy.uploadAttachment(it) } @@ -121,14 +121,14 @@ class StandaloneCordaRPClientTest { assertEquals(attachment.sha256, hash) } - @Test - fun `test starting flow`() { + @Test(timeout=300_000) + fun `test starting flow`() { rpcProxy.startFlow(::CashIssueFlow, 127.POUNDS, OpaqueBytes.of(0), notaryNodeIdentity) .returnValue.getOrThrow(timeout) } - @Test - fun `test starting tracked flow`() { + @Test(timeout=300_000) + fun `test starting tracked flow`() { var trackCount = 0 val handle = rpcProxy.startTrackedFlow( ::CashIssueFlow, 429.DOLLARS, OpaqueBytes.of(0), notaryNodeIdentity @@ -144,13 +144,13 @@ class StandaloneCordaRPClientTest { assertNotEquals(0, trackCount) } - @Test - fun `test network map`() { + @Test(timeout=300_000) + fun `test network map`() { assertEquals(notaryConfig.legalName, notaryNodeIdentity.name) } - @Test - fun `test state machines`() { + @Test(timeout=300_000) + fun `test state machines`() { val (stateMachines, updates) = rpcProxy.stateMachinesFeed() assertEquals(0, stateMachines.size) @@ -171,8 +171,8 @@ class StandaloneCordaRPClientTest { assertEquals(1, updateCount.get()) } - @Test - fun `test vault track by`() { + @Test(timeout=300_000) + fun `test vault track by`() { val (vault, vaultUpdates) = rpcProxy.vaultTrackBy(paging = PageSpecification(DEFAULT_PAGE_NUM)) assertEquals(0, vault.totalStatesAvailable) @@ -194,8 +194,8 @@ class StandaloneCordaRPClientTest { assertEquals(629.POUNDS, cashBalance[Currency.getInstance("GBP")]) } - @Test - fun `test vault query by`() { + @Test(timeout=300_000) + fun `test vault query by`() { // Now issue some cash rpcProxy.startFlow(::CashIssueFlow, 629.POUNDS, OpaqueBytes.of(0), notaryNodeIdentity) .returnValue.getOrThrow(timeout) @@ -220,8 +220,8 @@ class StandaloneCordaRPClientTest { assertEquals(629.POUNDS, cashBalances[Currency.getInstance("GBP")]) } - @Test - fun `test cash balances`() { + @Test(timeout=300_000) + fun `test cash balances`() { val startCash = rpcProxy.getCashBalances() println(startCash) assertTrue(startCash.isEmpty(), "Should not start with any cash") @@ -235,8 +235,8 @@ class StandaloneCordaRPClientTest { assertEquals(629.DOLLARS, balance) } - @Test - fun `test kill flow without killFlow permission`() { + @Test(timeout=300_000) + fun `test kill flow without killFlow permission`() { exception.expect(PermissionException::class.java) exception.expectMessage("User not authorized to perform RPC call killFlow") @@ -247,8 +247,8 @@ class StandaloneCordaRPClientTest { } } - @Test - fun `test kill flow with killFlow permission`() { + @Test(timeout=300_000) + fun `test kill flow with killFlow permission`() { val flowHandle = rpcProxy.startFlow(::CashIssueFlow, 83.DOLLARS, OpaqueBytes.of(0), notaryNodeIdentity) notary.connect(rpcUser).use { connection -> val rpcProxy = connection.proxy diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/ClientRPCInfrastructureTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/ClientRPCInfrastructureTests.kt index 431cb23038..dcad725609 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/ClientRPCInfrastructureTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/ClientRPCInfrastructureTests.kt @@ -72,8 +72,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() { override fun captureUser(): String = rpcContext().invocation.principal().name } - @Test - fun `simple RPCs`() { + @Test(timeout=300_000) + fun `simple RPCs`() { rpcDriver { val proxy = testProxy() // Does nothing, doesn't throw. @@ -88,8 +88,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() { } } - @Test - fun `simple observable`() { + @Test(timeout=300_000) + fun `simple observable`() { rpcDriver { val proxy = testProxy() // This tests that the observations are transmitted correctly, also completion is transmitted. @@ -98,8 +98,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() { } } - @Test - fun `complex observables`() { + @Test(timeout=300_000) + fun `complex observables`() { rpcDriver { val proxy = testProxy() // This checks that we can return an object graph with complex usage of observables, like an observable @@ -143,8 +143,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() { } } - @Test - fun `simple ListenableFuture`() { + @Test(timeout=300_000) + fun `simple ListenableFuture`() { rpcDriver { val proxy = testProxy() val value = proxy.makeListenableFuture().getOrThrow() @@ -152,8 +152,8 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() { } } - @Test - fun `complex ListenableFuture`() { + @Test(timeout=300_000) + fun `complex ListenableFuture`() { rpcDriver { val proxy = testProxy() val serverQuote = openFuture>>() @@ -180,16 +180,16 @@ class ClientRPCInfrastructureTests : AbstractRPCTest() { } } - @Test - fun versioning() { + @Test(timeout=300_000) + fun versioning() { rpcDriver { val proxy = testProxy() assertFailsWith { proxy.addedLater() } } } - @Test - fun `authenticated user is available to RPC`() { + @Test(timeout=300_000) + fun `authenticated user is available to RPC`() { rpcDriver { val proxy = testProxy() assertThat(proxy.captureUser()).isEqualTo(rpcTestUser.username) diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt index b660ba8ba2..01514e12d3 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt @@ -104,8 +104,8 @@ class RPCConcurrencyTests : AbstractRPCTest() { pool.shutdown() } - @Test - fun `call multiple RPCs in parallel`() { + @Test(timeout=300_000) + fun `call multiple RPCs in parallel`() { rpcDriver { val proxy = testProxy() val numberOfBlockedCalls = 2 @@ -140,8 +140,8 @@ class RPCConcurrencyTests : AbstractRPCTest() { } } - @Test - fun `nested immediate observables sequence correctly`() { + @Test(timeout=300_000) + fun `nested immediate observables sequence correctly`() { rpcDriver { // We construct a rose tree of immediate Observables and check that parent observations arrive before children. val proxy = testProxy() @@ -164,8 +164,8 @@ class RPCConcurrencyTests : AbstractRPCTest() { } } - @Test - fun `parallel nested observables`() { + @Test(timeout=300_000) + fun `parallel nested observables`() { rpcDriver { val proxy = testProxy() val treeDepth = 2 diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCFailureTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCFailureTests.kt index f294d68587..2bb907b44d 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCFailureTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCFailureTests.kt @@ -46,28 +46,28 @@ class RPCFailureTests { proc(startRpcClient(server.broker.hostAndPort!!).getOrThrow()) } - @Test - fun `kotlin NPE`() = rpc { + @Test(timeout=300_000) + fun `kotlin NPE`() = rpc { assertThatThrownBy { it.kotlinNPE() }.isInstanceOf(CordaRuntimeException::class.java) .hasMessageContaining("kotlin.KotlinNullPointerException") } - @Test - fun `kotlin NPE async`() = rpc { + @Test(timeout=300_000) + fun `kotlin NPE async`() = rpc { val future = it.kotlinNPEAsync() assertThatThrownBy { future.getOrThrow() }.isInstanceOf(CordaRuntimeException::class.java) .hasMessageContaining("kotlin.KotlinNullPointerException") } - @Test - fun unserializable() = rpc { + @Test(timeout=300_000) + fun unserializable() = rpc { assertThatThrownBy { it.getUnserializable() }.isInstanceOf(CordaRuntimeException::class.java) .hasMessageContaining("java.io.NotSerializableException:") .hasMessageContaining("Unserializable\" is not on the whitelist or annotated with @CordaSerializable.") } - @Test - fun `unserializable async`() = rpc { + @Test(timeout=300_000) + fun `unserializable async`() = rpc { val future = it.getUnserializableAsync() assertThatThrownBy { future.getOrThrow() }.isInstanceOf(CordaRuntimeException::class.java) .hasMessageContaining("java.io.NotSerializableException:") diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCHighThroughputObservableTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCHighThroughputObservableTests.kt index 4f3a09d507..2054729616 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCHighThroughputObservableTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCHighThroughputObservableTests.kt @@ -29,8 +29,8 @@ class RPCHighThroughputObservableTests : AbstractRPCTest() { override fun makeObservable(): Observable = Observable.interval(0, TimeUnit.MICROSECONDS).map { it.toInt() + 1 } } - @Test - fun `simple observable`() { + @Test(timeout=300_000) + fun `simple observable`() { rpcDriver { val proxy = testProxy() // This tests that the observations are transmitted correctly, also check that server side doesn't try to serialize the whole lot diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt index 3826f6189b..e1a0b3e853 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt @@ -76,8 +76,8 @@ class RPCPerformanceTests : AbstractRPCTest() { val Mbps: Double ) - @Test - fun `measure Megabytes per second for simple RPCs`() { + @Test(timeout=300_000) + fun `measure Megabytes per second for simple RPCs`() { warmup() val inputOutputSizes = listOf(1024, 4096, 100 * 1024) val overallTraffic = 512 * 1024 * 1024L @@ -118,8 +118,8 @@ class RPCPerformanceTests : AbstractRPCTest() { /** * Runs 20k RPCs per second for two minutes and publishes relevant stats to JMX. */ - @Test - fun `consumption rate`() { + @Test(timeout=300_000) + fun `consumption rate`() { rpcDriver { val metricRegistry = startReporter(shutdownManager) val proxy = testProxy( @@ -148,8 +148,8 @@ class RPCPerformanceTests : AbstractRPCTest() { val Mbps: Double ) - @Test - fun `big messages`() { + @Test(timeout=300_000) + fun `big messages`() { warmup() measure(listOf(1)) { clientParallelism -> // TODO this hangs with more parallelism diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPermissionsTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPermissionsTests.kt index da1c61b8e7..74e30ac3ba 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPermissionsTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPermissionsTests.kt @@ -46,8 +46,8 @@ class RPCPermissionsTests : AbstractRPCTest() { private fun userOf(name: String, permissions: Set) = User(name, "password", permissions) - @Test - fun `empty user cannot use any flows`() { + @Test(timeout=300_000) + fun `empty user cannot use any flows`() { rpcDriver { val emptyUser = userOf("empty", emptySet()) val proxy = testProxyFor(emptyUser) @@ -57,8 +57,8 @@ class RPCPermissionsTests : AbstractRPCTest() { } } - @Test - fun `admin user can use any flow`() { + @Test(timeout=300_000) + fun `admin user can use any flow`() { rpcDriver { val adminUser = userOf("admin", setOf(ALL_ALLOWED)) val proxy = testProxyFor(adminUser) @@ -67,8 +67,8 @@ class RPCPermissionsTests : AbstractRPCTest() { } } - @Test - fun `joe user is allowed to use DummyFlow`() { + @Test(timeout=300_000) + fun `joe user is allowed to use DummyFlow`() { rpcDriver { val joeUser = userOf("joe", setOf(DUMMY_FLOW)) val proxy = testProxyFor(joeUser) @@ -77,8 +77,8 @@ class RPCPermissionsTests : AbstractRPCTest() { } } - @Test - fun `joe user is not allowed to use OtherFlow`() { + @Test(timeout=300_000) + fun `joe user is not allowed to use OtherFlow`() { rpcDriver { val joeUser = userOf("joe", setOf(DUMMY_FLOW)) val proxy = testProxyFor(joeUser) @@ -91,8 +91,8 @@ class RPCPermissionsTests : AbstractRPCTest() { } } - @Test - fun `joe user is not allowed to call other RPC methods`() { + @Test(timeout=300_000) + fun `joe user is not allowed to call other RPC methods`() { rpcDriver { val joeUser = userOf("joe", setOf(DUMMY_FLOW)) val proxy = testProxyFor(joeUser) @@ -105,8 +105,8 @@ class RPCPermissionsTests : AbstractRPCTest() { } } - @Test - fun `joe user can call different methods matching to a wildcard`() { + @Test(timeout=300_000) + fun `joe user can call different methods matching to a wildcard`() { rpcDriver { val joeUser = userOf("joe", setOf(WILDCARD_FLOW)) val proxy = testProxyFor(joeUser) @@ -128,8 +128,8 @@ class RPCPermissionsTests : AbstractRPCTest() { } } - @Test - fun `checking invokeRpc permissions entitlements`() { + @Test(timeout=300_000) + fun `checking invokeRpc permissions entitlements`() { rpcDriver { val joeUser = userOf("joe", setOf("InvokeRpc.networkMapFeed")) val proxy = testProxyFor(joeUser) diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyTest.kt index 2be1c5639b..61dbd39551 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyTest.kt @@ -8,8 +8,8 @@ import java.util.concurrent.atomic.AtomicLong class PropertyTest { - @Test - fun present_value_with_correct_type() { + @Test(timeout=300_000) + fun present_value_with_correct_type() { val key = "a.b.c" val value = 1L @@ -25,8 +25,8 @@ class PropertyTest { assertThat(configuration[property]).isEqualTo(value) } - @Test - fun present_value_with_wrong_type() { + @Test(timeout=300_000) + fun present_value_with_wrong_type() { val key = "a.b.c" val value = 1 @@ -41,8 +41,8 @@ class PropertyTest { assertThatThrownBy { property.valueIn(configuration) }.isInstanceOf(ConfigException.WrongType::class.java) } - @Test - fun present_value_of_list_type() { + @Test(timeout=300_000) + fun present_value_of_list_type() { val key = "a.b.c" val value = listOf(1L, 2L, 3L) @@ -57,8 +57,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(value) } - @Test - fun present_value_of_list_type_with_whole_list_mapping() { + @Test(timeout=300_000) + fun present_value_of_list_type_with_whole_list_mapping() { val key = "a.b.c" val value = listOf(1L, 3L, 2L) @@ -73,8 +73,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(value.max()) } - @Test - fun absent_value_of_list_type_with_whole_list_mapping() { + @Test(timeout=300_000) + fun absent_value_of_list_type_with_whole_list_mapping() { val key = "a.b.c" val configuration = configObject().toConfig() @@ -88,8 +88,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(null) } - @Test - fun present_value_of_list_type_with_single_element_and_whole_list_mapping() { + @Test(timeout=300_000) + fun present_value_of_list_type_with_single_element_and_whole_list_mapping() { val key = "a.b.c" val value = listOf(1L, 3L, 2L) @@ -104,8 +104,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(value.max()) } - @Test - fun absent_value_of_list_type_with_single_element_and_whole_list_mapping() { + @Test(timeout=300_000) + fun absent_value_of_list_type_with_single_element_and_whole_list_mapping() { val key = "a.b.c" val configuration = configObject().toConfig() @@ -119,8 +119,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(null) } - @Test - fun optional_present_value_of_list_type() { + @Test(timeout=300_000) + fun optional_present_value_of_list_type() { val key = "a.b.c" val value = listOf(1L, 2L, 3L) @@ -135,8 +135,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(value) } - @Test - fun optional_absent_value_of_list_type() { + @Test(timeout=300_000) + fun optional_absent_value_of_list_type() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() @@ -151,8 +151,8 @@ class PropertyTest { } - @Test - fun optional_absent_value_of_list_type_with_default_value() { + @Test(timeout=300_000) + fun optional_absent_value_of_list_type_with_default_value() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() @@ -167,8 +167,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(defaultValue) } - @Test - fun absent_value() { + @Test(timeout=300_000) + fun absent_value() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() @@ -182,8 +182,8 @@ class PropertyTest { assertThatThrownBy { property.valueIn(configuration) }.isInstanceOf(ConfigException.Missing::class.java) } - @Test - fun optional_present_value_with_correct_type() { + @Test(timeout=300_000) + fun optional_present_value_with_correct_type() { val key = "a.b.c" val value = 1L @@ -198,8 +198,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isEqualTo(value) } - @Test - fun optional_present_value_with_wrong_type() { + @Test(timeout=300_000) + fun optional_present_value_with_wrong_type() { val key = "a.b.c" val value = 1 @@ -214,8 +214,8 @@ class PropertyTest { assertThatThrownBy { property.valueIn(configuration) }.isInstanceOf(ConfigException.WrongType::class.java) } - @Test - fun optional_absent_value() { + @Test(timeout=300_000) + fun optional_absent_value() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() @@ -229,8 +229,8 @@ class PropertyTest { assertThat(property.valueIn(configuration)).isNull() } - @Test - fun optional_absent_with_default_value() { + @Test(timeout=300_000) + fun optional_absent_with_default_value() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyValidationTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyValidationTest.kt index 4d6ede7884..3c03a74c33 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyValidationTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/PropertyValidationTest.kt @@ -7,8 +7,8 @@ import org.junit.Test class PropertyValidationTest { - @Test - fun absent_value() { + @Test(timeout=300_000) + fun absent_value() { val key = "a.b.c" val configuration = configObject().toConfig() @@ -26,8 +26,8 @@ class PropertyValidationTest { } } - @Test - fun missing_value() { + @Test(timeout=300_000) + fun missing_value() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() @@ -45,8 +45,8 @@ class PropertyValidationTest { } } - @Test - fun absent_list_value() { + @Test(timeout=300_000) + fun absent_list_value() { val key = "a.b.c" val configuration = configObject().toConfig() @@ -64,8 +64,8 @@ class PropertyValidationTest { } } - @Test - fun missing_list_value() { + @Test(timeout=300_000) + fun missing_list_value() { val key = "a.b.c" val configuration = configObject(key to null).toConfig() @@ -83,8 +83,8 @@ class PropertyValidationTest { } } - @Test - fun whole_list_validation_valid_value() { + @Test(timeout=300_000) + fun whole_list_validation_valid_value() { val key = "a.b.c" val value = listOf(1L, 2L, 3L) @@ -97,8 +97,8 @@ class PropertyValidationTest { assertThat(property.validate(configuration).errors).isEmpty() } - @Test - fun whole_list_validation_invalid_value() { + @Test(timeout=300_000) + fun whole_list_validation_invalid_value() { val key = "a.b.c" val value = listOf(1L, 2L, 3L) @@ -125,8 +125,8 @@ class PropertyValidationTest { } } - @Test - fun wrong_type() { + @Test(timeout=300_000) + fun wrong_type() { val key = "a.b.c" @@ -145,8 +145,8 @@ class PropertyValidationTest { } } - @Test - fun wrong_floating_numeric_type_when_integer_expected() { + @Test(timeout=300_000) + fun wrong_floating_numeric_type_when_integer_expected() { val key = "a.b.c" @@ -165,8 +165,8 @@ class PropertyValidationTest { } } - @Test - fun integer_numeric_type_when_floating_expected_works() { + @Test(timeout=300_000) + fun integer_numeric_type_when_floating_expected_works() { val key = "a.b.c" @@ -177,8 +177,8 @@ class PropertyValidationTest { assertThat(property.validate(configuration).isValid).isTrue() } - @Test - fun wrong_element_type_for_list() { + @Test(timeout=300_000) + fun wrong_element_type_for_list() { val key = "a.b.c" @@ -197,8 +197,8 @@ class PropertyValidationTest { } } - @Test - fun list_type_when_declared_single() { + @Test(timeout=300_000) + fun list_type_when_declared_single() { val key = "a.b.c" @@ -217,8 +217,8 @@ class PropertyValidationTest { } } - @Test - fun single_type_when_declared_list() { + @Test(timeout=300_000) + fun single_type_when_declared_list() { val key = "a.b.c" @@ -237,8 +237,8 @@ class PropertyValidationTest { } } - @Test - fun wrong_type_in_nested_property() { + @Test(timeout=300_000) + fun wrong_type_in_nested_property() { val key = "a.b.c" @@ -260,8 +260,8 @@ class PropertyValidationTest { } } - @Test - fun absent_value_in_nested_property() { + @Test(timeout=300_000) + fun absent_value_in_nested_property() { val key = "a.b.c" @@ -283,8 +283,8 @@ class PropertyValidationTest { } } - @Test - fun missing_value_in_nested_property() { + @Test(timeout=300_000) + fun missing_value_in_nested_property() { val key = "a.b.c" @@ -306,8 +306,8 @@ class PropertyValidationTest { } } - @Test - fun nested_property_without_schema_does_not_validate() { + @Test(timeout=300_000) + fun nested_property_without_schema_does_not_validate() { val key = "a.b.c" @@ -320,8 +320,8 @@ class PropertyValidationTest { assertThat(property.validate(configuration).isValid).isTrue() } - @Test - fun valid_mapped_property() { + @Test(timeout=300_000) + fun valid_mapped_property() { val key = "a" @@ -336,8 +336,8 @@ class PropertyValidationTest { assertThat(property.validate(configuration).isValid).isTrue() } - @Test - fun invalid_mapped_property() { + @Test(timeout=300_000) + fun invalid_mapped_property() { val key = "a.b.c" diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SchemaTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SchemaTest.kt index d468e68361..f6393bd39b 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SchemaTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SchemaTest.kt @@ -7,8 +7,8 @@ import org.junit.Test class SchemaTest { - @Test - fun validation_with_nested_properties() { + @Test(timeout=300_000) + fun validation_with_nested_properties() { val prop1 = "prop1" val prop1Value = "value1" @@ -35,8 +35,8 @@ class SchemaTest { assertThat(result.isValid).isTrue() } - @Test - fun validation_with_unknown_properties() { + @Test(timeout=300_000) + fun validation_with_unknown_properties() { val prop1 = "prop1" val prop1Value = "value1" @@ -74,8 +74,8 @@ class SchemaTest { assertThat(errorsWithDefaultOptions).isEmpty() } - @Test - fun validation_with_unknown_properties_non_strict() { + @Test(timeout=300_000) + fun validation_with_unknown_properties_non_strict() { val prop1 = "prop1" val prop1Value = "value1" @@ -103,8 +103,8 @@ class SchemaTest { assertThat(result.isValid).isTrue() } - @Test - fun validation_with_wrong_nested_properties() { + @Test(timeout=300_000) + fun validation_with_wrong_nested_properties() { val prop1 = "prop1" val prop1Value = "value1" @@ -133,8 +133,8 @@ class SchemaTest { assertThat(errors).hasSize(2) } - @Test - fun describe_with_nested_properties_does_not_show_sensitive_values() { + @Test(timeout=300_000) + fun describe_with_nested_properties_does_not_show_sensitive_values() { val prop1 = "prop1" val prop1Value = "value1" @@ -164,8 +164,8 @@ class SchemaTest { assertThat(description).doesNotContain(prop5Value) } - @Test - fun describe_with_nested_properties_list_does_not_show_sensitive_values() { + @Test(timeout=300_000) + fun describe_with_nested_properties_list_does_not_show_sensitive_values() { val prop1 = "prop1" val prop1Value = "value1" diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SpecificationTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SpecificationTest.kt index f176622cfe..a78ef5ee59 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SpecificationTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/SpecificationTest.kt @@ -30,8 +30,8 @@ class SpecificationTest { override fun parseValid(configuration: Config) = valid(RpcSettingsImpl(configuration[addresses], configuration[useSsl])) } - @Test - fun parse() { + @Test(timeout=300_000) + fun parse() { val useSslValue = true val principalAddressValue = Address("localhost", 8080) @@ -53,8 +53,8 @@ class SpecificationTest { } } - @Test - fun parse_list_aggregation() { + @Test(timeout=300_000) + fun parse_list_aggregation() { val spec = object : Configuration.Specification("AtomicLong") { @@ -75,8 +75,8 @@ class SpecificationTest { assertThat(result.value().get()).isEqualTo(elements.max()) } - @Test - fun validate() { + @Test(timeout=300_000) + fun validate() { val principalAddressValue = Address("localhost", 8080) val adminAddressValue = Address("127.0.0.1", 8081) @@ -93,8 +93,8 @@ class SpecificationTest { } } - @Test - fun validate_list_aggregation() { + @Test(timeout=300_000) + fun validate_list_aggregation() { fun parseMax(elements: List): Valid { @@ -130,8 +130,8 @@ class SpecificationTest { } } - @Test - fun validate_with_domain_specific_errors() { + @Test(timeout=300_000) + fun validate_with_domain_specific_errors() { val useSslValue = true val principalAddressValue = Address("localhost", 8080) @@ -151,8 +151,8 @@ class SpecificationTest { } } - @Test - fun chained_delegated_properties_are_not_added_multiple_times() { + @Test(timeout=300_000) + fun chained_delegated_properties_are_not_added_multiple_times() { val spec = object : Configuration.Specification?>("Test") { diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/UtilsTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/UtilsTest.kt index 936db1a789..37b39a09c0 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/UtilsTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/UtilsTest.kt @@ -6,8 +6,8 @@ import org.junit.Test class UtilsTest { - @Test - fun serialize_deserialize_configuration() { + @Test(timeout=300_000) + fun serialize_deserialize_configuration() { var rawConfiguration = ConfigFactory.empty() diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionExtractorTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionExtractorTest.kt index 0419e202b9..d06bb11075 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionExtractorTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionExtractorTest.kt @@ -12,8 +12,8 @@ class VersionExtractorTest { private val versionExtractor = Configuration.Version.Extractor.fromPath("configuration.metadata.version") private val extractVersion: (Config) -> Valid = { config -> versionExtractor.parse(config) } - @Test - fun version_header_extraction_present() { + @Test(timeout=300_000) + fun version_header_extraction_present() { val versionValue = Configuration.Version.Extractor.DEFAULT_VERSION_VALUE + 1 val rawConfiguration = configObject("configuration" to configObject("metadata" to configObject("version" to versionValue), "node" to configObject("p2pAddress" to "localhost:8080"))).toConfig() @@ -22,8 +22,8 @@ class VersionExtractorTest { assertThat(version).isEqualTo(versionValue) } - @Test - fun version_header_extraction_no_metadata() { + @Test(timeout=300_000) + fun version_header_extraction_no_metadata() { val rawConfiguration = configObject("configuration" to configObject("node" to configObject("p2pAddress" to "localhost:8080"))).toConfig() @@ -31,8 +31,8 @@ class VersionExtractorTest { assertThat(version).isEqualTo(Configuration.Version.Extractor.DEFAULT_VERSION_VALUE) } - @Test - fun version_header_extraction_no_key() { + @Test(timeout=300_000) + fun version_header_extraction_no_key() { val rawConfiguration = configObject("configuration" to configObject("metadata" to configObject(), "node" to configObject("p2pAddress" to "localhost:8080"))).toConfig() @@ -41,8 +41,8 @@ class VersionExtractorTest { assertThat(version).isEqualTo(Configuration.Version.Extractor.DEFAULT_VERSION_VALUE) } - @Test - fun version_header_extraction_no_value() { + @Test(timeout=300_000) + fun version_header_extraction_no_value() { val rawConfiguration = configObject("configuration" to configObject("metadata" to configObject("version" to null), "node" to configObject("p2pAddress" to "localhost:8080"))).toConfig() @@ -51,8 +51,8 @@ class VersionExtractorTest { assertThat(version).isEqualTo(Configuration.Version.Extractor.DEFAULT_VERSION_VALUE) } - @Test - fun version_header_extraction_no_configuration() { + @Test(timeout=300_000) + fun version_header_extraction_no_configuration() { val rawConfiguration = configObject().toConfig() diff --git a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionedParsingExampleTest.kt b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionedParsingExampleTest.kt index 2f30fa2211..59c6889b3c 100644 --- a/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionedParsingExampleTest.kt +++ b/common/configuration-parsing/src/test/kotlin/net/corda/common/configuration/parsing/internal/versioned/VersionedParsingExampleTest.kt @@ -9,8 +9,8 @@ import org.junit.Test class VersionedParsingExampleTest { - @Test - fun correct_parsing_function_is_used_for_present_version() { + @Test(timeout=300_000) + fun correct_parsing_function_is_used_for_present_version() { val versionParser = Configuration.Version.Extractor.fromPath("configuration.metadata.version") val extractVersion: (Config) -> Valid = { config -> versionParser.parseRequired(config) } @@ -31,8 +31,8 @@ class VersionedParsingExampleTest { assertResult(rpcSettingsFromVersion2Conf, principalAddressValue, adminAddressValue) } - @Test - fun default_value_is_used_for_absent_version() { + @Test(timeout=300_000) + fun default_value_is_used_for_absent_version() { val defaultVersion = 2 val versionParser = Configuration.Version.Extractor.fromPath("configuration.metadata.version", defaultVersion) diff --git a/confidential-identities/src/test/kotlin/net/corda/confidential/IdentitySyncFlowTests.kt b/confidential-identities/src/test/kotlin/net/corda/confidential/IdentitySyncFlowTests.kt index 69930422fa..2262afe3c5 100644 --- a/confidential-identities/src/test/kotlin/net/corda/confidential/IdentitySyncFlowTests.kt +++ b/confidential-identities/src/test/kotlin/net/corda/confidential/IdentitySyncFlowTests.kt @@ -46,8 +46,8 @@ class IdentitySyncFlowTests { mockNet.stopNodes() } - @Test - fun `sync confidential identities`() { + @Test(timeout=300_000) + fun `sync confidential identities`() { // Set up values we'll need val aliceNode = mockNet.createPartyNode(ALICE_NAME) val bobNode = mockNet.createPartyNode(BOB_NAME) @@ -74,8 +74,8 @@ class IdentitySyncFlowTests { assertEquals(expected, actual) } - @Test - fun `don't offer other's identities confidential identities`() { + @Test(timeout=300_000) + fun `don't offer other's identities confidential identities`() { // Set up values we'll need val aliceNode = mockNet.createPartyNode(ALICE_NAME) val bobNode = mockNet.createPartyNode(BOB_NAME) diff --git a/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt b/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt index f09e688222..71d4ff23c6 100644 --- a/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt +++ b/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt @@ -46,8 +46,8 @@ class SwapIdentitiesFlowTests { private val alice = aliceNode.info.singleIdentity() private val bob = bobNode.info.singleIdentity() - @Test - fun `issue key`() { + @Test(timeout=300_000) + fun `issue key`() { assertThat( aliceNode.services.startFlow(SwapIdentitiesInitiator(bob)), willReturn( @@ -72,8 +72,8 @@ class SwapIdentitiesFlowTests { /** * Check that flow is actually validating the name on the certificate presented by the counterparty. */ - @Test - fun `verifies identity name`() { + @Test(timeout=300_000) + fun `verifies identity name`() { val notBob = charlieNode.issueFreshKeyAndCert() val signature = charlieNode.signSwapIdentitiesFlowData(notBob, notBob.owningKey) assertThatThrownBy { aliceNode.validateSwapIdentitiesFlow(bob, notBob, signature) } @@ -84,8 +84,8 @@ class SwapIdentitiesFlowTests { /** * Check that flow is actually validating its the signature presented by the counterparty. */ - @Test - fun `verification rejects signature if name is right but key is wrong`() { + @Test(timeout=300_000) + fun `verification rejects signature if name is right but key is wrong`() { val evilBobNode = mockNet.createPartyNode(bobNode.info.singleIdentity().name) val evilBob = evilBobNode.info.singleIdentityAndCert() val anonymousEvilBob = evilBobNode.issueFreshKeyAndCert() @@ -96,8 +96,8 @@ class SwapIdentitiesFlowTests { .hasMessage("Signature does not match the expected identity ownership assertion.") } - @Test - fun `verification rejects signature if key is right but name is wrong`() { + @Test(timeout=300_000) + fun `verification rejects signature if key is right but name is wrong`() { val anonymousAlice = aliceNode.issueFreshKeyAndCert() val anonymousBob = bobNode.issueFreshKeyAndCert() val signature = bobNode.signSwapIdentitiesFlowData(anonymousAlice, anonymousBob.owningKey) diff --git a/core-deterministic/testing/data/src/test/kotlin/net/corda/deterministic/data/GenerateData.kt b/core-deterministic/testing/data/src/test/kotlin/net/corda/deterministic/data/GenerateData.kt index 1ada19e231..559530278f 100644 --- a/core-deterministic/testing/data/src/test/kotlin/net/corda/deterministic/data/GenerateData.kt +++ b/core-deterministic/testing/data/src/test/kotlin/net/corda/deterministic/data/GenerateData.kt @@ -72,7 +72,7 @@ class GenerateData { } @Test - fun verifyTransactions() { + fun verifyTransactions() { URLClassLoader(arrayOf(TEST_DATA.toUri().toURL())).use { cl -> cl.loadResource("txverify/tx-success.bin") .deserialize() diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/CordaExceptionTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/CordaExceptionTest.kt index 2a7351ae08..3b95b952d2 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/CordaExceptionTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/CordaExceptionTest.kt @@ -35,33 +35,33 @@ class CordaExceptionTest { val BOB = Party(BOB_NAME, BOB_KEY) } - @Test - fun testCordaException() { + @Test(timeout=300_000) + fun testCordaException() { val ex = assertFailsWith { throw CordaException("BAD THING") } assertEquals("BAD THING", ex.message) } - @Test - fun testAttachmentResolutionException() { + @Test(timeout=300_000) + fun testAttachmentResolutionException() { val ex = assertFailsWith { throw AttachmentResolutionException(TEST_HASH) } assertEquals(TEST_HASH, ex.hash) } - @Test - fun testTransactionResolutionException() { + @Test(timeout=300_000) + fun testTransactionResolutionException() { val ex = assertFailsWith { throw TransactionResolutionException(TEST_HASH) } assertEquals(TEST_HASH, ex.hash) } - @Test - fun testConflictingAttachmentsRejection() { + @Test(timeout=300_000) + fun testConflictingAttachmentsRejection() { val ex = assertFailsWith { throw ConflictingAttachmentsRejection(TX_ID, CONTRACT_CLASS) } assertEquals(TX_ID, ex.txId) assertEquals(CONTRACT_CLASS, ex.contractClass) } - @Test - fun testNotaryChangeInWrongTransactionType() { + @Test(timeout=300_000) + fun testNotaryChangeInWrongTransactionType() { val ex = assertFailsWith { throw NotaryChangeInWrongTransactionType(TX_ID, ALICE, BOB) } assertEquals(TX_ID, ex.txId) assertEquals(ALICE, ex.txNotary) diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/AttachmentTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/AttachmentTest.kt index f8db67bf49..491aa33d9c 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/AttachmentTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/AttachmentTest.kt @@ -55,8 +55,8 @@ class AttachmentTest { } } - @Test - fun testAttachmentJar() { + @Test(timeout=300_000) + fun testAttachmentJar() { attachment.openAsJAR().use { jar -> val entry = jar.nextJarEntry ?: return@use assertEquals("data.bin", entry.name) @@ -68,8 +68,8 @@ class AttachmentTest { } } - @Test - fun testExtractFromAttachment() { + @Test(timeout=300_000) + fun testExtractFromAttachment() { val resultData = ByteArrayOutputStream().use { attachment.extractFile("data.bin", it) it.toByteArray() diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/PrivacySaltTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/PrivacySaltTest.kt index 0232711dd8..a7912eea63 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/PrivacySaltTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/PrivacySaltTest.kt @@ -9,25 +9,25 @@ class PrivacySaltTest { private const val SALT_SIZE = 32 } - @Test - fun testValidSalt() { + @Test(timeout=300_000) + fun testValidSalt() { PrivacySalt(ByteArray(SALT_SIZE) { 0x14 }) } - @Test - fun testInvalidSaltWithAllZeros() { + @Test(timeout=300_000) + fun testInvalidSaltWithAllZeros() { val ex = assertFailsWith { PrivacySalt(ByteArray(SALT_SIZE)) } assertEquals("Privacy salt should not be all zeros.", ex.message) } - @Test - fun testTooShortPrivacySalt() { + @Test(timeout=300_000) + fun testTooShortPrivacySalt() { val ex = assertFailsWith { PrivacySalt(ByteArray(SALT_SIZE - 1) { 0x7f }) } assertEquals("Privacy salt should be 32 bytes.", ex.message) } - @Test - fun testTooLongPrivacySalt() { + @Test(timeout=300_000) + fun testTooLongPrivacySalt() { val ex = assertFailsWith { PrivacySalt(ByteArray(SALT_SIZE + 1) { 0x7f }) } assertEquals("Privacy salt should be 32 bytes.", ex.message) } diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/UniqueIdentifierTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/UniqueIdentifierTest.kt index 030f10fac3..1aed8eed0f 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/UniqueIdentifierTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/contracts/UniqueIdentifierTest.kt @@ -14,22 +14,22 @@ class UniqueIdentifierTest { private val TEST_UUID: UUID = UUID.fromString("00000000-1111-2222-3333-444444444444") } - @Test - fun testNewInstance() { + @Test(timeout=300_000) + fun testNewInstance() { val id = UniqueIdentifier(NAME, TEST_UUID) assertEquals("${NAME}_$TEST_UUID", id.toString()) assertEquals(NAME, id.externalId) assertEquals(TEST_UUID, id.id) } - @Test - fun testPrimaryConstructor() { + @Test(timeout=300_000) + fun testPrimaryConstructor() { val primary = UniqueIdentifier::class.primaryConstructor ?: throw AssertionError("primary constructor missing") assertThat(primary.call(NAME, TEST_UUID)).isEqualTo(UniqueIdentifier(NAME, TEST_UUID)) } - @Test - fun testConstructors() { + @Test(timeout=300_000) + fun testConstructors() { assertEquals(1, UniqueIdentifier::class.constructors.size) val ex = assertFailsWith { UniqueIdentifier::class.constructors.first().call() } assertThat(ex).hasMessage("Callable expects 2 arguments, but 0 were provided.") diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/MerkleTreeTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/MerkleTreeTest.kt index 432a89280d..0b4d340e73 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/MerkleTreeTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/MerkleTreeTest.kt @@ -6,8 +6,8 @@ import org.junit.Assert.assertEquals import org.junit.Test class MerkleTreeTest { - @Test - fun testCreate() { + @Test(timeout=300_000) + fun testCreate() { val merkle = MerkleTree.getMerkleTree(listOf(SecureHash.allOnesHash, SecureHash.zeroHash)) assertEquals(SecureHash.parse("A5DE9B714ACCD8AFAAABF1CBD6E1014C9D07FF95C2AE154D91EC68485B31E7B5"), merkle.hash) } diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureHashTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureHashTest.kt index de90178f22..c51367ffc5 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureHashTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureHashTest.kt @@ -7,31 +7,31 @@ import org.junit.Test import java.security.MessageDigest class SecureHashTest { - @Test - fun testSHA256() { + @Test(timeout=300_000) + fun testSHA256() { val hash = SecureHash.sha256(byteArrayOf(0x64, -0x13, 0x42, 0x3a)) assertEquals(SecureHash.parse("6D1687C143DF792A011A1E80670A4E4E0C25D0D87A39514409B1ABFC2043581F"), hash) assertEquals("6D1687C143DF792A011A1E80670A4E4E0C25D0D87A39514409B1ABFC2043581F", hash.toString()) } - @Test - fun testPrefix() { + @Test(timeout=300_000) + fun testPrefix() { val data = byteArrayOf(0x7d, 0x03, -0x21, 0x32, 0x56, 0x47) val digest = data.digestFor("SHA-256") val prefix = SecureHash.sha256(data).prefixChars(8) assertEquals(Hex.toHexString(digest).substring(0, 8).toUpperCase(), prefix) } - @Test - fun testConcat() { + @Test(timeout=300_000) + fun testConcat() { val hash1 = SecureHash.sha256(byteArrayOf(0x7d, 0x03, -0x21, 0x32, 0x56, 0x47)) val hash2 = SecureHash.sha256(byteArrayOf(0x63, 0x01, 0x7f, -0x29, 0x1e, 0x3c)) val combined = hash1.hashConcat(hash2) assertArrayEquals((hash1.bytes + hash2.bytes).digestFor("SHA-256"), combined.bytes) } - @Test - fun testConstants() { + @Test(timeout=300_000) + fun testConstants() { assertArrayEquals(SecureHash.zeroHash.bytes, ByteArray(32)) assertArrayEquals(SecureHash.allOnesHash.bytes, ByteArray(32) { 0xFF.toByte() }) } diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureRandomTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureRandomTest.kt index bd5ae65a49..d0c45cef39 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureRandomTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/SecureRandomTest.kt @@ -14,8 +14,8 @@ class SecureRandomTest { } } - @Test - fun testNoCordaPRNG() { + @Test(timeout=300_000) + fun testNoCordaPRNG() { val error = assertFailsWith { SecureRandom.getInstance("CordaPRNG") } assertThat(error).hasMessage("CordaPRNG SecureRandom not available") } diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/TransactionSignatureTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/TransactionSignatureTest.kt index ac5e7971eb..f233ce89a9 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/TransactionSignatureTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/crypto/TransactionSignatureTest.kt @@ -30,8 +30,8 @@ class TransactionSignatureTest { } /** Valid sign and verify. */ - @Test - fun `Signature metadata full sign and verify`() { + @Test(timeout=300_000) + fun `Signature metadata full sign and verify`() { // Create a SignableData object. val signableData = SignableData(testBytes.sha256(), SignatureMetadata(1, Crypto.findSignatureScheme(keyPair.public).schemeNumberID)) @@ -57,8 +57,8 @@ class TransactionSignatureTest { Crypto.doVerify((testBytes + testBytes).sha256(), transactionSignature) } - @Test - fun `Verify multi-tx signature`() { + @Test(timeout=300_000) + fun `Verify multi-tx signature`() { // Deterministically create 5 txIds. val txIds: List = IntRange(0, 4).map { byteArrayOf(it.toByte()).sha256() } // Multi-tx signature. @@ -103,8 +103,8 @@ class TransactionSignatureTest { } } - @Test - fun `Verify one-tx signature`() { + @Test(timeout=300_000) + fun `Verify one-tx signature`() { val txId = "aTransaction".toByteArray().sha256() // One-tx signature. val txSignature = try { diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/transactions/TransactionWithSignaturesTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/transactions/TransactionWithSignaturesTest.kt index f1ec9630db..e092ee371d 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/transactions/TransactionWithSignaturesTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/transactions/TransactionWithSignaturesTest.kt @@ -7,8 +7,8 @@ import org.junit.Test import java.security.PublicKey class TransactionWithSignaturesTest { - @Test - fun txWithSigs() { + @Test(timeout=300_000) + fun txWithSigs() { val tx = object : TransactionWithSignatures { override val id: SecureHash get() = SecureHash.zeroHash diff --git a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/txverify/VerifyTransactionTest.kt b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/txverify/VerifyTransactionTest.kt index 6526ca3c51..f5012485f2 100644 --- a/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/txverify/VerifyTransactionTest.kt +++ b/core-deterministic/testing/src/test/kotlin/net/corda/deterministic/txverify/VerifyTransactionTest.kt @@ -16,13 +16,13 @@ class VerifyTransactionTest { val serialization = LocalSerializationRule(VerifyTransactionTest::class) } - @Test - fun success() { + @Test(timeout=300_000) + fun success() { verifyTransaction(bytesOfResource("txverify/tx-success.bin")) } - @Test - fun failure() { + @Test(timeout=300_000) + fun failure() { val e = assertFailsWith { verifyTransaction(bytesOfResource("txverify/tx-failure.bin")) } assertThat(e).hasMessageContaining("Required ${Move::class.java.canonicalName} command") } diff --git a/core-deterministic/testing/verifier/src/main/kotlin/net/corda/deterministic/verifier/LocalSerializationRule.kt b/core-deterministic/testing/verifier/src/main/kotlin/net/corda/deterministic/verifier/LocalSerializationRule.kt index 2b2dc2af91..35fbe9611c 100644 --- a/core-deterministic/testing/verifier/src/main/kotlin/net/corda/deterministic/verifier/LocalSerializationRule.kt +++ b/core-deterministic/testing/verifier/src/main/kotlin/net/corda/deterministic/verifier/LocalSerializationRule.kt @@ -5,7 +5,7 @@ import net.corda.core.serialization.SerializationContext.UseCase.P2P import net.corda.core.serialization.SerializationCustomSerializer import net.corda.core.serialization.SerializationWhitelist import net.corda.core.serialization.internal.SerializationEnvironment -import net.corda.core.serialization.internal._contextSerializationEnv +import net.corda.core.serialization.internal._driverSerializationEnv import net.corda.serialization.internal.* import net.corda.serialization.internal.amqp.* import org.junit.rules.TestRule @@ -48,11 +48,11 @@ class LocalSerializationRule(private val label: String) : TestRule { } private fun init() { - _contextSerializationEnv.set(createTestSerializationEnv()) + _driverSerializationEnv.set(createTestSerializationEnv()) } private fun clear() { - _contextSerializationEnv.set(null) + _driverSerializationEnv.set(null) } private fun createTestSerializationEnv(): SerializationEnvironment { diff --git a/core-tests/src/smoke-test/kotlin/net/corda/coretests/NodeVersioningTest.kt b/core-tests/src/smoke-test/kotlin/net/corda/coretests/NodeVersioningTest.kt index 0cc4064413..12a303de02 100644 --- a/core-tests/src/smoke-test/kotlin/net/corda/coretests/NodeVersioningTest.kt +++ b/core-tests/src/smoke-test/kotlin/net/corda/coretests/NodeVersioningTest.kt @@ -57,14 +57,14 @@ class NodeVersioningTest { notary.close() } - @Test - fun `platform version in manifest file`() { + @Test(timeout=300_000) + fun `platform version in manifest file`() { val manifest = JarFile(factory.cordaJar.toFile()).manifest assertThat(manifest.mainAttributes.getValue("Corda-Platform-Version").toInt()).isEqualTo(PLATFORM_VERSION) } - @Test - fun `platform version from RPC`() { + @Test(timeout=300_000) + fun `platform version from RPC`() { val cordappsDir = (factory.baseDirectory(aliceConfig) / NodeProcess.CORDAPPS_DIR_NAME).createDirectories() // Find the jar file for the smoke tests of this module val selfCordapp = Paths.get("build", "libs").list { diff --git a/core-tests/src/smoke-test/kotlin/net/corda/coretests/cordapp/CordappSmokeTest.kt b/core-tests/src/smoke-test/kotlin/net/corda/coretests/cordapp/CordappSmokeTest.kt index db35d08b66..6374390c23 100644 --- a/core-tests/src/smoke-test/kotlin/net/corda/coretests/cordapp/CordappSmokeTest.kt +++ b/core-tests/src/smoke-test/kotlin/net/corda/coretests/cordapp/CordappSmokeTest.kt @@ -74,8 +74,8 @@ class CordappSmokeTest { notary.close() } - @Test - fun `FlowContent appName returns the filename of the CorDapp jar`() { + @Test(timeout=300_000) + fun `FlowContent appName returns the filename of the CorDapp jar`() { val baseDir = factory.baseDirectory(aliceConfig) val cordappsDir = (baseDir / CORDAPPS_DIR_NAME).createDirectories() // Find the jar file for the smoke tests of this module @@ -103,8 +103,8 @@ class CordappSmokeTest { } } - @Test - fun `empty cordapps directory`() { + @Test(timeout=300_000) + fun `empty cordapps directory`() { (factory.baseDirectory(aliceConfig) / CORDAPPS_DIR_NAME).createDirectories() factory.create(aliceConfig).close() } diff --git a/core-tests/src/test/kotlin/net/corda/coretests/contracts/AmountTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/contracts/AmountTests.kt index 8025913133..e382969aa0 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/contracts/AmountTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/contracts/AmountTests.kt @@ -19,14 +19,14 @@ import kotlin.test.assertTrue * Tests of the [Amount] class. */ class AmountTests { - @Test - fun `make sure Amount has decimal places`() { + @Test(timeout=300_000) + fun `make sure Amount has decimal places`() { val x = Amount(1, Currency.getInstance("USD")) assertTrue("0.01" in x.toString()) } - @Test - fun `decimal conversion`() { + @Test(timeout=300_000) + fun `decimal conversion`() { val quantity = 1234L val amountGBP = Amount(quantity, GBP) val expectedGBP = BigDecimal("12.34") @@ -48,8 +48,8 @@ class AmountTests { override fun toString(): String = name } - @Test - fun split() { + @Test(timeout=300_000) + fun split() { for (baseQuantity in 0..1000) { val baseAmount = Amount(baseQuantity.toLong(), GBP) for (partitionCount in 1..100) { @@ -63,8 +63,8 @@ class AmountTests { } } - @Test - fun `amount transfers equality`() { + @Test(timeout=300_000) + fun `amount transfers equality`() { val partyA = "A" val partyB = "B" val partyC = "C" @@ -88,8 +88,8 @@ class AmountTests { assertNotEquals(transferE.hashCode(), transferA.hashCode()) } - @Test - fun `amount transfer aggregation`() { + @Test(timeout=300_000) + fun `amount transfer aggregation`() { val partyA = "A" val partyB = "B" val partyC = "C" @@ -119,8 +119,8 @@ class AmountTests { assertEquals(negativeTransfer, sumUntilNegative) } - @Test - fun `amount transfer apply`() { + @Test(timeout=300_000) + fun `amount transfer apply`() { val partyA = "A" val partyB = "B" val partyC = "C" @@ -167,8 +167,8 @@ class AmountTests { assertEquals(originalTotals[Pair(partyB, GBP)], newTotals3[Pair(partyB, GBP)]) } - @Test - fun testGbpParse() { + @Test(timeout=300_000) + fun testGbpParse() { assertEquals(POUNDS(10), Amount.parseCurrency("10 GBP")) assertEquals(POUNDS(11), Amount.parseCurrency("£11")) } diff --git a/core-tests/src/test/kotlin/net/corda/coretests/contracts/ConstraintsPropagationTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/contracts/ConstraintsPropagationTests.kt index 81715d26e9..82397ff1cd 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/contracts/ConstraintsPropagationTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/contracts/ConstraintsPropagationTests.kt @@ -96,8 +96,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Happy path with the HashConstraint`() { + @Test(timeout=300_000) + fun `Happy path with the HashConstraint`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash) @@ -115,8 +115,8 @@ class ConstraintsPropagationTests { } } - @Test - @Ignore // TODO(mike): rework + @Test(timeout=300_000) +@Ignore // TODO(mike): rework fun `Happy path for Hash to Signature Constraint migration`() { val cordapps = (ledgerServices.cordappProvider as MockCordappProvider).cordapps val cordappAttachmentIds = @@ -156,8 +156,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Fail early in the TransactionBuilder when attempting to change the hash of the HashConstraint on the spending transaction`() { + @Test(timeout=300_000) + fun `Fail early in the TransactionBuilder when attempting to change the hash of the HashConstraint on the spending transaction`() { ledgerServices.ledger(DUMMY_NOTARY) { transaction { attachment(Cash.PROGRAM_ID, SecureHash.zeroHash) @@ -177,8 +177,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Transaction validation fails, when constraints do not propagate correctly`() { + @Test(timeout=300_000) + fun `Transaction validation fails, when constraints do not propagate correctly`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.zeroHash) @@ -210,8 +210,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `When the constraint of the output state is a valid transition from the input state, transaction validation works`() { + @Test(timeout=300_000) + fun `When the constraint of the output state is a valid transition from the input state, transaction validation works`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.zeroHash) @@ -229,8 +229,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Switching from the WhitelistConstraint to the Signature Constraint is possible if the attachment satisfies both constraints, and the signature constraint inherits all jar signatures`() { + @Test(timeout=300_000) + fun `Switching from the WhitelistConstraint to the Signature Constraint is possible if the attachment satisfies both constraints, and the signature constraint inherits all jar signatures`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { @@ -251,8 +251,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Switching from the WhitelistConstraint to the Signature Constraint fails if the signature constraint does not inherit all jar signatures`() { + @Test(timeout=300_000) + fun `Switching from the WhitelistConstraint to the Signature Constraint fails if the signature constraint does not inherit all jar signatures`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.zeroHash) @@ -272,8 +272,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `On contract annotated with NoConstraintPropagation there is no platform check for propagation, but the transaction builder can't use the AutomaticPlaceholderConstraint`() { + @Test(timeout=300_000) + fun `On contract annotated with NoConstraintPropagation there is no platform check for propagation, but the transaction builder can't use the AutomaticPlaceholderConstraint`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(noPropagationContractClassName, SecureHash.zeroHash) @@ -300,8 +300,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Signature Constraints canBeTransitionedFrom Hash Constraints behaves as expected`() { + @Test(timeout=300_000) + fun `Signature Constraints canBeTransitionedFrom Hash Constraints behaves as expected`() { // unsigned attachment (for hash constraint) val attachmentUnsigned = mock() @@ -326,8 +326,8 @@ class ConstraintsPropagationTests { assertFalse(SignatureAttachmentConstraint(ALICE_PUBKEY).canBeTransitionedFrom(HashAttachmentConstraint(allOnesHash), attachmentSigned)) } - @Test - fun `Attachment canBeTransitionedFrom behaves as expected`() { + @Test(timeout=300_000) + fun `Attachment canBeTransitionedFrom behaves as expected`() { // signed attachment (for signature constraint) val attachment = mock() @@ -378,8 +378,8 @@ class ConstraintsPropagationTests { recordTransactions(SignedTransaction(wireTransaction, sigs)) } - @Test - fun `Input state contract version may be incompatible with lower version`() { + @Test(timeout=300_000) + fun `Input state contract version may be incompatible with lower version`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "2")) @@ -397,8 +397,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Input state contract version is compatible with the same version`() { + @Test(timeout=300_000) + fun `Input state contract version is compatible with the same version`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "3")) @@ -416,8 +416,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Input state contract version is compatible with higher version`() { + @Test(timeout=300_000) + fun `Input state contract version is compatible with higher version`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "1")) @@ -435,8 +435,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Input states contract version may be lower that current contract version`() { + @Test(timeout=300_000) + fun `Input states contract version may be lower that current contract version`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "1")) @@ -460,8 +460,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Input state with contract version can be downgraded to no version`() { + @Test(timeout=300_000) + fun `Input state with contract version can be downgraded to no version`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), mapOf(Attributes.Name.IMPLEMENTATION_VERSION.toString() to "2")) @@ -479,8 +479,8 @@ class ConstraintsPropagationTests { } } - @Test - fun `Input state without contract version is compatible with any version`() { + @Test(timeout=300_000) + fun `Input state without contract version is compatible with any version`() { ledgerServices.ledger(DUMMY_NOTARY) { ledgerServices.recordTransaction(transaction { attachment(Cash.PROGRAM_ID, SecureHash.allOnesHash, listOf(hashToSignatureConstraintsKey), emptyMap()) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractHierarchyTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractHierarchyTest.kt index f8ea216011..0fbc6e8ae9 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractHierarchyTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractHierarchyTest.kt @@ -34,8 +34,8 @@ class ContractHierarchyTest { mockNet.stopNodes() } - @Test - fun `hierarchical contracts work with mock network`() { + @Test(timeout=300_000) + fun `hierarchical contracts work with mock network`() { // Set up values we'll need val aliceNode = mockNet.createPartyNode(ALICE_NAME) val bobNode = mockNet.createPartyNode(BOB_NAME) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractsDSLTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractsDSLTests.kt index bbf47ac034..52e86e1336 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractsDSLTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/contracts/ContractsDSLTests.kt @@ -40,8 +40,8 @@ class RequireSingleCommandTests(private val testFunction: (Collection { MerkleTree.getMerkleTree(emptyList()) } } - @Test - fun `building Merkle tree one node`() { + @Test(timeout=300_000) + fun `building Merkle tree one node`() { val node = 'a'.serialize().sha256() val mt = MerkleTree.getMerkleTree(listOf(node)) assertEquals(node, mt.hash) } - @Test - fun `building Merkle tree odd number of nodes`() { + @Test(timeout=300_000) + fun `building Merkle tree odd number of nodes`() { val odd = hashed.subList(0, 3) val h1 = hashed[0].hashConcat(hashed[1]) val h2 = hashed[2].hashConcat(zeroHash) @@ -127,8 +127,8 @@ class PartialMerkleTreeTest { assertEquals(mt.hash, expected) } - @Test - fun `check full tree`() { + @Test(timeout=300_000) + fun `check full tree`() { val h = SecureHash.randomSHA256() val left = MerkleTree.Node(h, MerkleTree.Node(h, MerkleTree.Leaf(h), MerkleTree.Leaf(h)), MerkleTree.Node(h, MerkleTree.Leaf(h), MerkleTree.Leaf(h))) @@ -139,8 +139,8 @@ class PartialMerkleTreeTest { PartialMerkleTree.build(MerkleTree.Leaf(h), listOf(h)) // Just a leaf. } - @Test - fun `building Merkle tree for a tx and nonce test`() { + @Test(timeout=300_000) + fun `building Merkle tree for a tx and nonce test`() { fun filtering(elem: Any): Boolean { return when (elem) { is StateRef -> true @@ -171,8 +171,8 @@ class PartialMerkleTreeTest { ftx.verify() } - @Test - fun `same transactions with different notaries have different ids`() { + @Test(timeout=300_000) + fun `same transactions with different notaries have different ids`() { // We even use the same privacySalt, and thus the only difference between the two transactions is the notary party. val privacySalt = PrivacySalt() val wtx1 = makeSimpleCashWtx(DUMMY_NOTARY, privacySalt) @@ -181,8 +181,8 @@ class PartialMerkleTreeTest { assertNotEquals(wtx1.id, wtx2.id) } - @Test - fun `nothing filtered`() { + @Test(timeout=300_000) + fun `nothing filtered`() { val ftxNothing = testTx.buildFilteredTransaction(Predicate { false }) assertTrue(ftxNothing.componentGroups.isEmpty()) assertTrue(ftxNothing.attachments.isEmpty()) @@ -197,57 +197,57 @@ class PartialMerkleTreeTest { } // Partial Merkle Tree building tests. - @Test - fun `build Partial Merkle Tree, only left nodes branch`() { + @Test(timeout=300_000) + fun `build Partial Merkle Tree, only left nodes branch`() { val inclHashes = listOf(hashed[3], hashed[5]) val pmt = PartialMerkleTree.build(merkleTree, inclHashes) assertTrue(pmt.verify(merkleTree.hash, inclHashes)) } - @Test - fun `build Partial Merkle Tree, include zero leaves`() { + @Test(timeout=300_000) + fun `build Partial Merkle Tree, include zero leaves`() { val pmt = PartialMerkleTree.build(merkleTree, emptyList()) assertTrue(pmt.verify(merkleTree.hash, emptyList())) } - @Test - fun `build Partial Merkle Tree, include all leaves`() { + @Test(timeout=300_000) + fun `build Partial Merkle Tree, include all leaves`() { val pmt = PartialMerkleTree.build(merkleTree, hashed) assertTrue(pmt.verify(merkleTree.hash, hashed)) } - @Test - fun `build Partial Merkle Tree - duplicate leaves failure`() { + @Test(timeout=300_000) + fun `build Partial Merkle Tree - duplicate leaves failure`() { val inclHashes = arrayListOf(hashed[3], hashed[5], hashed[3], hashed[5]) assertFailsWith { PartialMerkleTree.build(merkleTree, inclHashes) } } - @Test - fun `build Partial Merkle Tree - only duplicate leaves, less included failure`() { + @Test(timeout=300_000) + fun `build Partial Merkle Tree - only duplicate leaves, less included failure`() { val leaves = "aaa" val hashes = leaves.map { it.serialize().hash } val mt = MerkleTree.getMerkleTree(hashes) assertFailsWith { PartialMerkleTree.build(mt, hashes.subList(0, 1)) } } - @Test - fun `verify Partial Merkle Tree - too many leaves failure`() { + @Test(timeout=300_000) + fun `verify Partial Merkle Tree - too many leaves failure`() { val inclHashes = arrayListOf(hashed[3], hashed[5]) val pmt = PartialMerkleTree.build(merkleTree, inclHashes) inclHashes.add(hashed[0]) assertFalse(pmt.verify(merkleTree.hash, inclHashes)) } - @Test - fun `verify Partial Merkle Tree - too little leaves failure`() { + @Test(timeout=300_000) + fun `verify Partial Merkle Tree - too little leaves failure`() { val inclHashes = arrayListOf(hashed[3], hashed[5], hashed[0]) val pmt = PartialMerkleTree.build(merkleTree, inclHashes) inclHashes.remove(hashed[0]) assertFalse(pmt.verify(merkleTree.hash, inclHashes)) } - @Test - fun `verify Partial Merkle Tree - duplicate leaves failure`() { + @Test(timeout=300_000) + fun `verify Partial Merkle Tree - duplicate leaves failure`() { val mt = MerkleTree.getMerkleTree(hashed.subList(0, 5)) // Odd number of leaves. Last one is duplicated. val inclHashes = arrayListOf(hashed[3], hashed[4]) val pmt = PartialMerkleTree.build(mt, inclHashes) @@ -255,15 +255,15 @@ class PartialMerkleTreeTest { assertFalse(pmt.verify(mt.hash, inclHashes)) } - @Test - fun `verify Partial Merkle Tree - different leaves failure`() { + @Test(timeout=300_000) + fun `verify Partial Merkle Tree - different leaves failure`() { val inclHashes = arrayListOf(hashed[3], hashed[5]) val pmt = PartialMerkleTree.build(merkleTree, inclHashes) assertFalse(pmt.verify(merkleTree.hash, listOf(hashed[2], hashed[4]))) } - @Test - fun `verify Partial Merkle Tree - wrong root`() { + @Test(timeout=300_000) + fun `verify Partial Merkle Tree - wrong root`() { val inclHashes = listOf(hashed[3], hashed[5]) val pmt = PartialMerkleTree.build(merkleTree, inclHashes) val wrongRoot = hashed[3].hashConcat(hashed[5]) @@ -293,8 +293,8 @@ class PartialMerkleTreeTest { ) } - @Test - fun `Find leaf index`() { + @Test(timeout=300_000) + fun `Find leaf index`() { // A Merkle tree with 20 leaves. val sampleLeaves = IntStream.rangeClosed(0, 19).toList().map { SecureHash.sha256(it.toString()) } val merkleTree = MerkleTree.getMerkleTree(sampleLeaves) @@ -339,8 +339,8 @@ class PartialMerkleTreeTest { assertFailsWith { pmtAllIncluded.leafIndex(SecureHash.sha256("30")) } } - @Test - fun `building Merkle for reference states only`() { + @Test(timeout=300_000) + fun `building Merkle for reference states only`() { fun filtering(elem: Any): Boolean { return when (elem) { is ReferenceStateRef -> true diff --git a/core-tests/src/test/kotlin/net/corda/coretests/crypto/SignedDataTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/crypto/SignedDataTest.kt index 0d5e7fb361..b1475eb85a 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/crypto/SignedDataTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/crypto/SignedDataTest.kt @@ -25,8 +25,8 @@ class SignedDataTest { val data = "Just a simple test string" lateinit var serialized: SerializedBytes - @Test - fun `make sure correctly signed data is released`() { + @Test(timeout=300_000) + fun `make sure correctly signed data is released`() { val keyPair = generateKeyPair() val sig = keyPair.private.sign(serialized.bytes, keyPair.public) val wrappedData = SignedData(serialized, sig) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/crypto/TransactionSignatureTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/crypto/TransactionSignatureTest.kt index e3a38ee443..1d4220ca4e 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/crypto/TransactionSignatureTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/crypto/TransactionSignatureTest.kt @@ -21,8 +21,8 @@ class TransactionSignatureTest { private val testBytes = "12345678901234567890123456789012".toByteArray() /** Valid sign and verify. */ - @Test - fun `Signature metadata full sign and verify`() { + @Test(timeout=300_000) + fun `Signature metadata full sign and verify`() { val keyPair = Crypto.generateKeyPair("ECDSA_SECP256K1_SHA256") // Create a SignableData object. @@ -47,8 +47,8 @@ class TransactionSignatureTest { Crypto.doVerify((testBytes + testBytes).sha256(), transactionSignature) } - @Test - fun `Verify multi-tx signature`() { + @Test(timeout=300_000) + fun `Verify multi-tx signature`() { val keyPair = Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, BigInteger.valueOf(1234567890L)) // Deterministically create 5 txIds. val txIds: List = IntRange(0, 4).map { byteArrayOf(it.toByte()).sha256() } @@ -94,8 +94,8 @@ class TransactionSignatureTest { } } - @Test - fun `Verify one-tx signature`() { + @Test(timeout=300_000) + fun `Verify one-tx signature`() { val keyPair = Crypto.deriveKeyPairFromEntropy(Crypto.EDDSA_ED25519_SHA512, BigInteger.valueOf(1234567890L)) val txId = "aTransaction".toByteArray().sha256() // One-tx signature. diff --git a/core-tests/src/test/kotlin/net/corda/coretests/crypto/X509NameConstraintsTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/crypto/X509NameConstraintsTest.kt index cb285c5aff..46a941f3f9 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/crypto/X509NameConstraintsTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/crypto/X509NameConstraintsTest.kt @@ -57,8 +57,8 @@ class X509NameConstraintsTest { return Pair(keyStore, trustStore) } - @Test - fun `illegal common name`() { + @Test(timeout=300_000) + fun `illegal common name`() { val acceptableNames = listOf("CN=Bank A TLS, O=Bank A", "CN=Bank A") .map { GeneralSubtree(GeneralName(X500Name(it))) }.toTypedArray() @@ -92,8 +92,8 @@ class X509NameConstraintsTest { } } - @Test - fun `x500 name with correct cn and extra attribute`() { + @Test(timeout=300_000) + fun `x500 name with correct cn and extra attribute`() { val acceptableNames = listOf("CN=Bank A TLS, UID=", "O=Bank A") .map { GeneralSubtree(GeneralName(X500Name(it))) }.toTypedArray() @@ -135,8 +135,8 @@ class X509NameConstraintsTest { } } - @Test - fun `test private key retrieval`() { + @Test(timeout=300_000) + fun `test private key retrieval`() { val acceptableNames = listOf("CN=Bank A TLS, UID=", "O=Bank A") .map { GeneralSubtree(GeneralName(X500Name(it))) }.toTypedArray() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt index f13ddbf5d0..445cfc4eb0 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt @@ -45,8 +45,8 @@ class AttachmentTests : WithMockNet { private val bobNode = makeNode(BOB_NAME) private val alice = aliceNode.info.singleIdentity() - @Test - fun `download and store`() { + @Test(timeout=300_000) + fun `download and store`() { // Insert an attachment into node zero's store directly. val id = aliceNode.importAttachment(fakeAttachment("file1.txt", "Some useful content")) @@ -67,8 +67,8 @@ class AttachmentTests : WithMockNet { willReturn(soleAttachment(attachment))) } - @Test - fun missing() { + @Test(timeout=300_000) + fun missing() { val hash: SecureHash = SecureHash.randomSHA256() // Get node one to fetch a non-existent attachment. @@ -82,8 +82,8 @@ class AttachmentTests : WithMockNet { FetchDataFlow.HashNotFound::requested, equalTo(expected)) - @Test - fun maliciousResponse() { + @Test(timeout=300_000) + fun maliciousResponse() { // Make a node that doesn't do sanity checking at load time. val badAliceNode = makeBadNode(ALICE_NAME) val badAlice = badAliceNode.info.singleIdentity() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt index dfce7af1b2..e0c6a4fd17 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt @@ -67,8 +67,8 @@ class CollectSignaturesFlowTests : WithContracts { private val bob = bobNode.info.singleIdentity() private val charlie = charlieNode.info.singleIdentity() - @Test - fun `successfully collects three signatures`() { + @Test(timeout=300_000) + fun `successfully collects three signatures`() { val bConfidentialIdentity = bobNode.createConfidentialIdentity(bob) aliceNode.verifyAndRegister(bConfidentialIdentity) @@ -78,8 +78,8 @@ class CollectSignaturesFlowTests : WithContracts { ) } - @Test - fun `successfully collects signatures when sessions are initiated with AnonymousParty`() { + @Test(timeout=300_000) + fun `successfully collects signatures when sessions are initiated with AnonymousParty`() { val aConfidentialIdentity1 = aliceNode.createConfidentialIdentity(alice) val bConfidentialIdentity1 = bobNode.createConfidentialIdentity(bob) val bConfidentialIdentity2 = bobNode.createConfidentialIdentity(bob) @@ -97,8 +97,8 @@ class CollectSignaturesFlowTests : WithContracts { Assert.assertThat(missingSigners, `is`(emptySet())) } - @Test - fun `successfully collects signatures when sessions are initiated with both AnonymousParty and WellKnownParty`() { + @Test(timeout=300_000) + fun `successfully collects signatures when sessions are initiated with both AnonymousParty and WellKnownParty`() { val aConfidentialIdentity1 = aliceNode.createConfidentialIdentity(alice) val bConfidentialIdentity1 = bobNode.createConfidentialIdentity(bob) val bConfidentialIdentity2 = bobNode.createConfidentialIdentity(bob) @@ -142,8 +142,8 @@ class CollectSignaturesFlowTests : WithContracts { future.getOrThrow() } - @Test - fun `it is possible to collect from multiple well known sessions`() { + @Test(timeout=300_000) + fun `it is possible to collect from multiple well known sessions`() { bobNode.registerInitiatedFlow(ExtraSessionsFlowResponder::class.java) charlieNode.registerInitiatedFlow(ExtraSessionsFlowResponder::class.java) val future = aliceNode.startFlow(ExtraSessionsFlow(listOf( @@ -157,8 +157,8 @@ class CollectSignaturesFlowTests : WithContracts { Assert.assertThat(signedTx.getMissingSigners(), `is`(emptySet())) } - @Test - fun `no need to collect any signatures`() { + @Test(timeout=300_000) + fun `no need to collect any signatures`() { val ptx = aliceNode.signDummyContract(alice.ref(1)) assertThat( @@ -167,8 +167,8 @@ class CollectSignaturesFlowTests : WithContracts { ) } - @Test - fun `fails when not signed by initiator`() { + @Test(timeout=300_000) + fun `fails when not signed by initiator`() { val ptx = miniCorpServices.signDummyContract(alice.ref(1)) assertThat( @@ -176,8 +176,8 @@ class CollectSignaturesFlowTests : WithContracts { willThrow(errorMessage("The Initiator of CollectSignaturesFlow must have signed the transaction."))) } - @Test - fun `passes with multiple initial signatures`() { + @Test(timeout=300_000) + fun `passes with multiple initial signatures`() { val signedByA = aliceNode.signDummyContract( alice.ref(1), MAGIC_NUMBER, diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt index c06f091601..1c00ee69de 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt @@ -42,8 +42,8 @@ class ContractUpgradeFlowRPCTest : WithContracts, WithFinality { private val alice = aliceNode.info.singleIdentity() private val bob = bobNode.info.singleIdentity() - @Test - fun `2 parties contract upgrade using RPC`() = rpcDriver { + @Test(timeout=300_000) + fun `2 parties contract upgrade using RPC`() = rpcDriver { val testUser = createTestUser() val rpcA = startProxy(aliceNode, testUser) val rpcB = startProxy(bobNode, testUser) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt index b391e5cce2..7121630864 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt @@ -46,8 +46,8 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality { private val bob = bobNode.info.singleIdentity() private val notary = mockNet.defaultNotaryIdentity - @Test - fun `2 parties contract upgrade`() { + @Test(timeout=300_000) + fun `2 parties contract upgrade`() { // Create dummy contract. val signedByA = aliceNode.signDummyContract(alice.ref(1), 0, bob.ref(1)) val stx = bobNode.addSignatureTo(signedByA) @@ -116,8 +116,8 @@ class ContractUpgradeFlowTest : WithContracts, WithFinality { { it.state.data }, expectation) - @Test - fun `upgrade Cash to v2`() { + @Test(timeout=300_000) + fun `upgrade Cash to v2`() { // Create some cash. val cashFlowResult = aliceNode.issueCash() val anonymisedRecipient = cashFlowResult.recipient!! diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FastThreadLocalTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FastThreadLocalTest.kt index 4655a955b7..f029492750 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FastThreadLocalTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FastThreadLocalTest.kt @@ -31,8 +31,8 @@ class FastThreadLocalTest { private val expensiveObjCount = AtomicInteger() - @Test - fun `ThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) { + @Test(timeout=300_000) + fun `ThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) { val threadLocal = object : ThreadLocal() { override fun initialValue() = ExpensiveObj() } @@ -40,8 +40,8 @@ class FastThreadLocalTest { assertEquals(100, expensiveObjCount.get()) } - @Test - fun `ThreadLocal with FastThreadLocalThread is fiber-local`() = scheduled(3, ::FastThreadLocalThread) { + @Test(timeout=300_000) + fun `ThreadLocal with FastThreadLocalThread is fiber-local`() = scheduled(3, ::FastThreadLocalThread) { val threadLocal = object : ThreadLocal() { override fun initialValue() = ExpensiveObj() } @@ -49,8 +49,8 @@ class FastThreadLocalTest { assertEquals(100, expensiveObjCount.get()) } - @Test - fun `FastThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) { + @Test(timeout=300_000) + fun `FastThreadLocal with plain old Thread is fiber-local`() = scheduled(3, ::Thread) { val threadLocal = object : FastThreadLocal() { override fun initialValue() = ExpensiveObj() } @@ -58,8 +58,8 @@ class FastThreadLocalTest { assertEquals(100, expensiveObjCount.get()) } - @Test - fun `FastThreadLocal with FastThreadLocalThread is not fiber-local`() = + @Test(timeout=300_000) + fun `FastThreadLocal with FastThreadLocalThread is not fiber-local`() = scheduled(3, ::FastThreadLocalThread) { val threadLocal = object : FastThreadLocal() { override fun initialValue() = ExpensiveObj() @@ -89,15 +89,15 @@ class FastThreadLocalTest { private val fail: Nothing by lazy { throw UnsupportedOperationException("Nice try.") } } - @Test - fun `ThreadLocal content is not serialized`() { + @Test(timeout=300_000) + fun `ThreadLocal content is not serialized`() { contentIsNotSerialized(object : ThreadLocal() { override fun initialValue() = UnserializableObj() }::get) } - @Test - fun `FastThreadLocal content is not serialized`() { + @Test(timeout=300_000) + fun `FastThreadLocal content is not serialized`() { contentIsNotSerialized(object : FastThreadLocal() { override fun initialValue() = UnserializableObj() }::get) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt index e49bf95282..ef37af8364 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt @@ -34,8 +34,8 @@ class FinalityFlowTests : WithFinality { @After fun tearDown() = mockNet.stopNodes() - @Test - fun `finalise a simple transaction`() { + @Test(timeout=300_000) + fun `finalise a simple transaction`() { val bob = createBob() val stx = aliceNode.issuesCashTo(bob) @@ -46,8 +46,8 @@ class FinalityFlowTests : WithFinality { and visibleTo(bob))) } - @Test - fun `reject a transaction with unknown parties`() { + @Test(timeout=300_000) + fun `reject a transaction with unknown parties`() { // Charlie isn't part of this network, so node A won't recognise them val stx = aliceNode.issuesCashTo(CHARLIE) @@ -56,8 +56,8 @@ class FinalityFlowTests : WithFinality { willThrow()) } - @Test - fun `allow use of the old API if the CorDapp target version is 3`() { + @Test(timeout=300_000) + fun `allow use of the old API if the CorDapp target version is 3`() { val oldBob = createBob(cordapps = listOf(tokenOldCordapp())) val stx = aliceNode.issuesCashTo(oldBob) val resultFuture = CordappResolver.withTestCordapp(targetPlatformVersion = 3) { @@ -68,8 +68,8 @@ class FinalityFlowTests : WithFinality { assertThat(oldBob.services.validatedTransactions.getTransaction(stx.id)).isNotNull() } - @Test - fun `broadcasting to both new and old participants`() { + @Test(timeout=300_000) + fun `broadcasting to both new and old participants`() { val newCharlie = mockNet.createNode(InternalMockNodeParameters(legalName = CHARLIE_NAME)) val oldBob = createBob(cordapps = listOf(tokenOldCordapp())) val stx = aliceNode.issuesCashTo(oldBob) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalAsyncOperationTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalAsyncOperationTest.kt index 5e9b36e67b..a9d7438347 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalAsyncOperationTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalAsyncOperationTest.kt @@ -28,8 +28,8 @@ import kotlin.test.assertTrue class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { - @Test - fun `external async operation`() { + @Test(timeout=300_000) + fun `external async operation`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -41,8 +41,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation that checks deduplicationId is not rerun when flow is retried`() { + @Test(timeout=300_000) + fun `external async operation that checks deduplicationId is not rerun when flow is retried`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -58,8 +58,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation propagates exception to calling flow`() { + @Test(timeout=300_000) + fun `external async operation propagates exception to calling flow`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -76,8 +76,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation exception can be caught in flow`() { + @Test(timeout=300_000) + fun `external async operation exception can be caught in flow`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -92,8 +92,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation with exception that hospital keeps for observation does not fail`() { + @Test(timeout=300_000) + fun `external async operation with exception that hospital keeps for observation does not fail`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -110,8 +110,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation with exception that hospital discharges is retried and runs the future again`() { + @Test(timeout=300_000) + fun `external async operation with exception that hospital discharges is retried and runs the future again`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -128,8 +128,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation that throws exception rather than completing future exceptionally fails with internal exception`() { + @Test(timeout=300_000) + fun `external async operation that throws exception rather than completing future exceptionally fails with internal exception`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -143,8 +143,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation that passes serviceHub into process can be retried`() { + @Test(timeout=300_000) + fun `external async operation that passes serviceHub into process can be retried`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -160,8 +160,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation that accesses serviceHub from flow directly will fail when retried`() { + @Test(timeout=300_000) + fun `external async operation that accesses serviceHub from flow directly will fail when retried`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -177,8 +177,8 @@ class FlowExternalAsyncOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `starting multiple futures and joining on their results`() { + @Test(timeout=300_000) + fun `starting multiple futures and joining on their results`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationStartFlowTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationStartFlowTest.kt index 57affca1a2..a1385d5563 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationStartFlowTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationStartFlowTest.kt @@ -16,8 +16,8 @@ import kotlin.test.assertEquals class FlowExternalOperationStartFlowTest : AbstractFlowExternalOperationTest() { - @Test - fun `starting a flow inside of a flow that starts a future will succeed`() { + @Test(timeout=300_000) + fun `starting a flow inside of a flow that starts a future will succeed`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -29,8 +29,8 @@ class FlowExternalOperationStartFlowTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `multiple flows can be started and their futures joined from inside a flow`() { + @Test(timeout=300_000) + fun `multiple flows can be started and their futures joined from inside a flow`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationTest.kt index 1deb76f400..3d6fdea190 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FlowExternalOperationTest.kt @@ -35,8 +35,8 @@ import kotlin.test.assertTrue class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { - @Test - fun `external operation`() { + @Test(timeout=300_000) + fun `external operation`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -48,8 +48,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external operation that checks deduplicationId is not rerun when flow is retried`() { + @Test(timeout=300_000) + fun `external operation that checks deduplicationId is not rerun when flow is retried`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -65,8 +65,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external operation propagates exception to calling flow`() { + @Test(timeout=300_000) + fun `external operation propagates exception to calling flow`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -83,8 +83,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external operation exception can be caught in flow`() { + @Test(timeout=300_000) + fun `external operation exception can be caught in flow`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -96,8 +96,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external operation with exception that hospital keeps for observation does not fail`() { + @Test(timeout=300_000) + fun `external operation with exception that hospital keeps for observation does not fail`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -114,8 +114,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external operation with exception that hospital discharges is retried and runs the external operation again`() { + @Test(timeout=300_000) + fun `external operation with exception that hospital discharges is retried and runs the external operation again`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -132,8 +132,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation that passes serviceHub into process can be retried`() { + @Test(timeout=300_000) + fun `external async operation that passes serviceHub into process can be retried`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -149,8 +149,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external async operation that accesses serviceHub from flow directly will fail when retried`() { + @Test(timeout=300_000) + fun `external async operation that accesses serviceHub from flow directly will fail when retried`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() @@ -166,8 +166,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `vault can be queried`() { + @Test(timeout=300_000) + fun `vault can be queried`() { driver( DriverParameters( cordappsForAllNodes = cordappsForPackages(DummyState::class.packageName), @@ -181,8 +181,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `data can be persisted to node database via entity manager`() { + @Test(timeout=300_000) + fun `data can be persisted to node database via entity manager`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsViaEntityManager) @@ -191,8 +191,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `data can be persisted to node database via jdbc session`() { + @Test(timeout=300_000) + fun `data can be persisted to node database via jdbc session`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsViaJdbcSession) @@ -201,8 +201,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `data can be persisted to node database via servicehub database transaction`() { + @Test(timeout=300_000) + fun `data can be persisted to node database via servicehub database transaction`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsViaDatabaseTransaction) @@ -211,8 +211,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `data can be persisted to node database in external operation and read from another process once finished`() { + @Test(timeout=300_000) + fun `data can be persisted to node database in external operation and read from another process once finished`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val success = alice.rpc.startFlow(::FlowWithExternalOperationThatPersistsToDatabaseAndReadsFromExternalOperation) @@ -221,8 +221,8 @@ class FlowExternalOperationTest : AbstractFlowExternalOperationTest() { } } - @Test - fun `external operation can be retried when an error occurs inside of database transaction`() { + @Test(timeout=300_000) + fun `external operation can be retried when an error occurs inside of database transaction`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val bob = startNode(providedName = BOB_NAME).getOrThrow() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt index 1f83302dd3..92441fe7c6 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt @@ -32,8 +32,8 @@ class ReceiveMultipleFlowTests : WithMockNet { private val nodes = (0..2).map { mockNet.createPartyNode() } - @Test - fun showcase_flows_as_closures() { + @Test(timeout=300_000) + fun showcase_flows_as_closures() { val answer = 10.0 val message = "Hello Ivan" @@ -66,8 +66,8 @@ class ReceiveMultipleFlowTests : WithMockNet { willReturn(answer as Any)) } - @Test - fun `receive all messages in parallel using map style`() { + @Test(timeout=300_000) + fun `receive all messages in parallel using map style`() { val doubleValue = 5.0 nodes[1].registerAnswer(AlgorithmDefinition::class, doubleValue) val stringValue = "Thriller" @@ -78,8 +78,8 @@ class ReceiveMultipleFlowTests : WithMockNet { willReturn(doubleValue * stringValue.length)) } - @Test - fun `receive all messages in parallel using list style`() { + @Test(timeout=300_000) + fun `receive all messages in parallel using list style`() { val value1 = 5.0 nodes[1].registerAnswer(ParallelAlgorithmList::class, value1) val value2 = 6.0 diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveFinalityFlowTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveFinalityFlowTest.kt index 5dbca34b7b..6c50e4e2a2 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveFinalityFlowTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveFinalityFlowTest.kt @@ -33,8 +33,8 @@ class ReceiveFinalityFlowTest { mockNet.stopNodes() } - @Test - fun `sent to flow hospital on error and retry on node restart`() { + @Test(timeout=300_000) + fun `sent to flow hospital on error and retry on node restart`() { val alice = mockNet.createNode(InternalMockNodeParameters(legalName = ALICE_NAME, additionalCordapps = FINANCE_CORDAPPS)) // Bob initially does not have the finance contracts CorDapp so that it can throw an exception in ReceiveFinalityFlow when receiving // the payment from Alice diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReferencedStatesFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReferencedStatesFlowTests.kt index 49766bd3bf..5d1ea41cab 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReferencedStatesFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReferencedStatesFlowTests.kt @@ -44,8 +44,8 @@ class ReferencedStatesFlowTests { mockNet.stopNodes() } - @Test - fun `with referenced states flow blocks until the reference state update is received`() { + @Test(timeout=300_000) + fun `with referenced states flow blocks until the reference state update is received`() { // 1. Create reference state. val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow() val newRefState = newRefTx.tx.outRefsOfType().single() @@ -70,8 +70,8 @@ class ReferencedStatesFlowTests { assertEquals(updatedRefState.ref, result.tx.references.single()) } - @Test - fun `check ref state is persisted when used in tx with relevant states`() { + @Test(timeout=300_000) + fun `check ref state is persisted when used in tx with relevant states`() { // 1. Create a state to be used as a reference state. Don't share it. val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow() val newRefState = newRefTx.tx.outRefsOfType().single() @@ -102,8 +102,8 @@ class ReferencedStatesFlowTests { assertEquals(newRefState, theReferencedStateAgain.states.single()) } - @Test - fun `check schema mappings are updated for reference states`() { + @Test(timeout=300_000) + fun `check schema mappings are updated for reference states`() { // 1. Create a state to be used as a reference state. Don't share it. val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow() val newRefState = newRefTx.tx.outRefsOfType().single() @@ -118,8 +118,8 @@ class ReferencedStatesFlowTests { assertEquals(2, allRefStates.states.size) } - @Test - fun `check old ref state is consumed when update used in tx with relevant states`() { + @Test(timeout=300_000) + fun `check old ref state is consumed when update used in tx with relevant states`() { // 1. Create a state to be used as a reference state. Don't share it. val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow() val newRefState = newRefTx.tx.outRefsOfType().single() @@ -170,8 +170,8 @@ class ReferencedStatesFlowTests { assertEquals(Vault.StateStatus.CONSUMED, theOriginalReferencedStateOnNodeZero.statesMetadata.single().status) } - @Test - fun `check consumed reference state is found if a transaction refers to it`() { + @Test(timeout=300_000) + fun `check consumed reference state is found if a transaction refers to it`() { // 1. Create a state to be used as a reference state. Don't share it. val newRefTx = nodes[0].services.startFlow(CreateRefState()).resultFuture.getOrThrow() val newRefState = newRefTx.tx.outRefsOfType().single() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt index e00693f6cc..436e222b86 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt @@ -24,14 +24,14 @@ class PartyAndCertificateTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `reject a path with no roles`() { + @Test(timeout=300_000) + fun `reject a path with no roles`() { val path = X509Utilities.buildCertPath(DEV_ROOT_CA.certificate) assertFailsWith { PartyAndCertificate(path) } } - @Test - fun `kryo serialisation`() { + @Test(timeout=300_000) + fun `kryo serialisation`() { val original = getTestPartyAndCertificate(Party( CordaX500Name(organisation = "Test Corp", locality = "Madrid", country = "ES"), entropyToKeyPair(BigInteger.valueOf(83)).public)) @@ -41,8 +41,8 @@ class PartyAndCertificateTest { assertThat(copy.certificate).isEqualTo(original.certificate) } - @Test - fun `jdk serialization`() { + @Test(timeout=300_000) + fun `jdk serialization`() { val identity = getTestPartyAndCertificate(Party( CordaX500Name(organisation = "Test Corp", locality = "Madrid", country = "ES"), entropyToKeyPair(BigInteger.valueOf(83)).public)) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyTest.kt index 73a1652535..941a9f7e1f 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyTest.kt @@ -11,8 +11,8 @@ import kotlin.test.assertEquals import kotlin.test.assertNotEquals class PartyTest { - @Test - fun equality() { + @Test(timeout=300_000) + fun equality() { val key = entropyToKeyPair(BigInteger.valueOf(20170207L)).public val differentKey = entropyToKeyPair(BigInteger.valueOf(7201702L)).public val anonymousParty = AnonymousParty(key) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/internal/CertRoleTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/internal/CertRoleTests.kt index 8760c3d5f8..88e5e98474 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/internal/CertRoleTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/internal/CertRoleTests.kt @@ -10,15 +10,15 @@ import javax.security.auth.x500.X500Principal import kotlin.test.* class CertRoleTests { - @Test - fun `should deserialize valid value`() { + @Test(timeout=300_000) + fun `should deserialize valid value`() { val expected = CertRole.DOORMAN_CA val actual = CertRole.getInstance(ASN1Integer(1L)) assertEquals(expected, actual) } - @Test - fun `should reject invalid values`() { + @Test(timeout=300_000) + fun `should reject invalid values`() { // Below the lowest used value assertFailsWith { CertRole.getInstance(ASN1Integer(0L)) } // Outside of the array size, but a valid integer @@ -27,8 +27,8 @@ class CertRoleTests { assertFailsWith { CertRole.getInstance(ASN1Integer(Integer.MAX_VALUE + 1L)) } } - @Test - fun `check cert roles verify for various cert hierarchies`() { + @Test(timeout=300_000) + fun `check cert roles verify for various cert hierarchies`() { // Testing for various certificate hierarchies (with or without NodeCA). // ROOT -> Intermediate Root -> Doorman -> NodeCA -> Legal Identity cert -> Confidential key cert diff --git a/core-tests/src/test/kotlin/net/corda/coretests/internal/NetworkParametersResolutionTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/internal/NetworkParametersResolutionTest.kt index be15f8c450..544a597adb 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/internal/NetworkParametersResolutionTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/internal/NetworkParametersResolutionTest.kt @@ -111,8 +111,8 @@ class NetworkParametersResolutionTest { return Pair(dummy1, dummy2) } - @Test - fun `parameters all null`() { + @Test(timeout=300_000) + fun `parameters all null`() { val (stx1, stx2) = makeTransactions(null, null) assertThat(stx1.networkParametersHash).isNull() assertThat(stx2.networkParametersHash).isNull() @@ -126,8 +126,8 @@ class NetworkParametersResolutionTest { } } - @Test - fun `transaction chain out of order parameters`() { + @Test(timeout=300_000) + fun `transaction chain out of order parameters`() { val hash2 = params2.serialize().hash val hash3 = params3.serialize().hash val (stx1, stx2) = makeTransactions(params3, params2) @@ -151,8 +151,8 @@ class NetworkParametersResolutionTest { } } - @Test - fun `request parameters that are not in the storage`() { + @Test(timeout=300_000) + fun `request parameters that are not in the storage`() { val hash1 = defaultParams.serialize().hash val hash2 = params2.serialize().hash // Create two transactions on megaCorpNode @@ -175,8 +175,8 @@ class NetworkParametersResolutionTest { } } - @Test - fun `transaction chain out of order parameters with default`() { + @Test(timeout=300_000) + fun `transaction chain out of order parameters with default`() { val hash3 = params3.serialize().hash // stx1 with epoch 3 -> stx2 with default epoch, which is 1 val (stx1, stx2) = makeTransactions(params3, null) @@ -196,8 +196,8 @@ class NetworkParametersResolutionTest { } } - @Test - fun `incorrect triangle of transactions`() { + @Test(timeout=300_000) + fun `incorrect triangle of transactions`() { // stx1 with epoch 2, stx2 with epoch 1, stx3 with epoch 3 // stx1 -> stx2, stx1 -> stx3, stx2 -> stx3 val stx1 = makeTransactions(params2, null).first diff --git a/core-tests/src/test/kotlin/net/corda/coretests/internal/ResolveTransactionsFlowTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/internal/ResolveTransactionsFlowTest.kt index 8e31469636..ec7986082c 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/internal/ResolveTransactionsFlowTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/internal/ResolveTransactionsFlowTest.kt @@ -84,8 +84,8 @@ class ResolveTransactionsFlowTest { // DOCEND 3 // DOCSTART 1 - @Test - fun `resolve from two hashes`() { + @Test(timeout=300_000) + fun `resolve from two hashes`() { val (stx1, stx2) = makeTransactions() val p = TestFlow(setOf(stx2.id), megaCorp) val future = miniCorpNode.startFlow(p) @@ -98,8 +98,8 @@ class ResolveTransactionsFlowTest { } // DOCEND 1 - @Test - fun `dependency with an error`() { + @Test(timeout=300_000) + fun `dependency with an error`() { val stx = makeTransactions(signFirstTX = false).second val p = TestFlow(setOf(stx.id), megaCorp) val future = miniCorpNode.startFlow(p) @@ -107,8 +107,8 @@ class ResolveTransactionsFlowTest { assertFailsWith(SignedTransaction.SignaturesMissingException::class) { future.getOrThrow() } } - @Test - fun `resolve from a signed transaction`() { + @Test(timeout=300_000) + fun `resolve from a signed transaction`() { val (stx1, stx2) = makeTransactions() val p = TestFlow(stx2, megaCorp) val future = miniCorpNode.startFlow(p) @@ -121,8 +121,8 @@ class ResolveTransactionsFlowTest { } } - @Test - fun `triangle of transactions resolves fine`() { + @Test(timeout=300_000) + fun `triangle of transactions resolves fine`() { val stx1 = makeTransactions().first val stx2 = DummyContract.move(stx1.tx.outRef(0), miniCorp).let { builder -> @@ -149,8 +149,8 @@ class ResolveTransactionsFlowTest { future.getOrThrow() } - @Test - fun attachment() { + @Test(timeout=300_000) + fun attachment() { fun makeJar(): InputStream { val bs = ByteArrayOutputStream() val jar = JarOutputStream(bs) @@ -176,8 +176,8 @@ class ResolveTransactionsFlowTest { } } - @Test - fun `Requesting a transaction while having the right to see it succeeds`() { + @Test(timeout=300_000) + fun `Requesting a transaction while having the right to see it succeeds`() { val (_, stx2) = makeTransactions() val p = TestNoRightsVendingFlow(miniCorp, toVend = stx2, toRequest = stx2) val future = megaCorpNode.startFlow(p) @@ -185,8 +185,8 @@ class ResolveTransactionsFlowTest { future.getOrThrow() } - @Test - fun `Requesting a transaction without having the right to see it results in exception`() { + @Test(timeout=300_000) + fun `Requesting a transaction without having the right to see it results in exception`() { val (_, stx2) = makeTransactions() val (_, stx3) = makeTransactions() val p = TestNoRightsVendingFlow(miniCorp, toVend = stx2, toRequest = stx3) @@ -195,8 +195,8 @@ class ResolveTransactionsFlowTest { assertFailsWith { future.getOrThrow() } } - @Test - fun `Requesting a transaction twice results in exception`() { + @Test(timeout=300_000) + fun `Requesting a transaction twice results in exception`() { val (_, stx2) = makeTransactions() val p = TestResolveTwiceVendingFlow(miniCorp, stx2) val future = megaCorpNode.startFlow(p) @@ -204,8 +204,8 @@ class ResolveTransactionsFlowTest { assertFailsWith { future.getOrThrow() } } - @Test - fun `resolution works when transaction in chain is already resolved`() { + @Test(timeout=300_000) + fun `resolution works when transaction in chain is already resolved`() { val (tx1, tx2) = makeTransactions() miniCorpNode.transaction { miniCorpNode.services.recordTransactions(tx1) @@ -217,8 +217,8 @@ class ResolveTransactionsFlowTest { future.getOrThrow() } - @Test - fun `can resolve a chain of transactions containing a notary change transaction`() { + @Test(timeout=300_000) + fun `can resolve a chain of transactions containing a notary change transaction`() { val tx = notaryChangeChain() var numUpdates = 0 var notaryChangeTxSeen = false @@ -234,8 +234,8 @@ class ResolveTransactionsFlowTest { assertTrue(notaryChangeTxSeen) } - @Test - fun `can resolve a chain of transactions containing a contract upgrade transaction`() { + @Test(timeout=300_000) + fun `can resolve a chain of transactions containing a contract upgrade transaction`() { val tx = contractUpgradeChain() var numUpdates = 0 var upgradeTxSeen = false @@ -252,8 +252,8 @@ class ResolveTransactionsFlowTest { } // Used for checking larger chains resolve correctly. Note that this takes a long time to run, and so is not suitable for a CI gate. - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `Can resolve large chain of transactions`() { val txToResolve = makeLargeTransactionChain(2500) val p = TestFlow(txToResolve, megaCorp) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/node/NetworkParametersTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/node/NetworkParametersTest.kt index b74749d157..a9da9eada4 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/node/NetworkParametersTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/node/NetworkParametersTest.kt @@ -43,8 +43,8 @@ class NetworkParametersTest { } // Minimum Platform Version tests - @Test - fun `node shutdowns when on lower platform version than network`() { + @Test(timeout=300_000) + fun `node shutdowns when on lower platform version than network`() { val alice = mockNet.createUnstartedNode(InternalMockNodeParameters(legalName = ALICE_NAME, forcedID = 100, version = MOCK_VERSION_INFO.copy(platformVersion = 1))) val aliceDirectory = mockNet.baseDirectory(100) val netParams = testNetworkParameters( @@ -54,8 +54,8 @@ class NetworkParametersTest { assertThatThrownBy { alice.start() }.hasMessageContaining("platform version") } - @Test - fun `node works fine when on higher platform version`() { + @Test(timeout=300_000) + fun `node works fine when on higher platform version`() { val alice = mockNet.createUnstartedNode(InternalMockNodeParameters(legalName = ALICE_NAME, forcedID = 100, version = MOCK_VERSION_INFO.copy(platformVersion = 2))) val aliceDirectory = mockNet.baseDirectory(100) val netParams = testNetworkParameters( @@ -65,8 +65,8 @@ class NetworkParametersTest { alice.start() } - @Test - fun `that we can copy while preserving the event horizon`() { + @Test(timeout=300_000) + fun `that we can copy while preserving the event horizon`() { // this is defensive tests in response to CORDA-2769 val aliceNotaryParty = TestIdentity(ALICE_NAME).party val aliceNotaryInfo = NotaryInfo(aliceNotaryParty, false) @@ -94,8 +94,8 @@ class NetworkParametersTest { } // Notaries tests - @Test - fun `choosing notary not specified in network parameters will fail`() { + @Test(timeout=300_000) + fun `choosing notary not specified in network parameters will fail`() { val fakeNotary = mockNet.createNode( InternalMockNodeParameters( legalName = BOB_NAME, @@ -112,8 +112,8 @@ class NetworkParametersTest { } } - @Test - fun `package ownership checks are correct`() { + @Test(timeout=300_000) + fun `package ownership checks are correct`() { val key1 = generateKeyPair().public val key2 = generateKeyPair().public diff --git a/core-tests/src/test/kotlin/net/corda/coretests/node/NodeInfoTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/node/NodeInfoTests.kt index fd4c3a66d0..8a585989a9 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/node/NodeInfoTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/node/NodeInfoTests.kt @@ -31,14 +31,14 @@ class NodeInfoTests { ) } - @Test - fun `should return true when the X500Name is present on the node`() { + @Test(timeout=300_000) + fun `should return true when the X500Name is present on the node`() { assertTrue(testNode.isLegalIdentity(party1.name), "Party 1 must exist on the node") assertTrue(testNode.isLegalIdentity(party2.name), "Party 2 must exist on the node") } - @Test - fun `should return false when the X500Name is not present on the node`() { + @Test(timeout=300_000) + fun `should return false when the X500Name is not present on the node`() { assertFalse(testNode.isLegalIdentity(TestIdentity.fresh("party3").name), "Party 3 must not exist on the node") } diff --git a/core-tests/src/test/kotlin/net/corda/coretests/node/VaultUpdateTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/node/VaultUpdateTests.kt index aac1df8d6d..3bf7e3835f 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/node/VaultUpdateTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/node/VaultUpdateTests.kt @@ -41,54 +41,54 @@ class VaultUpdateTests { private val stateAndRef3 = StateAndRef(TransactionState(DummyState(), DUMMY_PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint), stateRef3) private val stateAndRef4 = StateAndRef(TransactionState(DummyState(), DUMMY_PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint), stateRef4) - @Test - fun `nothing plus nothing is nothing`() { + @Test(timeout=300_000) + fun `nothing plus nothing is nothing`() { val before = emptyUpdate val after = before + emptyUpdate assertEquals(before, after) } - @Test - fun `something plus nothing is something`() { + @Test(timeout=300_000) + fun `something plus nothing is something`() { val before = Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef2, stateAndRef3)) val after = before + emptyUpdate assertEquals(before, after) } - @Test - fun `nothing plus something is something`() { + @Test(timeout=300_000) + fun `nothing plus something is something`() { val before = emptyUpdate val after = before + Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef2, stateAndRef3)) val expected = Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef2, stateAndRef3)) assertEquals(expected, after) } - @Test - fun `something plus consume state 0 is something without state 0 output`() { + @Test(timeout=300_000) + fun `something plus consume state 0 is something without state 0 output`() { val before = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1)) val after = before + Vault.Update(setOf(stateAndRef0), setOf()) val expected = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef1)) assertEquals(expected, after) } - @Test - fun `something plus produce state 4 is something with additional state 4 output`() { + @Test(timeout=300_000) + fun `something plus produce state 4 is something with additional state 4 output`() { val before = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1)) val after = before + Vault.Update(setOf(), setOf(stateAndRef4)) val expected = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1, stateAndRef4)) assertEquals(expected, after) } - @Test - fun `something plus consume states 0 and 1, and produce state 4, is something without state 0 and 1 outputs and only state 4 output`() { + @Test(timeout=300_000) + fun `something plus consume states 0 and 1, and produce state 4, is something without state 0 and 1 outputs and only state 4 output`() { val before = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1)) val after = before + Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef4)) val expected = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef4)) assertEquals(expected, after) } - @Test - fun `can't combine updates of different types`() { + @Test(timeout=300_000) + fun `can't combine updates of different types`() { val regularUpdate = Vault.Update(setOf(stateAndRef0, stateAndRef1), setOf(stateAndRef4)) val notaryChangeUpdate = Vault.Update(setOf(stateAndRef2, stateAndRef3), setOf(stateAndRef0, stateAndRef1), type = Vault.UpdateType.NOTARY_CHANGE) assertFailsWith { regularUpdate + notaryChangeUpdate } diff --git a/core-tests/src/test/kotlin/net/corda/coretests/schemas/MappedSchemasCrossReferenceDetectionTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/schemas/MappedSchemasCrossReferenceDetectionTests.kt index 1d6b0ef145..db2d79fde8 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/schemas/MappedSchemasCrossReferenceDetectionTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/schemas/MappedSchemasCrossReferenceDetectionTests.kt @@ -54,56 +54,56 @@ class MappedSchemasCrossReferenceDetectionTests { ) : PersistentState() } - @Test - fun `no cross reference to other schema`() { + @Test(timeout=300_000) + fun `no cross reference to other schema`() { assertThat(fieldsFromOtherMappedSchema(GoodSchema)).isEmpty() assertThat(methodsFromOtherMappedSchema(GoodSchema)).isEmpty() } - @Test - fun `cross reference to other schema is detected`() { + @Test(timeout=300_000) + fun `cross reference to other schema is detected`() { assertThat(fieldsFromOtherMappedSchema(BadSchema)).isNotEmpty assertThat(methodsFromOtherMappedSchema(BadSchema)).isEmpty() } - @Test - fun `cross reference via non JPA field is allowed`() { + @Test(timeout=300_000) + fun `cross reference via non JPA field is allowed`() { assertThat(fieldsFromOtherMappedSchema(TrickySchema)).isEmpty() assertThat(methodsFromOtherMappedSchema(TrickySchema)).isEmpty() } - @Test - fun `cross reference via transient field is allowed`() { + @Test(timeout=300_000) + fun `cross reference via transient field is allowed`() { assertThat(fieldsFromOtherMappedSchema(PoliteSchema)).isEmpty() assertThat(methodsFromOtherMappedSchema(PoliteSchema)).isEmpty() } - @Test - fun `no cross reference to other schema java`() { + @Test(timeout=300_000) + fun `no cross reference to other schema java`() { assertThat(fieldsFromOtherMappedSchema(GoodSchemaJavaV1())).isEmpty() assertThat(methodsFromOtherMappedSchema(GoodSchemaJavaV1())).isEmpty() } - @Test - fun `cross reference to other schema is detected java`() { + @Test(timeout=300_000) + fun `cross reference to other schema is detected java`() { assertThat(fieldsFromOtherMappedSchema(BadSchemaJavaV1())).isEmpty() assertThat(methodsFromOtherMappedSchema(BadSchemaJavaV1())).isNotEmpty } - @Test - fun `cross reference to other schema via field is detected java`() { + @Test(timeout=300_000) + fun `cross reference to other schema via field is detected java`() { assertThat(fieldsFromOtherMappedSchema(BadSchemaNoGetterJavaV1())).isNotEmpty assertThat(methodsFromOtherMappedSchema(BadSchemaNoGetterJavaV1())).isEmpty() } - @Test - fun `cross reference via non JPA field is allowed java`() { + @Test(timeout=300_000) + fun `cross reference via non JPA field is allowed java`() { assertThat(fieldsFromOtherMappedSchema(TrickySchemaJavaV1())).isEmpty() assertThat(methodsFromOtherMappedSchema(TrickySchemaJavaV1())).isEmpty() } - @Test - fun `cross reference via transient field is allowed java`() { + @Test(timeout=300_000) + fun `cross reference via transient field is allowed java`() { assertThat(fieldsFromOtherMappedSchema(PoliteSchemaJavaV1())).isEmpty() assertThat(methodsFromOtherMappedSchema(PoliteSchemaJavaV1())).isEmpty() } diff --git a/core-tests/src/test/kotlin/net/corda/coretests/serialization/AttachmentSerializationTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/serialization/AttachmentSerializationTest.kt index ca326edb00..1fed709a98 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/serialization/AttachmentSerializationTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/serialization/AttachmentSerializationTest.kt @@ -169,23 +169,23 @@ class AttachmentSerializationTest { return (client.smm.allStateMachines[0].stateMachine.resultFuture.apply { mockNet.runNetwork() }.getOrThrow() as ClientResult).attachmentContent } - @Test - fun `custom (and non-persisted) attachment should be saved in checkpoint`() { + @Test(timeout=300_000) + fun `custom (and non-persisted) attachment should be saved in checkpoint`() { val attachmentId = SecureHash.sha256("any old data") launchFlow(CustomAttachmentLogic(serverIdentity, attachmentId, "custom"), 1) assertEquals("custom", rebootClientAndGetAttachmentContent()) } - @Test - fun `custom attachment should be saved in checkpoint even if its data was persisted`() { + @Test(timeout=300_000) + fun `custom attachment should be saved in checkpoint even if its data was persisted`() { val attachmentId = client.saveAttachment("genuine") launchFlow(CustomAttachmentLogic(serverIdentity, attachmentId, "custom"), 1) client.hackAttachment(attachmentId, "hacked") // Should not be reloaded, checkAttachmentsOnLoad may cause next line to blow up if client attempts it. assertEquals("custom", rebootClientAndGetAttachmentContent()) } - @Test - fun `only the hash of a regular attachment should be saved in checkpoint`() { + @Test(timeout=300_000) + fun `only the hash of a regular attachment should be saved in checkpoint`() { val attachmentId = client.saveAttachment("genuine") client.attachments.checkAttachmentsOnLoad = false // Cached by AttachmentImpl. launchFlow(OpenAttachmentLogic(serverIdentity, attachmentId), 1) @@ -193,8 +193,8 @@ class AttachmentSerializationTest { assertEquals("hacked", rebootClientAndGetAttachmentContent(false)) // Pass in false to allow non-genuine data to be loaded. } - @Test - fun `only the hash of a FetchAttachmentsFlow attachment should be saved in checkpoint`() { + @Test(timeout=300_000) + fun `only the hash of a FetchAttachmentsFlow attachment should be saved in checkpoint`() { val attachmentId = server.saveAttachment("genuine") launchFlow(FetchAttachmentLogic(serverIdentity, attachmentId), 2, sendData = true) client.hackAttachment(attachmentId, "hacked") diff --git a/core-tests/src/test/kotlin/net/corda/coretests/serialization/CommandsSerializationTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/serialization/CommandsSerializationTests.kt index 7b236e14ca..705ef9a641 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/serialization/CommandsSerializationTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/serialization/CommandsSerializationTests.kt @@ -14,8 +14,8 @@ class CommandsSerializationTests { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `test cash move serialization`() { + @Test(timeout=300_000) + fun `test cash move serialization`() { val command = Cash.Commands.Move(CommercialPaper::class.java) val copiedCommand = command.serialize().deserialize() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/serialization/NotaryExceptionSerializationTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/serialization/NotaryExceptionSerializationTest.kt index 5bb7317ca1..9ea9c119da 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/serialization/NotaryExceptionSerializationTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/serialization/NotaryExceptionSerializationTest.kt @@ -19,8 +19,8 @@ class NotaryExceptionSerializationTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun testSerializationRoundTrip() { + @Test(timeout=300_000) + fun testSerializationRoundTrip() { val txhash = SecureHash.randomSHA256() val stateHistory: Map = mapOf( StateRef(txhash, 0) to StateConsumptionDetails(txhash.sha256()) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt index ef629ca54e..b305a49610 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt @@ -93,8 +93,8 @@ class TransactionSerializationTests { tx = TransactionBuilder(DUMMY_NOTARY).withItems(inputState, outputState, changeState, Command(TestCash.Commands.Move(), arrayListOf(MEGA_CORP.owningKey))) } - @Test - fun signWireTX() { + @Test(timeout=300_000) + fun signWireTX() { val ptx = megaCorpServices.signInitialTransaction(tx) val stx = notaryServices.addSignature(ptx) @@ -111,8 +111,8 @@ class TransactionSerializationTests { } } - @Test - fun wrongKeys() { + @Test(timeout=300_000) + fun wrongKeys() { val ptx = megaCorpServices.signInitialTransaction(tx) val stx = notaryServices.addSignature(ptx) @@ -134,16 +134,16 @@ class TransactionSerializationTests { } } - @Test - fun timeWindow() { + @Test(timeout=300_000) + fun timeWindow() { tx.setTimeWindow(TEST_TX_TIME, 30.seconds) val ptx = megaCorpServices.signInitialTransaction(tx) val stx = notaryServices.addSignature(ptx) assertEquals(TEST_TX_TIME, stx.tx.timeWindow?.midpoint) } - @Test - fun storeAndLoadWhenSigning() { + @Test(timeout=300_000) + fun storeAndLoadWhenSigning() { val ptx = megaCorpServices.signInitialTransaction(tx) ptx.verifySignaturesExcept(DUMMY_NOTARY_KEY.public) val stored = ptx.serialize() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderSerializationTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderSerializationTests.kt index bf9fe5e34d..5cfaf252cb 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderSerializationTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderSerializationTests.kt @@ -41,8 +41,8 @@ class AttachmentsClassLoaderSerializationTests { private val storage = InternalMockAttachmentStorage(MockAttachmentStorage()) private val attachmentTrustCalculator = NodeAttachmentTrustCalculator(storage, TestingNamedCacheFactory()) - @Test - fun `Can serialize and deserialize with an attachment classloader`() { + @Test(timeout=300_000) + fun `Can serialize and deserialize with an attachment classloader`() { val DUMMY_NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 20).party val MEGA_CORP = TestIdentity(CordaX500Name("MegaCorp", "London", "GB")).party @@ -77,8 +77,8 @@ class AttachmentsClassLoaderSerializationTests { } // These tests are not Attachment specific. Should they be removed? - @Test - fun `test serialization of SecureHash`() { + @Test(timeout=300_000) + fun `test serialization of SecureHash`() { val secureHash = SecureHash.randomSHA256() val bytes = secureHash.serialize() val copiedSecuredHash = bytes.deserialize() @@ -86,8 +86,8 @@ class AttachmentsClassLoaderSerializationTests { assertEquals(secureHash, copiedSecuredHash) } - @Test - fun `test serialization of OpaqueBytes`() { + @Test(timeout=300_000) + fun `test serialization of OpaqueBytes`() { val opaqueBytes = OpaqueBytes("0123456789".toByteArray()) val bytes = opaqueBytes.serialize() val copiedOpaqueBytes = bytes.deserialize() @@ -95,8 +95,8 @@ class AttachmentsClassLoaderSerializationTests { assertEquals(opaqueBytes, copiedOpaqueBytes) } - @Test - fun `test serialization of sub-sequence OpaqueBytes`() { + @Test(timeout=300_000) + fun `test serialization of sub-sequence OpaqueBytes`() { val bytesSequence = ByteSequence.of("0123456789".toByteArray(), 3, 2) val bytes = bytesSequence.serialize() val copiedBytesSequence = bytes.deserialize() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderTests.kt index 9007a7e28d..29edf8938e 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/AttachmentsClassLoaderTests.kt @@ -77,15 +77,15 @@ class AttachmentsClassLoaderTests { attachmentTrustCalculator = NodeAttachmentTrustCalculator(internalStorage, cacheFactory) } - @Test - fun `Loading AnotherDummyContract without using the AttachmentsClassLoader fails`() { + @Test(timeout=300_000) + fun `Loading AnotherDummyContract without using the AttachmentsClassLoader fails`() { assertFailsWith { Class.forName(ISOLATED_CONTRACT_CLASS_NAME) } } - @Test - fun `Dynamically load AnotherDummyContract from isolated contracts jar using the AttachmentsClassLoader`() { + @Test(timeout=300_000) + fun `Dynamically load AnotherDummyContract from isolated contracts jar using the AttachmentsClassLoader`() { val isolatedId = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar") val classloader = createClassloader(isolatedId) @@ -94,8 +94,8 @@ class AttachmentsClassLoaderTests { assertEquals("helloworld", contract.declaredField("magicString").value) } - @Test - fun `Test non-overlapping contract jar`() { + @Test(timeout=300_000) + fun `Test non-overlapping contract jar`() { val att1 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar") val att2 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH_V4.openStream(), "app", "isolated-4.0.jar") @@ -104,8 +104,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Test valid overlapping contract jar`() { + @Test(timeout=300_000) + fun `Test valid overlapping contract jar`() { val isolatedId = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar") val signedJar = signContractJar(ISOLATED_CONTRACTS_JAR_PATH, copyFirst = true) val isolatedSignedId = importAttachment(signedJar.first.toUri().toURL().openStream(), "app", "isolated-signed.jar") @@ -114,8 +114,8 @@ class AttachmentsClassLoaderTests { createClassloader(listOf(isolatedId, isolatedSignedId)) } - @Test - fun `Test non-overlapping different contract jars`() { + @Test(timeout=300_000) + fun `Test non-overlapping different contract jars`() { val att1 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", "isolated.jar") val att2 = importAttachment(FINANCE_CONTRACTS_CORDAPP.jarFile.inputStream(), "app", "finance.jar") @@ -123,8 +123,8 @@ class AttachmentsClassLoaderTests { createClassloader(listOf(att1, att2)) } - @Test - fun `Load text resources from AttachmentsClassLoader`() { + @Test(timeout=300_000) + fun `Load text resources from AttachmentsClassLoader`() { val att1 = importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file1.jar") val att2 = importAttachment(fakeAttachment("file2.txt", "some other data").inputStream(), "app", "file2.jar") @@ -136,8 +136,8 @@ class AttachmentsClassLoaderTests { assertEquals("some other data", txt1) } - @Test - fun `Test valid overlapping file condition`() { + @Test(timeout=300_000) + fun `Test valid overlapping file condition`() { val att1 = importAttachment(fakeAttachment("file1.txt", "same data", "file2.txt", "same other data").inputStream(), "app", "file1.jar") val att2 = importAttachment(fakeAttachment("file1.txt", "same data", "file3.txt", "same totally different").inputStream(), "app", "file2.jar") @@ -146,8 +146,8 @@ class AttachmentsClassLoaderTests { assertEquals("same data", txt) } - @Test - fun `No overlapping exception thrown on certain META-INF files`() { + @Test(timeout=300_000) + fun `No overlapping exception thrown on certain META-INF files`() { listOf("meta-inf/manifest.mf", "meta-inf/license", "meta-inf/test.dsa", "meta-inf/test.sf").forEach { path -> val att1 = importAttachment(fakeAttachment(path, "some data").inputStream(), "app", "file1.jar") val att2 = importAttachment(fakeAttachment(path, "some other data").inputStream(), "app", "file2.jar") @@ -156,16 +156,16 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Overlapping rules for META-INF SerializationWhitelist files`() { + @Test(timeout=300_000) + fun `Overlapping rules for META-INF SerializationWhitelist files`() { val att1 = importAttachment(fakeAttachment("meta-inf/services/net.corda.core.serialization.SerializationWhitelist", "some data").inputStream(), "app", "file1.jar") val att2 = importAttachment(fakeAttachment("meta-inf/services/net.corda.core.serialization.SerializationWhitelist", "some other data").inputStream(), "app", "file2.jar") createClassloader(listOf(att1, att2)) } - @Test - fun `Overlapping rules for META-INF random service files`() { + @Test(timeout=300_000) + fun `Overlapping rules for META-INF random service files`() { val att1 = importAttachment(fakeAttachment("meta-inf/services/com.example.something", "some data").inputStream(), "app", "file1.jar") val att2 = importAttachment(fakeAttachment("meta-inf/services/com.example.something", "some other data").inputStream(), "app", "file2.jar") @@ -174,8 +174,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Test overlapping file exception`() { + @Test(timeout=300_000) + fun `Test overlapping file exception`() { val att1 = storage.importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file1.jar") val att2 = storage.importAttachment(fakeAttachment("file1.txt", "some other data").inputStream(), "app", "file2.jar") @@ -184,8 +184,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `partial overlaps not possible`() { + @Test(timeout=300_000) + fun `partial overlaps not possible`() { // Cover a previous bug whereby overlap checking had been optimized to only check contract classes, which isn't // a valid optimization as code used by the contract class could then be overlapped. val att1 = importAttachment(ISOLATED_CONTRACTS_JAR_PATH.openStream(), "app", ISOLATED_CONTRACTS_JAR_PATH.file) @@ -195,8 +195,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Check platform independent path handling in attachment jars`() { + @Test(timeout=300_000) + fun `Check platform independent path handling in attachment jars`() { val att1 = importAttachment(fakeAttachment("/folder1/foldera/file1.txt", "some data").inputStream(), "app", "file1.jar") val att2 = importAttachment(fakeAttachment("\\folder1\\folderb\\file2.txt", "some other data").inputStream(), "app", "file2.jar") @@ -213,8 +213,8 @@ class AttachmentsClassLoaderTests { assertArrayEquals("some other data".toByteArray(), data2b) } - @Test - fun `Allow loading untrusted resource jars but only trusted jars that contain class files`() { + @Test(timeout=300_000) + fun `Allow loading untrusted resource jars but only trusted jars that contain class files`() { val trustedResourceJar = importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file0.jar") val untrustedResourceJar = importAttachment(fakeAttachment("file2.txt", "some malicious data").inputStream(), "untrusted", "file1.jar") val untrustedClassJar = importAttachment(fakeAttachment("/com/example/something/MaliciousClass.class", "some malicious data").inputStream(), "untrusted", "file2.jar") @@ -231,8 +231,8 @@ class AttachmentsClassLoaderTests { return jar.use { storage.importAttachment(jar, uploader, filename) } } - @Test - fun `Allow loading an untrusted contract jar if another attachment exists that was signed with the same keys and uploaded by a trusted uploader`() { + @Test(timeout=300_000) + fun `Allow loading an untrusted contract jar if another attachment exists that was signed with the same keys and uploaded by a trusted uploader`() { val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() val classJar = fakeAttachment( @@ -260,8 +260,8 @@ class AttachmentsClassLoaderTests { createClassloader(untrustedAttachment) } - @Test - fun `Allow loading an untrusted contract jar if another attachment exists that was signed by a trusted uploader - intersection of keys match existing attachment`() { + @Test(timeout=300_000) + fun `Allow loading an untrusted contract jar if another attachment exists that was signed by a trusted uploader - intersection of keys match existing attachment`() { val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() val keyPairC = Crypto.generateKeyPair() @@ -290,8 +290,8 @@ class AttachmentsClassLoaderTests { createClassloader(untrustedAttachment) } - @Test - fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys`() { + @Test(timeout=300_000) + fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys`() { val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() val untrustedClassJar = fakeAttachment( @@ -310,8 +310,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys and uploaded by a trusted uploader`() { + @Test(timeout=300_000) + fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys and uploaded by a trusted uploader`() { val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() val classJar = fakeAttachment( @@ -341,8 +341,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Attachments with inherited trust do not grant trust to attachments being loaded (no chain of trust)`() { + @Test(timeout=300_000) + fun `Attachments with inherited trust do not grant trust to attachments being loaded (no chain of trust)`() { val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() val keyPairC = Crypto.generateKeyPair() @@ -387,8 +387,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Cannot load an untrusted contract jar if it is signed by a blacklisted key even if there is another attachment signed by the same keys that is trusted`() { + @Test(timeout=300_000) + fun `Cannot load an untrusted contract jar if it is signed by a blacklisted key even if there is another attachment signed by the same keys that is trusted`() { val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() @@ -425,8 +425,8 @@ class AttachmentsClassLoaderTests { } } - @Test - fun `Allow loading a trusted attachment that is signed by a blacklisted key`() { + @Test(timeout=300_000) + fun `Allow loading a trusted attachment that is signed by a blacklisted key`() { val keyPairA = Crypto.generateKeyPair() attachmentTrustCalculator = NodeAttachmentTrustCalculator( diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/CompatibleTransactionTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/CompatibleTransactionTests.kt index a02a558d83..4fd185b5e0 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/CompatibleTransactionTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/CompatibleTransactionTests.kt @@ -69,8 +69,8 @@ class CompatibleTransactionTests { } private val wireTransactionA by lazy { WireTransaction(componentGroups = componentGroupsA, privacySalt = privacySalt) } - @Test - fun `Merkle root computations`() { + @Test(timeout=300_000) + fun `Merkle root computations`() { // Merkle tree computation is deterministic if the same salt and ordering are used. val wireTransactionB = WireTransaction(componentGroups = componentGroupsA, privacySalt = privacySalt) assertEquals(wireTransactionA, wireTransactionB) @@ -129,8 +129,8 @@ class CompatibleTransactionTests { assertEquals(wireTransactionA, WireTransaction(componentGroups = shuffledComponentGroupsA, privacySalt = privacySalt)) } - @Test - fun `WireTransaction constructors and compatibility`() { + @Test(timeout=300_000) + fun `WireTransaction constructors and compatibility`() { val groups = createComponentGroups(inputs, outputs, commands, attachments, notary, timeWindow, emptyList(), null) val wireTransactionOldConstructor = WireTransaction(groups, privacySalt) assertEquals(wireTransactionA, wireTransactionOldConstructor) @@ -198,8 +198,8 @@ class CompatibleTransactionTests { assertFails { WireTransaction(componentGroupsCompatibleEmptyNew, privacySalt) } } - @Test - fun `FilteredTransaction constructors and compatibility`() { + @Test(timeout=300_000) + fun `FilteredTransaction constructors and compatibility`() { // Filter out all of the components. val ftxNothing = wireTransactionA.buildFilteredTransaction(Predicate { false }) // Nothing filtered. // Although nothing filtered, we still receive the group hashes for the top level Merkle tree. @@ -295,8 +295,8 @@ class CompatibleTransactionTests { assertEquals(wireTransactionCompatibleA.componentGroups.map { it.groupIndex }.max()!!, ftxCompatibleNoInputs.groupHashes.size - 1) } - @Test - fun `Command visibility tests`() { + @Test(timeout=300_000) + fun `Command visibility tests`() { // 1st and 3rd commands require a signature from KEY_1. val twoCommandsforKey1 = listOf(dummyCommand(DUMMY_KEY_1.public, DUMMY_KEY_2.public), dummyCommand(DUMMY_KEY_2.public), dummyCommand(DUMMY_KEY_1.public)) val componentGroups = listOf( @@ -414,8 +414,8 @@ class CompatibleTransactionTests { allCommandsNoKey1Ftx.checkCommandVisibility(DUMMY_KEY_1.public) // This will pass, because there are indeed no commands to sign in the original transaction. } - @Test - fun `FilteredTransaction signer manipulation tests`() { + @Test(timeout=300_000) + fun `FilteredTransaction signer manipulation tests`() { // Required to call the private constructor. val ftxConstructor = FilteredTransaction::class.constructors.first() @@ -557,8 +557,8 @@ class CompatibleTransactionTests { assertFailsWith { ftxAlterSignerB.checkCommandVisibility(DUMMY_KEY_1.public) } } - @Test - fun `parameters hash visibility`() { + @Test(timeout=300_000) + fun `parameters hash visibility`() { fun paramsFilter(elem: Any): Boolean = elem is NetworkParametersHash && elem.hash == paramsHash fun attachmentFilter(elem: Any): Boolean = elem is SecureHash && elem == paramsHash val attachments = ComponentGroup(ATTACHMENTS_GROUP.ordinal, listOf(paramsHash.serialize())) // Same hash as network parameters diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/LedgerTransactionQueryTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/LedgerTransactionQueryTests.kt index a6177d121e..81cba121e6 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/LedgerTransactionQueryTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/LedgerTransactionQueryTests.kt @@ -98,8 +98,8 @@ class LedgerTransactionQueryTests { return tx.toLedgerTransaction(services) } - @Test - fun `Simple InRef Indexer tests`() { + @Test(timeout=300_000) + fun `Simple InRef Indexer tests`() { val ltx = makeDummyTransaction() assertEquals(0, ltx.inRef(0).state.data.data) assertEquals("0", ltx.inRef(1).state.data.data) @@ -108,8 +108,8 @@ class LedgerTransactionQueryTests { assertFailsWith { ltx.inRef(10) } } - @Test - fun `Simple OutRef Indexer tests`() { + @Test(timeout=300_000) + fun `Simple OutRef Indexer tests`() { val ltx = makeDummyTransaction() assertEquals(0, ltx.outRef(0).state.data.data) assertEquals("0", ltx.outRef(1).state.data.data) @@ -118,8 +118,8 @@ class LedgerTransactionQueryTests { assertFailsWith { ltx.outRef(10) } } - @Test - fun `Simple Input Indexer tests`() { + @Test(timeout=300_000) + fun `Simple Input Indexer tests`() { val ltx = makeDummyTransaction() assertEquals(0, (ltx.getInput(0) as IntTypeDummyState).data) assertEquals("0", (ltx.getInput(1) as StringTypeDummyState).data) @@ -128,8 +128,8 @@ class LedgerTransactionQueryTests { assertFailsWith { ltx.getInput(10) } } - @Test - fun `Simple Output Indexer tests`() { + @Test(timeout=300_000) + fun `Simple Output Indexer tests`() { val ltx = makeDummyTransaction() assertEquals(0, (ltx.getOutput(0) as IntTypeDummyState).data) assertEquals("0", (ltx.getOutput(1) as StringTypeDummyState).data) @@ -138,8 +138,8 @@ class LedgerTransactionQueryTests { assertFailsWith { ltx.getOutput(10) } } - @Test - fun `Simple Command Indexer tests`() { + @Test(timeout=300_000) + fun `Simple Command Indexer tests`() { val ltx = makeDummyTransaction() assertEquals(0, ltx.getCommand(0).value.id) assertEquals(0, ltx.getCommand(1).value.id) @@ -148,8 +148,8 @@ class LedgerTransactionQueryTests { assertFailsWith { ltx.getOutput(10) } } - @Test - fun `Simple Inputs of type tests`() { + @Test(timeout=300_000) + fun `Simple Inputs of type tests`() { val ltx = makeDummyTransaction() val intStates = ltx.inputsOfType(IntTypeDummyState::class.java) assertEquals(5, intStates.size) @@ -161,8 +161,8 @@ class LedgerTransactionQueryTests { assertEquals(emptyList(), notPresentQuery) } - @Test - fun `Simple InputsRefs of type tests`() { + @Test(timeout=300_000) + fun `Simple InputsRefs of type tests`() { val ltx = makeDummyTransaction() val intStates = ltx.inRefsOfType(IntTypeDummyState::class.java) assertEquals(5, intStates.size) @@ -174,8 +174,8 @@ class LedgerTransactionQueryTests { assertEquals(listOf(ltx.inputs[1], ltx.inputs[3], ltx.inputs[5], ltx.inputs[7], ltx.inputs[9]), stringStates) } - @Test - fun `Simple Outputs of type tests`() { + @Test(timeout=300_000) + fun `Simple Outputs of type tests`() { val ltx = makeDummyTransaction() val intStates = ltx.outputsOfType(IntTypeDummyState::class.java) assertEquals(5, intStates.size) @@ -187,8 +187,8 @@ class LedgerTransactionQueryTests { assertEquals(emptyList(), notPresentQuery) } - @Test - fun `Simple OutputsRefs of type tests`() { + @Test(timeout=300_000) + fun `Simple OutputsRefs of type tests`() { val ltx = makeDummyTransaction() val intStates = ltx.outRefsOfType(IntTypeDummyState::class.java) assertEquals(5, intStates.size) @@ -202,8 +202,8 @@ class LedgerTransactionQueryTests { assertTrue(stringStates.all { it.ref.txhash == ltx.id }) } - @Test - fun `Simple Commands of type tests`() { + @Test(timeout=300_000) + fun `Simple Commands of type tests`() { val ltx = makeDummyTransaction() val intCmd1 = ltx.commandsOfType(Commands.Cmd1::class.java) assertEquals(5, intCmd1.size) @@ -215,8 +215,8 @@ class LedgerTransactionQueryTests { assertEquals(emptyList(), notPresentQuery) } - @Test - fun `Filtered Input Tests`() { + @Test(timeout=300_000) + fun `Filtered Input Tests`() { val ltx = makeDummyTransaction() val intStates = ltx.filterInputs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 }) assertEquals(3, intStates.size) @@ -225,8 +225,8 @@ class LedgerTransactionQueryTests { assertEquals("3", stringStates.single().data) } - @Test - fun `Filtered InRef Tests`() { + @Test(timeout=300_000) + fun `Filtered InRef Tests`() { val ltx = makeDummyTransaction() val intStates = ltx.filterInRefs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 }) assertEquals(3, intStates.size) @@ -237,8 +237,8 @@ class LedgerTransactionQueryTests { assertEquals(ltx.inputs[7], stringStates.single()) } - @Test - fun `Filtered Output Tests`() { + @Test(timeout=300_000) + fun `Filtered Output Tests`() { val ltx = makeDummyTransaction() val intStates = ltx.filterOutputs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 }) assertEquals(3, intStates.size) @@ -247,8 +247,8 @@ class LedgerTransactionQueryTests { assertEquals("3", stringStates.single().data) } - @Test - fun `Filtered OutRef Tests`() { + @Test(timeout=300_000) + fun `Filtered OutRef Tests`() { val ltx = makeDummyTransaction() val intStates = ltx.filterOutRefs(IntTypeDummyState::class.java, Predicate { it.data.rem(2) == 0 }) assertEquals(3, intStates.size) @@ -261,8 +261,8 @@ class LedgerTransactionQueryTests { assertEquals(ltx.id, stringStates.single().ref.txhash) } - @Test - fun `Filtered Commands Tests`() { + @Test(timeout=300_000) + fun `Filtered Commands Tests`() { val ltx = makeDummyTransaction() val intCmds1 = ltx.filterCommands(Commands.Cmd1::class.java, Predicate { it.id.rem(2) == 0 }) assertEquals(3, intCmds1.size) @@ -271,8 +271,8 @@ class LedgerTransactionQueryTests { assertEquals(3, intCmds2.single().value.id) } - @Test - fun `Find Input Tests`() { + @Test(timeout=300_000) + fun `Find Input Tests`() { val ltx = makeDummyTransaction() val intState = ltx.findInput(IntTypeDummyState::class.java, Predicate { it.data == 4 }) assertEquals(ltx.getInput(8), intState) @@ -280,8 +280,8 @@ class LedgerTransactionQueryTests { assertEquals(ltx.getInput(7), stringState) } - @Test - fun `Find InRef Tests`() { + @Test(timeout=300_000) + fun `Find InRef Tests`() { val ltx = makeDummyTransaction() val intState = ltx.findInRef(IntTypeDummyState::class.java, Predicate { it.data == 4 }) assertEquals(ltx.inRef(8), intState) @@ -289,8 +289,8 @@ class LedgerTransactionQueryTests { assertEquals(ltx.inRef(7), stringState) } - @Test - fun `Find Output Tests`() { + @Test(timeout=300_000) + fun `Find Output Tests`() { val ltx = makeDummyTransaction() val intState = ltx.findOutput(IntTypeDummyState::class.java, Predicate { it.data == 4 }) assertEquals(ltx.getOutput(8), intState) @@ -298,8 +298,8 @@ class LedgerTransactionQueryTests { assertEquals(ltx.getOutput(7), stringState) } - @Test - fun `Find OutRef Tests`() { + @Test(timeout=300_000) + fun `Find OutRef Tests`() { val ltx = makeDummyTransaction() val intState = ltx.findOutRef(IntTypeDummyState::class.java, Predicate { it.data == 4 }) assertEquals(ltx.outRef(8), intState) @@ -307,8 +307,8 @@ class LedgerTransactionQueryTests { assertEquals(ltx.outRef(7), stringState) } - @Test - fun `Find Commands Tests`() { + @Test(timeout=300_000) + fun `Find Commands Tests`() { val ltx = makeDummyTransaction() val intCmd1 = ltx.findCommand(Commands.Cmd1::class.java, Predicate { it.id == 2 }) assertEquals(ltx.getCommand(4), intCmd1) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/ReferenceInputStateTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/ReferenceInputStateTests.kt index e24ad8072c..b602595618 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/ReferenceInputStateTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/ReferenceInputStateTests.kt @@ -103,8 +103,8 @@ class ReferenceStateTests { } } - @Test - fun `create a reference state then refer to it multiple times`() { + @Test(timeout=300_000) + fun `create a reference state then refer to it multiple times`() { ledgerServices.ledger(DUMMY_NOTARY) { // Create a reference state. The reference state is created in the normal way. A transaction with one // or more outputs. It makes sense to create them one at a time, so the creator can have fine grained @@ -142,8 +142,8 @@ class ReferenceStateTests { } } - @Test - fun `Non-creator node cannot spend spend a reference state`() { + @Test(timeout=300_000) + fun `Non-creator node cannot spend spend a reference state`() { ledgerServices.ledger(DUMMY_NOTARY) { transaction { output(CONTRACT_ID, "REF DATA", ExampleState(ALICE_PARTY, "HELLO CORDA")) @@ -161,8 +161,8 @@ class ReferenceStateTests { } } - @Test - fun `Can't use old reference states`() { + @Test(timeout=300_000) + fun `Can't use old reference states`() { val refData = ExampleState(ALICE_PARTY, "HELLO CORDA") ledgerServices.ledger(DUMMY_NOTARY) { transaction { @@ -197,8 +197,8 @@ class ReferenceStateTests { } } - @Test - fun `state ref cannot be a reference input and regular input in the same transaction`() { + @Test(timeout=300_000) + fun `state ref cannot be a reference input and regular input in the same transaction`() { val state = ExampleState(ALICE_PARTY, "HELLO CORDA") val stateAndRef = StateAndRef(TransactionState(state, CONTRACT_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint), StateRef(SecureHash.zeroHash, 0)) assertThatIllegalArgumentException().isThrownBy { diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt index 0dfc9cb567..500bc101ab 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt @@ -63,8 +63,8 @@ class TransactionBuilderTest { .getLatestContractAttachments("net.corda.testing.contracts.DummyContract") } - @Test - fun `bare minimum issuance tx`() { + @Test(timeout=300_000) + fun `bare minimum issuance tx`() { val outputState = TransactionState( data = DummyState(), contract = DummyContract.PROGRAM_ID, @@ -80,8 +80,8 @@ class TransactionBuilderTest { assertThat(wtx.networkParametersHash).isEqualTo(networkParametersService.currentHash) } - @Test - fun `automatic hash constraint`() { + @Test(timeout=300_000) + fun `automatic hash constraint`() { doReturn(unsignedAttachment).whenever(attachments).openAttachment(contractAttachmentId) val outputState = TransactionState(data = DummyState(), contract = DummyContract.PROGRAM_ID, notary = notary) @@ -92,8 +92,8 @@ class TransactionBuilderTest { assertThat(wtx.outputs).containsOnly(outputState.copy(constraint = HashAttachmentConstraint(contractAttachmentId))) } - @Test - fun `reference states`() { + @Test(timeout=300_000) + fun `reference states`() { doReturn(unsignedAttachment).whenever(attachments).openAttachment(contractAttachmentId) val referenceState = TransactionState(DummyState(), DummyContract.PROGRAM_ID, notary) @@ -114,8 +114,8 @@ class TransactionBuilderTest { assertThat(wtx.references).containsOnly(referenceStateRef) } - @Test - fun `automatic signature constraint`() { + @Test(timeout=300_000) + fun `automatic signature constraint`() { val aliceParty = TestIdentity(ALICE_NAME).party val bobParty = TestIdentity(BOB_NAME).party val compositeKey = CompositeKey.Builder().addKeys(aliceParty.owningKey, bobParty.owningKey).build() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionEncumbranceTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionEncumbranceTests.kt index 0ed4b0758a..cde9dc4da7 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionEncumbranceTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionEncumbranceTests.kt @@ -82,8 +82,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `states must be bi-directionally encumbered`() { + @Test(timeout=300_000) + fun `states must be bi-directionally encumbered`() { // Basic encumbrance example for encumbrance index links 0 -> 1 and 1 -> 0 ledgerServices.ledger(DUMMY_NOTARY) { transaction { @@ -145,8 +145,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `non bi-directional encumbrance will fail`() { + @Test(timeout=300_000) + fun `non bi-directional encumbrance will fail`() { // Single encumbrance with no back link. assertFailsWith { ledgerServices.ledger(DUMMY_NOTARY) { @@ -214,8 +214,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `state can transition if encumbrance rules are met`() { + @Test(timeout=300_000) + fun `state can transition if encumbrance rules are met`() { ledgerServices.ledger(DUMMY_NOTARY) { unverifiedTransaction { attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID) @@ -235,8 +235,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `state cannot transition if the encumbrance contract fails to verify`() { + @Test(timeout=300_000) + fun `state cannot transition if the encumbrance contract fails to verify`() { ledgerServices.ledger(DUMMY_NOTARY) { unverifiedTransaction { attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID) @@ -256,8 +256,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `state must be consumed along with its encumbrance`() { + @Test(timeout=300_000) + fun `state must be consumed along with its encumbrance`() { ledgerServices.ledger(DUMMY_NOTARY) { unverifiedTransaction { attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID) @@ -275,8 +275,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `state cannot be encumbered by itself`() { + @Test(timeout=300_000) + fun `state cannot be encumbered by itself`() { ledgerServices.ledger(DUMMY_NOTARY) { transaction { attachments(Cash.PROGRAM_ID) @@ -288,8 +288,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `encumbrance state index must be valid`() { + @Test(timeout=300_000) + fun `encumbrance state index must be valid`() { ledgerServices.ledger(DUMMY_NOTARY) { transaction { attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID) @@ -302,8 +302,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `correct encumbrance state must be provided`() { + @Test(timeout=300_000) + fun `correct encumbrance state must be provided`() { ledgerServices.ledger(DUMMY_NOTARY) { unverifiedTransaction { attachments(Cash.PROGRAM_ID, TEST_TIMELOCK_ID) @@ -323,8 +323,8 @@ class TransactionEncumbranceTests { } } - @Test - fun `encumbered states cannot be assigned to different notaries`() { + @Test(timeout=300_000) + fun `encumbered states cannot be assigned to different notaries`() { // Single encumbrance with different notaries. assertFailsWith { TransactionBuilder() diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt index a17f331ea0..cec21d0f08 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt @@ -53,8 +53,8 @@ class TransactionTests { return SignedTransaction(wtx, sigs) } - @Test - fun `signed transaction missing signatures - CompositeKey`() { + @Test(timeout=300_000) + fun `signed transaction missing signatures - CompositeKey`() { val ak = generateKeyPair() val bk = generateKeyPair() val ck = generateKeyPair() @@ -87,8 +87,8 @@ class TransactionTests { makeSigned(wtx, DUMMY_KEY_1, ak).verifySignaturesExcept(compKey, DUMMY_KEY_2.public) // Mixed allowed to be missing. } - @Test - fun `signed transaction missing signatures`() { + @Test(timeout=300_000) + fun `signed transaction missing signatures`() { val wtx = createWireTransaction( inputs = listOf(StateRef(SecureHash.randomSHA256(), 0)), attachments = emptyList(), @@ -118,8 +118,8 @@ class TransactionTests { makeSigned(wtx, DUMMY_KEY_1, DUMMY_KEY_2).verifyRequiredSignatures() } - @Test - fun `transactions with no inputs can have any notary`() { + @Test(timeout=300_000) + fun `transactions with no inputs can have any notary`() { val baseOutState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint) val inputs = emptyList>() val outputs = listOf(baseOutState, baseOutState.copy(notary = ALICE), baseOutState.copy(notary = BOB)) @@ -148,8 +148,8 @@ class TransactionTests { transaction.verify() } - @Test - fun `transaction cannot have duplicate inputs`() { + @Test(timeout=300_000) + fun `transaction cannot have duplicate inputs`() { val stateRef = StateRef(SecureHash.randomSHA256(), 0) fun buildTransaction() = createWireTransaction( inputs = listOf(stateRef, stateRef), @@ -163,8 +163,8 @@ class TransactionTests { assertFailsWith { buildTransaction() } } - @Test - fun `general transactions cannot change notary`() { + @Test(timeout=300_000) + fun `general transactions cannot change notary`() { val notary: Party = DUMMY_NOTARY val inState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, notary) val outState = inState.copy(notary = ALICE) @@ -201,8 +201,8 @@ class TransactionTests { assertFailsWith { buildTransaction().verify() } } - @Test - fun `transactions with identical contents must have different ids`() { + @Test(timeout=300_000) + fun `transactions with identical contents must have different ids`() { val outputState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, DUMMY_NOTARY) fun buildTransaction() = createWireTransaction( inputs = emptyList(), diff --git a/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt index 8198c7cf93..15dd6aef8d 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt @@ -34,16 +34,16 @@ class KotlinUtilsTest { true, null) - @Test - fun `transient property which is null`() { + @Test(timeout=300_000) + fun `transient property which is null`() { val test = NullTransientProperty() test.transientValue test.transientValue assertThat(test.evalCount).isEqualTo(1) } - @Test - fun `checkpointing a transient property with non-capturing lambda`() { + @Test(timeout=300_000) + fun `checkpointing a transient property with non-capturing lambda`() { val original = NonCapturingTransientProperty() val originalVal = original.transientVal val copy = original.checkpointSerialize(context = KRYO_CHECKPOINT_CONTEXT).checkpointDeserialize(context = KRYO_CHECKPOINT_CONTEXT) @@ -52,16 +52,16 @@ class KotlinUtilsTest { assertThat(copy.transientVal).isEqualTo(copyVal) } - @Test - fun `deserialise transient property with non-capturing lambda`() { + @Test(timeout=300_000) + fun `deserialise transient property with non-capturing lambda`() { expectedEx.expect(KryoException::class.java) expectedEx.expectMessage("is not annotated or on the whitelist, so cannot be used in serialization") val original = NonCapturingTransientProperty() original.checkpointSerialize(context = KRYO_CHECKPOINT_CONTEXT).checkpointDeserialize(context = KRYO_CHECKPOINT_NOWHITELIST_CONTEXT) } - @Test - fun `checkpointing a transient property with capturing lambda`() { + @Test(timeout=300_000) + fun `checkpointing a transient property with capturing lambda`() { val original = CapturingTransientProperty("Hello") val originalVal = original.transientVal val copy = original.checkpointSerialize(context = KRYO_CHECKPOINT_CONTEXT).checkpointDeserialize(context = KRYO_CHECKPOINT_CONTEXT) @@ -71,8 +71,8 @@ class KotlinUtilsTest { assertThat(copy.transientVal).startsWith("Hello") } - @Test - fun `deserialise transient property with capturing lambda`() { + @Test(timeout=300_000) + fun `deserialise transient property with capturing lambda`() { expectedEx.expect(KryoException::class.java) expectedEx.expectMessage("is not annotated or on the whitelist, so cannot be used in serialization") diff --git a/core-tests/src/test/kotlin/net/corda/coretests/utilities/NonEmptySetTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/utilities/NonEmptySetTest.kt index 21a14e30fd..4eba82a096 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/utilities/NonEmptySetTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/utilities/NonEmptySetTest.kt @@ -42,18 +42,18 @@ class NonEmptySetTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `copyOf - empty source`() { + @Test(timeout=300_000) + fun `copyOf - empty source`() { assertThatThrownBy { NonEmptySet.copyOf(HashSet()) }.isInstanceOf(IllegalArgumentException::class.java) } - @Test - fun head() { + @Test(timeout=300_000) + fun head() { assertThat(NonEmptySet.of(1, 2).head()).isEqualTo(1) } - @Test - fun `serialize deserialize`() { + @Test(timeout=300_000) + fun `serialize deserialize`() { val original = NonEmptySet.of(-17, 22, 17) val copy = original.serialize().deserialize() assertThat(copy).isEqualTo(original).isNotSameAs(original) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/utilities/ProgressTrackerTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/utilities/ProgressTrackerTest.kt index e6147336f3..b1e8f36394 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/utilities/ProgressTrackerTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/utilities/ProgressTrackerTest.kt @@ -59,8 +59,8 @@ class ProgressTrackerTest { pt4 = ChildSteps.tracker() } - @Test - fun `check basic steps`() { + @Test(timeout=300_000) + fun `check basic steps`() { assertEquals(ProgressTracker.UNSTARTED, pt.currentStep) assertEquals(0, pt.stepIndex) var stepNotification: ProgressTracker.Step? = null @@ -76,15 +76,15 @@ class ProgressTrackerTest { assertEquals(ProgressTracker.DONE, pt.nextStep()) } - @Test - fun `cannot go beyond end`() { + @Test(timeout=300_000) + fun `cannot go beyond end`() { pt.currentStep = SimpleSteps.FOUR pt.nextStep() assertFails { pt.nextStep() } } - @Test - fun `nested children are stepped correctly`() { + @Test(timeout=300_000) + fun `nested children are stepped correctly`() { val stepNotification = LinkedList() pt.changes.subscribe { stepNotification += it @@ -109,8 +109,8 @@ class ProgressTrackerTest { assertEquals(ChildSteps.BEE, pt2.nextStep()) } - @Test - fun `steps tree index counts children steps`() { + @Test(timeout=300_000) + fun `steps tree index counts children steps`() { pt.setChildProgressTracker(SimpleSteps.TWO, pt2) val allSteps = pt.allSteps @@ -148,8 +148,8 @@ class ProgressTrackerTest { assertThat(stepsTreeNotification).hasSize(2) // The initial tree state, plus one per tree update } - @Test - fun `steps tree index counts two levels of children steps`() { + @Test(timeout=300_000) + fun `steps tree index counts two levels of children steps`() { pt.setChildProgressTracker(SimpleSteps.FOUR, pt2) pt2.setChildProgressTracker(ChildSteps.SEA, pt3) val allSteps = pt.allSteps @@ -183,8 +183,8 @@ class ProgressTrackerTest { assertThat(stepsTreeNotification).hasSize(3) // The initial tree state, plus one per update } - @Test - fun `structure changes are pushed down when progress trackers are added`() { + @Test(timeout=300_000) + fun `structure changes are pushed down when progress trackers are added`() { pt.setChildProgressTracker(SimpleSteps.TWO, pt2) // Capture notifications. @@ -220,8 +220,8 @@ class ProgressTrackerTest { assertThat(stepsTreeNotification).hasSize(3) // The initial tree state, plus one per update. } - @Test - fun `structure changes are pushed down when progress trackers are removed`() { + @Test(timeout=300_000) + fun `structure changes are pushed down when progress trackers are removed`() { pt.setChildProgressTracker(SimpleSteps.TWO, pt2) // Capture notifications. @@ -255,16 +255,16 @@ class ProgressTrackerTest { assertThat(stepsTreeNotification).hasSize(3) // The initial tree state, plus one per update } - @Test - fun `can be rewound`() { + @Test(timeout=300_000) + fun `can be rewound`() { pt.setChildProgressTracker(SimpleSteps.TWO, pt2) repeat(4) { pt.nextStep() } pt.currentStep = SimpleSteps.ONE assertEquals(SimpleSteps.TWO, pt.nextStep()) } - @Test - fun `all index changes seen if subscribed mid flow`() { + @Test(timeout=300_000) + fun `all index changes seen if subscribed mid flow`() { pt.setChildProgressTracker(SimpleSteps.TWO, pt2) pt.currentStep = SimpleSteps.ONE @@ -280,8 +280,8 @@ class ProgressTrackerTest { assertThat(stepsIndexNotifications).containsExactlyElementsOf(listOf(0, 1, 2, 3)) } - @Test - fun `all step changes seen if subscribed mid flow`() { + @Test(timeout=300_000) + fun `all step changes seen if subscribed mid flow`() { val steps = mutableListOf() pt.nextStep() pt.nextStep() @@ -293,8 +293,8 @@ class ProgressTrackerTest { assertEquals(listOf("Starting", "one", "two", "three", "four", "Done"), steps) } - @Test - fun `all tree changes seen if subscribed mid flow`() { + @Test(timeout=300_000) + fun `all tree changes seen if subscribed mid flow`() { val stepTreeNotifications = mutableListOf>>() val firstStepLabels = pt.allStepsLabels @@ -310,8 +310,8 @@ class ProgressTrackerTest { assertEquals(listOf(firstStepLabels, secondStepLabels, thirdStepLabels), stepTreeNotifications) } - @Test - fun `trees with child trackers with duplicate steps reported correctly`() { + @Test(timeout=300_000) + fun `trees with child trackers with duplicate steps reported correctly`() { val stepTreeNotifications = mutableListOf>>() val stepIndexNotifications = mutableListOf() pt.stepsTreeChanges.subscribe { stepTreeNotifications += it } @@ -329,8 +329,8 @@ class ProgressTrackerTest { assertEquals(listOf(0, 1, 2, 3, 4, 5, 6), stepIndexNotifications) } - @Test - fun `cannot assign step not belonging to this progress tracker`() { + @Test(timeout=300_000) + fun `cannot assign step not belonging to this progress tracker`() { assertFails { pt.currentStep = BabySteps.UNOS } } @@ -341,8 +341,8 @@ class ProgressTrackerTest { fun tracker() = ProgressTracker(first, second, first2) } - @Test - fun `Serializing and deserializing a tracker maintains equality`() { + @Test(timeout=300_000) + fun `Serializing and deserializing a tracker maintains equality`() { val step = NonSingletonSteps.first val recreatedStep = step .checkpointSerialize(testCheckpointSerialization.checkpointSerializationContext) @@ -350,8 +350,8 @@ class ProgressTrackerTest { assertEquals(step, recreatedStep) } - @Test - fun `can assign a recreated equal step`() { + @Test(timeout=300_000) + fun `can assign a recreated equal step`() { val tracker = NonSingletonSteps.tracker() val recreatedStep = first .checkpointSerialize(testCheckpointSerialization.checkpointSerializationContext) @@ -359,14 +359,14 @@ class ProgressTrackerTest { tracker.currentStep = recreatedStep } - @Test - fun `Steps with the same label defined in different places are not equal`() { + @Test(timeout=300_000) + fun `Steps with the same label defined in different places are not equal`() { val one = ProgressTracker.Step("one") assertNotEquals(one, SimpleSteps.ONE) } - @Test - fun `Steps with the same label defined in the same place are also not equal`() { + @Test(timeout=300_000) + fun `Steps with the same label defined in the same place are also not equal`() { assertNotEquals(first, first2) } } diff --git a/core/src/test/kotlin/net/corda/core/UtilsTest.kt b/core/src/test/kotlin/net/corda/core/UtilsTest.kt index 717356f4d4..15be02ec6a 100644 --- a/core/src/test/kotlin/net/corda/core/UtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/UtilsTest.kt @@ -8,16 +8,16 @@ import java.util.* import java.util.concurrent.CancellationException class UtilsTest { - @Test - fun `toFuture - single item observable`() { + @Test(timeout=300_000) + fun `toFuture - single item observable`() { val subject = PublishSubject.create() val future = subject.toFuture() subject.onNext("Hello") assertThat(future.getOrThrow()).isEqualTo("Hello") } - @Test - fun `toFuture - empty obserable`() { + @Test(timeout=300_000) + fun `toFuture - empty obserable`() { val subject = PublishSubject.create() val future = subject.toFuture() subject.onCompleted() @@ -26,8 +26,8 @@ class UtilsTest { } } - @Test - fun `toFuture - more than one item observable`() { + @Test(timeout=300_000) + fun `toFuture - more than one item observable`() { val subject = PublishSubject.create() val future = subject.toFuture() subject.onNext("Hello") @@ -36,8 +36,8 @@ class UtilsTest { assertThat(future.getOrThrow()).isEqualTo("Hello") } - @Test - fun `toFuture - erroring observable`() { + @Test(timeout=300_000) + fun `toFuture - erroring observable`() { val subject = PublishSubject.create() val future = subject.toFuture() val exception = Exception("Error") @@ -47,8 +47,8 @@ class UtilsTest { }.isSameAs(exception) } - @Test - fun `toFuture - cancel`() { + @Test(timeout=300_000) + fun `toFuture - cancel`() { val subject = PublishSubject.create() val future = subject.toFuture() future.cancel(false) diff --git a/core/src/test/kotlin/net/corda/core/concurrent/ConcurrencyUtilsTest.kt b/core/src/test/kotlin/net/corda/core/concurrent/ConcurrencyUtilsTest.kt index d9c3ba33d7..491e530e39 100644 --- a/core/src/test/kotlin/net/corda/core/concurrent/ConcurrencyUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/concurrent/ConcurrencyUtilsTest.kt @@ -20,8 +20,8 @@ class ConcurrencyUtilsTest { doNothing().whenever(it).error(any(), any()) } - @Test - fun `firstOf short circuit`() { + @Test(timeout=300_000) + fun `firstOf short circuit`() { // Order not significant in this case: val g = firstOf(arrayOf(f2, f1), log) { ++invocations @@ -38,8 +38,8 @@ class ConcurrencyUtilsTest { verifyNoMoreInteractions(log) } - @Test - fun `firstOf re-entrant handler attempt due to cancel`() { + @Test(timeout=300_000) + fun `firstOf re-entrant handler attempt due to cancel`() { val futures = arrayOf(f1, f2) val g = firstOf(futures, log) { ++invocations @@ -56,8 +56,8 @@ class ConcurrencyUtilsTest { /** * Note that if you set CancellationException on CompletableFuture it will report isCancelled. */ - @Test - fun `firstOf re-entrant handler attempt not due to cancel`() { + @Test(timeout=300_000) + fun `firstOf re-entrant handler attempt not due to cancel`() { val futures = arrayOf(f1, f2) val nonCancel = IllegalStateException() val g = firstOf(futures, log) { @@ -73,8 +73,8 @@ class ConcurrencyUtilsTest { assertThatThrownBy { f2.getOrThrow() }.isSameAs(nonCancel) } - @Test - fun `firstOf cancel is not special`() { + @Test(timeout=300_000) + fun `firstOf cancel is not special`() { val g = firstOf(arrayOf(f2, f1), log) { ++invocations it.getOrThrow() // This can always do something fancy if 'it' was cancelled. @@ -85,8 +85,8 @@ class ConcurrencyUtilsTest { verifyNoMoreInteractions(log) } - @Test - fun `match does not pass failure of success block into the failure block`() { + @Test(timeout=300_000) + fun `match does not pass failure of success block into the failure block`() { val f = CompletableFuture.completedFuture(100) val successes = mutableListOf() val failures = mutableListOf() @@ -101,8 +101,8 @@ class ConcurrencyUtilsTest { assertEquals(emptyList(), failures) } - @Test - fun `match does not pass ExecutionException to failure block`() { + @Test(timeout=300_000) + fun `match does not pass ExecutionException to failure block`() { val e = Throwable() val f = CompletableFuture().apply { completeExceptionally(e) } val successes = mutableListOf() diff --git a/core/src/test/kotlin/net/corda/core/contracts/PrivacySaltTest.kt b/core/src/test/kotlin/net/corda/core/contracts/PrivacySaltTest.kt index c9fc2033a6..a5ec174460 100644 --- a/core/src/test/kotlin/net/corda/core/contracts/PrivacySaltTest.kt +++ b/core/src/test/kotlin/net/corda/core/contracts/PrivacySaltTest.kt @@ -4,8 +4,8 @@ import org.assertj.core.api.Assertions.assertThatExceptionOfType import org.junit.Test class PrivacySaltTest { - @Test - fun `all-zero PrivacySalt not allowed`() { + @Test(timeout=300_000) + fun `all-zero PrivacySalt not allowed`() { assertThatExceptionOfType(IllegalArgumentException::class.java).isThrownBy { PrivacySalt(ByteArray(32)) }.withMessage("Privacy salt should not be all zeros.") diff --git a/core/src/test/kotlin/net/corda/core/contracts/StructuresTests.kt b/core/src/test/kotlin/net/corda/core/contracts/StructuresTests.kt index 73cb9a3637..74b42fad56 100644 --- a/core/src/test/kotlin/net/corda/core/contracts/StructuresTests.kt +++ b/core/src/test/kotlin/net/corda/core/contracts/StructuresTests.kt @@ -17,8 +17,8 @@ import kotlin.test.fail class AttachmentTest { - @Test - fun `openAsJAR does not leak file handle if attachment has corrupted manifest`() { + @Test(timeout=300_000) + fun `openAsJAR does not leak file handle if attachment has corrupted manifest`() { var closeCalls = 0 val inputStream = spy(ByteArrayOutputStream().apply { ZipOutputStream(this).use { @@ -47,8 +47,8 @@ class AttachmentTest { class UniqueIdentifierTests { - @Test - fun `unique identifier comparison`() { + @Test(timeout=300_000) + fun `unique identifier comparison`() { val ids = listOf(UniqueIdentifier.fromString("e363f00e-4759-494d-a7ca-0dc966a92494"), UniqueIdentifier.fromString("10ed0cc3-7bdf-4000-b610-595e36667d7d"), UniqueIdentifier("Test", UUID.fromString("10ed0cc3-7bdf-4000-b610-595e36667d7d")) @@ -60,8 +60,8 @@ class UniqueIdentifierTests { assertEquals(0, ids[1].compareTo(ids[2])) } - @Test - fun `unique identifier equality`() { + @Test(timeout=300_000) + fun `unique identifier equality`() { val ids = listOf(UniqueIdentifier.fromString("e363f00e-4759-494d-a7ca-0dc966a92494"), UniqueIdentifier.fromString("10ed0cc3-7bdf-4000-b610-595e36667d7d"), UniqueIdentifier("Test", UUID.fromString("10ed0cc3-7bdf-4000-b610-595e36667d7d")) diff --git a/core/src/test/kotlin/net/corda/core/crypto/Base58Test.kt b/core/src/test/kotlin/net/corda/core/crypto/Base58Test.kt index 52f6d481d7..1d175b1f4c 100644 --- a/core/src/test/kotlin/net/corda/core/crypto/Base58Test.kt +++ b/core/src/test/kotlin/net/corda/core/crypto/Base58Test.kt @@ -12,8 +12,8 @@ import kotlin.test.fail * Modified from the bitcoinj library. */ class Base58Test { - @Test - fun testEncode() { + @Test(timeout=300_000) + fun testEncode() { val testbytes = "Hello World".toByteArray() assertEquals("JxF12TrwUP45BMd", Base58.encode(testbytes)) @@ -30,8 +30,8 @@ class Base58Test { assertEquals("", Base58.encode(EMPTY_BYTE_ARRAY)) } - @Test - fun testDecode() { + @Test(timeout=300_000) + fun testDecode() { val testbytes = "Hello World".toByteArray() val actualbytes = Base58.decode("JxF12TrwUP45BMd") assertTrue(String(actualbytes)) { Arrays.equals(testbytes, actualbytes) } @@ -72,8 +72,8 @@ class Base58Test { Base58.decodeChecked("93VYUMzRG9DdbRP72uQXjaWibbQwygnvaCu9DumcqDjGybD864T") } - @Test - fun testDecodeToBigInteger() { + @Test(timeout=300_000) + fun testDecodeToBigInteger() { val input = Base58.decode("129") assertEquals(BigInteger(1, input), Base58.decodeToBigInteger("129")) } diff --git a/core/src/test/kotlin/net/corda/core/crypto/CryptoUtilsTest.kt b/core/src/test/kotlin/net/corda/core/crypto/CryptoUtilsTest.kt index c31d0e63ee..850cd84558 100644 --- a/core/src/test/kotlin/net/corda/core/crypto/CryptoUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/crypto/CryptoUtilsTest.kt @@ -46,8 +46,8 @@ class CryptoUtilsTest { } // key generation test - @Test - fun `Generate key pairs`() { + @Test(timeout=300_000) + fun `Generate key pairs`() { // testing supported algorithms val rsaKeyPair = Crypto.generateKeyPair(RSA_SHA256) val ecdsaKKeyPair = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) @@ -80,8 +80,8 @@ class CryptoUtilsTest { // full process tests - @Test - fun `RSA full process keygen-sign-verify`() { + @Test(timeout=300_000) + fun `RSA full process keygen-sign-verify`() { val keyPair = Crypto.generateKeyPair(RSA_SHA256) val (privKey, pubKey) = keyPair // test for some data @@ -135,8 +135,8 @@ class CryptoUtilsTest { } } - @Test - fun `ECDSA secp256k1 full process keygen-sign-verify`() { + @Test(timeout=300_000) + fun `ECDSA secp256k1 full process keygen-sign-verify`() { val keyPair = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val (privKey, pubKey) = keyPair // test for some data @@ -190,8 +190,8 @@ class CryptoUtilsTest { } } - @Test - fun `ECDSA secp256r1 full process keygen-sign-verify`() { + @Test(timeout=300_000) + fun `ECDSA secp256r1 full process keygen-sign-verify`() { val keyPair = Crypto.generateKeyPair(ECDSA_SECP256R1_SHA256) val (privKey, pubKey) = keyPair // test for some data @@ -245,8 +245,8 @@ class CryptoUtilsTest { } } - @Test - fun `EDDSA ed25519 full process keygen-sign-verify`() { + @Test(timeout=300_000) + fun `EDDSA ed25519 full process keygen-sign-verify`() { val keyPair = Crypto.generateKeyPair(EDDSA_ED25519_SHA512) val (privKey, pubKey) = keyPair // test for some data @@ -300,8 +300,8 @@ class CryptoUtilsTest { } } - @Test - fun `SPHINCS-256 full process keygen-sign-verify`() { + @Test(timeout=300_000) + fun `SPHINCS-256 full process keygen-sign-verify`() { val keyPair = Crypto.generateKeyPair(SPHINCS256_SHA256) val (privKey, pubKey) = keyPair // test for some data @@ -356,16 +356,16 @@ class CryptoUtilsTest { } // test list of supported algorithms - @Test - fun `Check supported algorithms`() { + @Test(timeout=300_000) + fun `Check supported algorithms`() { val algList: List = Crypto.supportedSignatureSchemes().map { it.schemeCodeName } val expectedAlgSet = setOf("RSA_SHA256", "ECDSA_SECP256K1_SHA256", "ECDSA_SECP256R1_SHA256", "EDDSA_ED25519_SHA512", "SPHINCS-256_SHA512", "COMPOSITE") assertTrue { Sets.symmetricDifference(expectedAlgSet, algList.toSet()).isEmpty(); } } // Unfortunately, there isn't a standard way to encode/decode keys, so we need to test per case - @Test - fun `RSA encode decode keys - required for serialization`() { + @Test(timeout=300_000) + fun `RSA encode decode keys - required for serialization`() { // Generate key pair. val keyPair = Crypto.generateKeyPair(RSA_SHA256) val (privKey, pubKey) = keyPair @@ -379,8 +379,8 @@ class CryptoUtilsTest { assertEquals(pubKey2, pubKey) } - @Test - fun `ECDSA secp256k1 encode decode keys - required for serialization`() { + @Test(timeout=300_000) + fun `ECDSA secp256k1 encode decode keys - required for serialization`() { // Generate key pair. val keyPair = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val (privKey, pubKey) = keyPair @@ -394,8 +394,8 @@ class CryptoUtilsTest { assertEquals(pubKey2, pubKey) } - @Test - fun `ECDSA secp256r1 encode decode keys - required for serialization`() { + @Test(timeout=300_000) + fun `ECDSA secp256r1 encode decode keys - required for serialization`() { // Generate key pair. val keyPair = Crypto.generateKeyPair(ECDSA_SECP256R1_SHA256) val (privKey, pubKey) = keyPair @@ -409,8 +409,8 @@ class CryptoUtilsTest { assertEquals(pubKey2, pubKey) } - @Test - fun `EdDSA encode decode keys - required for serialization`() { + @Test(timeout=300_000) + fun `EdDSA encode decode keys - required for serialization`() { // Generate key pair. val keyPair = Crypto.generateKeyPair(EDDSA_ED25519_SHA512) val (privKey, pubKey) = keyPair @@ -424,8 +424,8 @@ class CryptoUtilsTest { assertEquals(pubKey2, pubKey) } - @Test - fun `SPHINCS-256 encode decode keys - required for serialization`() { + @Test(timeout=300_000) + fun `SPHINCS-256 encode decode keys - required for serialization`() { // Generate key pair. val keyPair = Crypto.generateKeyPair(SPHINCS256_SHA256) val privKey: BCSphincs256PrivateKey = keyPair.private as BCSphincs256PrivateKey @@ -454,16 +454,16 @@ class CryptoUtilsTest { assertEquals(decodedPubKey, pubKey) } - @Test - fun `RSA scheme finder by key type`() { + @Test(timeout=300_000) + fun `RSA scheme finder by key type`() { val keyPairRSA = Crypto.generateKeyPair(RSA_SHA256) val (privRSA, pubRSA) = keyPairRSA assertEquals(privRSA.algorithm, "RSA") assertEquals(pubRSA.algorithm, "RSA") } - @Test - fun `ECDSA secp256k1 scheme finder by key type`() { + @Test(timeout=300_000) + fun `ECDSA secp256k1 scheme finder by key type`() { val keyPair = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val (privKey, pubKey) = keyPair @@ -477,8 +477,8 @@ class CryptoUtilsTest { assertEquals((pubKeyDecoded as ECKey).parameters, ECNamedCurveTable.getParameterSpec("secp256k1")) } - @Test - fun `ECDSA secp256r1 scheme finder by key type`() { + @Test(timeout=300_000) + fun `ECDSA secp256r1 scheme finder by key type`() { val keyPairR1 = Crypto.generateKeyPair(ECDSA_SECP256R1_SHA256) val (privR1, pubR1) = keyPairR1 assertEquals(privR1.algorithm, "ECDSA") @@ -487,8 +487,8 @@ class CryptoUtilsTest { assertEquals((pubR1 as ECKey).parameters, ECNamedCurveTable.getParameterSpec("secp256r1")) } - @Test - fun `EdDSA scheme finder by key type`() { + @Test(timeout=300_000) + fun `EdDSA scheme finder by key type`() { val keyPairEd = Crypto.generateKeyPair(EDDSA_ED25519_SHA512) val (privEd, pubEd) = keyPairEd @@ -498,16 +498,16 @@ class CryptoUtilsTest { assertEquals((pubEd as EdDSAKey).params, EdDSANamedCurveTable.getByName("ED25519")) } - @Test - fun `SPHINCS-256 scheme finder by key type`() { + @Test(timeout=300_000) + fun `SPHINCS-256 scheme finder by key type`() { val keyPairSP = Crypto.generateKeyPair(SPHINCS256_SHA256) val (privSP, pubSP) = keyPairSP assertEquals(privSP.algorithm, "SPHINCS-256") assertEquals(pubSP.algorithm, "SPHINCS-256") } - @Test - fun `Automatic EdDSA key-type detection and decoding`() { + @Test(timeout=300_000) + fun `Automatic EdDSA key-type detection and decoding`() { val keyPairEd = Crypto.generateKeyPair(EDDSA_ED25519_SHA512) val (privEd, pubEd) = keyPairEd val encodedPrivEd = privEd.encoded @@ -522,8 +522,8 @@ class CryptoUtilsTest { assertEquals(decodedPubEd, pubEd) } - @Test - fun `Automatic ECDSA secp256k1 key-type detection and decoding`() { + @Test(timeout=300_000) + fun `Automatic ECDSA secp256k1 key-type detection and decoding`() { val keyPairK1 = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val (privK1, pubK1) = keyPairK1 val encodedPrivK1 = privK1.encoded @@ -538,8 +538,8 @@ class CryptoUtilsTest { assertEquals(decodedPubK1, pubK1) } - @Test - fun `Automatic ECDSA secp256r1 key-type detection and decoding`() { + @Test(timeout=300_000) + fun `Automatic ECDSA secp256r1 key-type detection and decoding`() { val keyPairR1 = Crypto.generateKeyPair(ECDSA_SECP256R1_SHA256) val (privR1, pubR1) = keyPairR1 val encodedPrivR1 = privR1.encoded @@ -554,8 +554,8 @@ class CryptoUtilsTest { assertEquals(decodedPubR1, pubR1) } - @Test - fun `Automatic RSA key-type detection and decoding`() { + @Test(timeout=300_000) + fun `Automatic RSA key-type detection and decoding`() { val keyPairRSA = Crypto.generateKeyPair(RSA_SHA256) val (privRSA, pubRSA) = keyPairRSA val encodedPrivRSA = privRSA.encoded @@ -570,8 +570,8 @@ class CryptoUtilsTest { assertEquals(decodedPubRSA, pubRSA) } - @Test - fun `Automatic SPHINCS-256 key-type detection and decoding`() { + @Test(timeout=300_000) + fun `Automatic SPHINCS-256 key-type detection and decoding`() { val keyPairSP = Crypto.generateKeyPair(SPHINCS256_SHA256) val (privSP, pubSP) = keyPairSP val encodedPrivSP = privSP.encoded @@ -586,8 +586,8 @@ class CryptoUtilsTest { assertEquals(decodedPubSP, pubSP) } - @Test - fun `Failure test between K1 and R1 keys`() { + @Test(timeout=300_000) + fun `Failure test between K1 and R1 keys`() { val keyPairK1 = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val privK1 = keyPairK1.private val encodedPrivK1 = privK1.encoded @@ -601,8 +601,8 @@ class CryptoUtilsTest { assertNotEquals(decodedPrivK1, decodedPrivR1) } - @Test - fun `Decoding Failure on randomdata as key`() { + @Test(timeout=300_000) + fun `Decoding Failure on randomdata as key`() { val keyPairK1 = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val privK1 = keyPairK1.private val encodedPrivK1 = privK1.encoded @@ -621,8 +621,8 @@ class CryptoUtilsTest { } } - @Test - fun `Decoding Failure on malformed keys`() { + @Test(timeout=300_000) + fun `Decoding Failure on malformed keys`() { val keyPairK1 = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val privK1 = keyPairK1.private val encodedPrivK1 = privK1.encoded @@ -641,8 +641,8 @@ class CryptoUtilsTest { } } - @Test - fun `Check ECDSA public key on curve`() { + @Test(timeout=300_000) + fun `Check ECDSA public key on curve`() { val keyPairK1 = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val pubK1 = keyPairK1.public as BCECPublicKey assertTrue(Crypto.publicKeyOnCurve(ECDSA_SECP256K1_SHA256, pubK1)) @@ -652,8 +652,8 @@ class CryptoUtilsTest { assertFalse(Crypto.publicKeyOnCurve(EDDSA_ED25519_SHA512, pubK1)) } - @Test - fun `Check EdDSA public key on curve`() { + @Test(timeout=300_000) + fun `Check EdDSA public key on curve`() { val keyPairEdDSA = Crypto.generateKeyPair(EDDSA_ED25519_SHA512) val pubEdDSA = keyPairEdDSA.public assertTrue(Crypto.publicKeyOnCurve(EDDSA_ED25519_SHA512, pubEdDSA)) @@ -674,8 +674,8 @@ class CryptoUtilsTest { Crypto.publicKeyOnCurve(ECDSA_SECP256R1_SHA256, pubSun) } - @Test - fun `ECDSA secp256R1 deterministic key generation`() { + @Test(timeout=300_000) + fun `ECDSA secp256R1 deterministic key generation`() { val (priv, pub) = Crypto.generateKeyPair(ECDSA_SECP256R1_SHA256) val (dpriv, dpub) = Crypto.deriveKeyPair(priv, "seed-1".toByteArray()) @@ -715,8 +715,8 @@ class CryptoUtilsTest { assertEquals(dpub2, dpub_2) } - @Test - fun `ECDSA secp256K1 deterministic key generation`() { + @Test(timeout=300_000) + fun `ECDSA secp256K1 deterministic key generation`() { val (priv, pub) = Crypto.generateKeyPair(ECDSA_SECP256K1_SHA256) val (dpriv, dpub) = Crypto.deriveKeyPair(priv, "seed-1".toByteArray()) @@ -756,8 +756,8 @@ class CryptoUtilsTest { assertEquals(dpub2, dpub_2) } - @Test - fun `EdDSA ed25519 deterministic key generation`() { + @Test(timeout=300_000) + fun `EdDSA ed25519 deterministic key generation`() { val (priv, pub) = Crypto.generateKeyPair(EDDSA_ED25519_SHA512) val (dpriv, dpub) = Crypto.deriveKeyPair(priv, "seed-1".toByteArray()) @@ -797,8 +797,8 @@ class CryptoUtilsTest { assertEquals(dpub2, dpub_2) } - @Test - fun `EdDSA ed25519 keyPair from entropy`() { + @Test(timeout=300_000) + fun `EdDSA ed25519 keyPair from entropy`() { val keyPairPositive = Crypto.deriveKeyPairFromEntropy(EDDSA_ED25519_SHA512, BigInteger("10")) assertEquals("DLBL3iHCp9uRReWhhCGfCsrxZZpfAm9h9GLbfN8ijqXTq", keyPairPositive.public.toStringShort()) @@ -824,8 +824,8 @@ class CryptoUtilsTest { assertEquals("DL5tEFVMXMGrzwjfCAW34JjkhsRkPfFyJ38iEnmpB6L2Z9", keyPairBiggerThan258bits.public.toStringShort()) } - @Test - fun `ECDSA R1 keyPair from entropy`() { + @Test(timeout=300_000) + fun `ECDSA R1 keyPair from entropy`() { val keyPairPositive = Crypto.deriveKeyPairFromEntropy(ECDSA_SECP256R1_SHA256, BigInteger("10")) assertEquals("DLHDcxuSt9J3cbjd2Dsx4rAgYYA7BAP7A8VLrFiq1tH9yy", keyPairPositive.public.toStringShort()) // The underlying implementation uses the hash of entropy if it is out of range 2 < entropy < N, where N the order of the group. @@ -865,8 +865,8 @@ class CryptoUtilsTest { assertEquals("DLBwjWwPJSF9E7b1NWaSbEJ4oK8CF7RDGWd648TiBhZoL1", keyPairBiggerThan258bits.public.toStringShort()) } - @Test - fun `ECDSA K1 keyPair from entropy`() { + @Test(timeout=300_000) + fun `ECDSA K1 keyPair from entropy`() { val keyPairPositive = Crypto.deriveKeyPairFromEntropy(ECDSA_SECP256K1_SHA256, BigInteger("10")) assertEquals("DL6pYKUgH17az8MLdonvvUtUPN8TqwpCGcdgLr7vg3skCU", keyPairPositive.public.toStringShort()) // The underlying implementation uses the hash of entropy if it is out of range 2 <= entropy < N, where N the order of the group. @@ -906,8 +906,8 @@ class CryptoUtilsTest { assertEquals("DL7NbssqvuuJ4cqFkkaVYu9j1MsVswESGgCfbqBS9ULwuM", keyPairBiggerThan258bits.public.toStringShort()) } - @Test - fun `Ensure deterministic signatures of EdDSA, SPHINCS-256 and RSA PKCS1`() { + @Test(timeout=300_000) + fun `Ensure deterministic signatures of EdDSA, SPHINCS-256 and RSA PKCS1`() { listOf(EDDSA_ED25519_SHA512, SPHINCS256_SHA256, RSA_SHA256) .forEach { testDeterministicSignatures(it) } } @@ -932,8 +932,8 @@ class CryptoUtilsTest { this.outputStream.close() } - @Test - fun `test default SecureRandom uses platformSecureRandom`() { + @Test(timeout=300_000) + fun `test default SecureRandom uses platformSecureRandom`() { // Note than in Corda, [CordaSecurityProvider] is registered as the first provider. // Remove [CordaSecurityProvider] in case it is already registered. diff --git a/core/src/test/kotlin/net/corda/core/crypto/EdDSATests.kt b/core/src/test/kotlin/net/corda/core/crypto/EdDSATests.kt index e0a0ea15b4..cadb29c18a 100644 --- a/core/src/test/kotlin/net/corda/core/crypto/EdDSATests.kt +++ b/core/src/test/kotlin/net/corda/core/crypto/EdDSATests.kt @@ -16,8 +16,8 @@ import kotlin.test.assertNotEquals * Testing PureEdDSA Ed25519 using test vectors from https://tools.ietf.org/html/rfc8032#section-7.1 */ class EdDSATests { - @Test - fun `PureEdDSA Ed25519 test vectors`() { + @Test(timeout=300_000) + fun `PureEdDSA Ed25519 test vectors`() { val edParams = Crypto.EDDSA_ED25519_SHA512.algSpec as EdDSANamedCurveSpec // MESSAGE (length 0 bytes). diff --git a/core/src/test/kotlin/net/corda/core/crypto/SecureHashTest.kt b/core/src/test/kotlin/net/corda/core/crypto/SecureHashTest.kt index 492bf1af20..908300d016 100644 --- a/core/src/test/kotlin/net/corda/core/crypto/SecureHashTest.kt +++ b/core/src/test/kotlin/net/corda/core/crypto/SecureHashTest.kt @@ -4,8 +4,8 @@ import org.junit.Test import kotlin.test.assertEquals class SecureHashTest { - @Test - fun `sha256 does not retain state between same-thread invocations`() { + @Test(timeout=300_000) + fun `sha256 does not retain state between same-thread invocations`() { assertEquals(SecureHash.sha256("abc"), SecureHash.sha256("abc")) } } diff --git a/core/src/test/kotlin/net/corda/core/identity/CordaX500NameTest.kt b/core/src/test/kotlin/net/corda/core/identity/CordaX500NameTest.kt index 53dc7e186a..3a610aec98 100644 --- a/core/src/test/kotlin/net/corda/core/identity/CordaX500NameTest.kt +++ b/core/src/test/kotlin/net/corda/core/identity/CordaX500NameTest.kt @@ -8,8 +8,8 @@ import kotlin.test.assertNull import java.lang.Character.MIN_VALUE as NULLCHAR class CordaX500NameTest { - @Test - fun `service name with organisational unit`() { + @Test(timeout=300_000) + fun `service name with organisational unit`() { val name = CordaX500Name.parse("O=Bank A, L=New York, C=US, OU=Org Unit, CN=Service Name") assertEquals("Service Name", name.commonName) assertEquals("Org Unit", name.organisationUnit) @@ -19,8 +19,8 @@ class CordaX500NameTest { assertEquals(CordaX500Name.build(name.x500Principal), name) } - @Test - fun `service name`() { + @Test(timeout=300_000) + fun `service name`() { val name = CordaX500Name.parse("O=Bank A, L=New York, C=US, CN=Service Name") assertEquals("Service Name", name.commonName) assertNull(name.organisationUnit) @@ -30,8 +30,8 @@ class CordaX500NameTest { assertEquals(CordaX500Name.build(name.x500Principal), name) } - @Test - fun `legal entity name`() { + @Test(timeout=300_000) + fun `legal entity name`() { val name = CordaX500Name.parse("O=Bank A, L=New York, C=US") assertNull(name.commonName) assertNull(name.organisationUnit) @@ -41,36 +41,36 @@ class CordaX500NameTest { assertEquals(CordaX500Name.build(name.x500Principal), name) } - @Test - fun `rejects name with no organisation`() { + @Test(timeout=300_000) + fun `rejects name with no organisation`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("L=New York, C=US, OU=Org Unit, CN=Service Name") } } - @Test - fun `rejects name with no locality`() { + @Test(timeout=300_000) + fun `rejects name with no locality`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=Bank A, C=US, OU=Org Unit, CN=Service Name") } } - @Test - fun `rejects name with no country`() { + @Test(timeout=300_000) + fun `rejects name with no country`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=Bank A, L=New York, OU=Org Unit, CN=Service Name") } } - @Test - fun `rejects name with unsupported attribute`() { + @Test(timeout=300_000) + fun `rejects name with unsupported attribute`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=Bank A, L=New York, C=US, SN=blah") } } - @Test - fun `rejects organisation (but not other attributes) with non-latin letters`() { + @Test(timeout=300_000) + fun `rejects organisation (but not other attributes) with non-latin letters`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=Bཛྷa, L=New York, C=DE, OU=Org Unit, CN=Service Name") } @@ -78,8 +78,8 @@ class CordaX500NameTest { validateLocalityAndOrganisationalUnitAndCommonName("Bཛྷa") } - @Test - fun `organisation (but not other attributes) must have at least two letters`() { + @Test(timeout=300_000) + fun `organisation (but not other attributes) must have at least two letters`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=B, L=New York, C=DE, OU=Org Unit, CN=Service Name") } @@ -91,78 +91,78 @@ class CordaX500NameTest { validateLocalityAndOrganisationalUnitAndCommonName("") } - @Test - fun `accepts attributes starting with lower case letter`() { + @Test(timeout=300_000) + fun `accepts attributes starting with lower case letter`() { CordaX500Name.parse("O=bank A, L=New York, C=DE, OU=Org Unit, CN=Service Name") validateLocalityAndOrganisationalUnitAndCommonName("bank") } - @Test - fun `accepts attributes starting with numeric character`() { + @Test(timeout=300_000) + fun `accepts attributes starting with numeric character`() { CordaX500Name.parse("O=8Bank A, L=New York, C=DE, OU=Org Unit, CN=Service Name") validateLocalityAndOrganisationalUnitAndCommonName("8bank") } - @Test - fun `accepts attributes with leading whitespace`() { + @Test(timeout=300_000) + fun `accepts attributes with leading whitespace`() { CordaX500Name.parse("O= VALID, L=VALID, C=DE, OU=VALID, CN=VALID") validateLocalityAndOrganisationalUnitAndCommonName(" VALID") } - @Test - fun `accepts attributes with trailing whitespace`() { + @Test(timeout=300_000) + fun `accepts attributes with trailing whitespace`() { CordaX500Name.parse("O=VALID , L=VALID, C=DE, OU=VALID, CN=VALID") validateLocalityAndOrganisationalUnitAndCommonName("VALID ") } - @Test - fun `rejects attributes with comma`() { + @Test(timeout=300_000) + fun `rejects attributes with comma`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=IN,VALID, L=VALID, C=DE, OU=VALID, CN=VALID") } checkLocalityAndOrganisationalUnitAndCommonNameReject("IN,VALID") } - @Test - fun `accepts org with equals sign`() { + @Test(timeout=300_000) + fun `accepts org with equals sign`() { CordaX500Name.parse("O=IN=VALID, L=VALID, C=DE, OU=VALID, CN=VALID") } - @Test - fun `accepts organisation with dollar sign`() { + @Test(timeout=300_000) + fun `accepts organisation with dollar sign`() { CordaX500Name.parse("O=VA\$LID, L=VALID, C=DE, OU=VALID, CN=VALID") validateLocalityAndOrganisationalUnitAndCommonName("VA\$LID") } - @Test - fun `rejects attributes with double quotation mark`() { + @Test(timeout=300_000) + fun `rejects attributes with double quotation mark`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=IN\"VALID, L=VALID, C=DE, OU=VALID, CN=VALID") } checkLocalityAndOrganisationalUnitAndCommonNameReject("IN\"VALID") } - @Test - fun `accepts organisation with single quotation mark`() { + @Test(timeout=300_000) + fun `accepts organisation with single quotation mark`() { CordaX500Name.parse("O=VA'LID, L=VALID, C=DE, OU=VALID, CN=VALID") validateLocalityAndOrganisationalUnitAndCommonName("VA'LID") } - @Test - fun `rejects organisation with backslash`() { + @Test(timeout=300_000) + fun `rejects organisation with backslash`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=IN\\VALID, L=VALID, C=DE, OU=VALID, CN=VALID") } checkLocalityAndOrganisationalUnitAndCommonNameReject("IN\\VALID") } - @Test - fun `rejects double spacing only in the organisation attribute`() { + @Test(timeout=300_000) + fun `rejects double spacing only in the organisation attribute`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=IN VALID , L=VALID, C=DE, OU=VALID, CN=VALID") } validateLocalityAndOrganisationalUnitAndCommonName("VA LID") } - @Test - fun `rejects organisation (but not other attributes) containing the null character`() { + @Test(timeout=300_000) + fun `rejects organisation (but not other attributes) containing the null character`() { assertFailsWith(IllegalArgumentException::class) { CordaX500Name.parse("O=IN${NULLCHAR}VALID , L=VALID, C=DE, OU=VALID, CN=VALID") } diff --git a/core/src/test/kotlin/net/corda/core/identity/X500UtilsTest.kt b/core/src/test/kotlin/net/corda/core/identity/X500UtilsTest.kt index ba166cb7c1..9d5a8551aa 100644 --- a/core/src/test/kotlin/net/corda/core/identity/X500UtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/identity/X500UtilsTest.kt @@ -7,8 +7,8 @@ import kotlin.test.assertTrue class X500UtilsTest { - @Test - fun `X500Principal equalX500NameParts matches regardless the order`() { + @Test(timeout=300_000) + fun `X500Principal equalX500NameParts matches regardless the order`() { // given val orderingA = "O=Bank A, OU=Organisation Unit, L=New York, C=US" val orderingB = "OU=Organisation Unit, O=Bank A, L=New York, C=US" diff --git a/core/src/test/kotlin/net/corda/core/internal/ClassLoadingUtilsTest.kt b/core/src/test/kotlin/net/corda/core/internal/ClassLoadingUtilsTest.kt index 8378ff3213..6fb8e29b71 100644 --- a/core/src/test/kotlin/net/corda/core/internal/ClassLoadingUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/ClassLoadingUtilsTest.kt @@ -58,8 +58,8 @@ class ClassLoadingUtilsTest { @Suppress("unused") class ConcreteClassWithNonEmptyConstructor(private val someData: Int): BaseInterface2 - @Test - fun predicateClassAreLoadedSuccessfully() { + @Test(timeout=300_000) + fun predicateClassAreLoadedSuccessfully() { val classes = createInstancesOfClassesImplementing(BaseInterface::class.java.classLoader, BaseInterface::class.java) val classNames = classes.map { it.javaClass.name } @@ -74,8 +74,8 @@ class ClassLoadingUtilsTest { createInstancesOfClassesImplementing(BaseInterface::class.java.classLoader, BaseInterface2::class.java) } - @Test - fun `thread context class loader is adjusted, during the function execution`() { + @Test(timeout=300_000) + fun `thread context class loader is adjusted, during the function execution`() { val result = executeWithThreadContextClassLoader(temporaryClassLoader) { assertThat(Thread.currentThread().contextClassLoader).isEqualTo(temporaryClassLoader) true @@ -85,8 +85,8 @@ class ClassLoadingUtilsTest { assertThat(Thread.currentThread().contextClassLoader).isNotEqualTo(temporaryClassLoader) } - @Test - fun `thread context class loader is set to the initial, even in case of a failure`() { + @Test(timeout=300_000) + fun `thread context class loader is set to the initial, even in case of a failure`() { assertThatThrownBy { executeWithThreadContextClassLoader(temporaryClassLoader) { throw RuntimeException() } }.isInstanceOf(RuntimeException::class.java) @@ -94,8 +94,8 @@ class ClassLoadingUtilsTest { assertThat(Thread.currentThread().contextClassLoader).isNotEqualTo(temporaryClassLoader) } - @Test - fun `test locating classes inside attachment`() { + @Test(timeout=300_000) + fun `test locating classes inside attachment`() { val jarData = with(ByteArrayOutputStream()) { val internalName = STANDALONE_CLASS_NAME.asInternalName JarOutputStream(this, Manifest()).use { diff --git a/core/src/test/kotlin/net/corda/core/internal/InternalUtilsTest.kt b/core/src/test/kotlin/net/corda/core/internal/InternalUtilsTest.kt index 0e7b297a30..3afc31c8b5 100644 --- a/core/src/test/kotlin/net/corda/core/internal/InternalUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/InternalUtilsTest.kt @@ -17,23 +17,23 @@ import kotlin.test.assertEquals import kotlin.test.assertFailsWith open class InternalUtilsTest { - @Test - fun `noneOrSingle on an empty collection`() { + @Test(timeout=300_000) + fun `noneOrSingle on an empty collection`() { val collection = emptyList() assertThat(collection.noneOrSingle()).isNull() assertThat(collection.noneOrSingle { it == 1 }).isNull() } - @Test - fun `noneOrSingle on a singleton collection`() { + @Test(timeout=300_000) + fun `noneOrSingle on a singleton collection`() { val collection = listOf(1) assertThat(collection.noneOrSingle()).isEqualTo(1) assertThat(collection.noneOrSingle { it == 1 }).isEqualTo(1) assertThat(collection.noneOrSingle { it == 2 }).isNull() } - @Test - fun `noneOrSingle on a collection with two items`() { + @Test(timeout=300_000) + fun `noneOrSingle on a collection with two items`() { val collection = listOf(1, 2) assertFailsWith { collection.noneOrSingle() } assertThat(collection.noneOrSingle { it == 1 }).isEqualTo(1) @@ -42,29 +42,29 @@ open class InternalUtilsTest { assertFailsWith { collection.noneOrSingle { it > 0 } } } - @Test - fun `noneOrSingle on a collection with items 1, 2, 1`() { + @Test(timeout=300_000) + fun `noneOrSingle on a collection with items 1, 2, 1`() { val collection = listOf(1, 2, 1) assertFailsWith { collection.noneOrSingle() } assertFailsWith { collection.noneOrSingle { it == 1 } } assertThat(collection.noneOrSingle { it == 2 }).isEqualTo(2) } - @Test - fun `indexOfOrThrow returns index of the given item`() { + @Test(timeout=300_000) + fun `indexOfOrThrow returns index of the given item`() { val collection = listOf(1, 2) assertEquals(collection.indexOfOrThrow(1), 0) assertEquals(collection.indexOfOrThrow(2), 1) } - @Test - fun `indexOfOrThrow throws if the given item is not found`() { + @Test(timeout=300_000) + fun `indexOfOrThrow throws if the given item is not found`() { val collection = listOf(1) assertFailsWith { collection.indexOfOrThrow(2) } } - @Test - fun `IntProgression stream works`() { + @Test(timeout=300_000) + fun `IntProgression stream works`() { assertArrayEquals(intArrayOf(1, 2, 3, 4), (1..4).stream().toArray()) assertArrayEquals(intArrayOf(1, 2, 3, 4), (1 until 5).stream().toArray()) assertArrayEquals(intArrayOf(1, 3), (1..4 step 2).stream().toArray()) @@ -76,8 +76,8 @@ open class InternalUtilsTest { assertArrayEquals(intArrayOf(3, 1), (3 downTo 1 step 2).stream().toArray()) } - @Test - fun `IntProgression spliterator characteristics and comparator`() { + @Test(timeout=300_000) + fun `IntProgression spliterator characteristics and comparator`() { val rangeCharacteristics = IntStream.range(0, 2).spliterator().characteristics() val forward = (0..9 step 3).stream().spliterator() assertEquals(rangeCharacteristics, forward.characteristics()) @@ -87,8 +87,8 @@ open class InternalUtilsTest { assertEquals(Comparator.reverseOrder(), reverse.comparator) } - @Test - fun `Stream toTypedArray works`() { + @Test(timeout=300_000) + fun `Stream toTypedArray works`() { val a: Array = Stream.of("one", "two").toTypedArray() assertEquals(Array::class.java, a.javaClass) assertArrayEquals(arrayOf("one", "two"), a) @@ -97,8 +97,8 @@ open class InternalUtilsTest { assertArrayEquals(arrayOf("one", "two", null), b) } - @Test - fun kotlinObjectInstance() { + @Test(timeout=300_000) + fun kotlinObjectInstance() { assertThat(PublicObject::class.java.kotlinObjectInstance).isSameAs(PublicObject) assertThat(PrivateObject::class.java.kotlinObjectInstance).isSameAs(PrivateObject) assertThat(ProtectedObject::class.java.kotlinObjectInstance).isSameAs(ProtectedObject) @@ -106,8 +106,8 @@ open class InternalUtilsTest { assertThat(PrivateClass::class.java.kotlinObjectInstance).isNull() } - @Test - fun `bufferUntilSubscribed delays emission until the first subscription`() { + @Test(timeout=300_000) + fun `bufferUntilSubscribed delays emission until the first subscription`() { val sourceSubject: PublishSubject = PublishSubject.create() val bufferedObservable: rx.Observable = uncheckedCast(sourceSubject.bufferUntilSubscribed()) @@ -123,15 +123,15 @@ open class InternalUtilsTest { assertThat(itemsFromNonBufferedObservable).doesNotContain(1) } - @Test - fun `test SHA-256 hash for InputStream`() { + @Test(timeout=300_000) + fun `test SHA-256 hash for InputStream`() { val contents = arrayOfJunk(DEFAULT_BUFFER_SIZE * 2 + DEFAULT_BUFFER_SIZE / 2) assertThat(contents.inputStream().hash()) .isEqualTo(SecureHash.parse("A4759E7AA20338328866A2EA17EAF8C7FE4EC6BBE3BB71CEE7DF7C0461B3C22F")) } - @Test - fun `warnOnce works, but the backing cache grows only to a maximum size`() { + @Test(timeout=300_000) + fun `warnOnce works, but the backing cache grows only to a maximum size`() { val MAX_SIZE = 100 val logger = mock() diff --git a/core/src/test/kotlin/net/corda/core/internal/LegalNameValidatorTest.kt b/core/src/test/kotlin/net/corda/core/internal/LegalNameValidatorTest.kt index 1f4ba6eec4..ba87e9fa33 100644 --- a/core/src/test/kotlin/net/corda/core/internal/LegalNameValidatorTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/LegalNameValidatorTest.kt @@ -5,30 +5,30 @@ import kotlin.test.assertEquals import kotlin.test.assertFailsWith class LegalNameValidatorTest { - @Test - fun `no double spaces`() { + @Test(timeout=300_000) + fun `no double spaces`() { assertFailsWith(IllegalArgumentException::class) { LegalNameValidator.validateOrganization("Test Legal Name", LegalNameValidator.Validation.FULL) } LegalNameValidator.validateOrganization(LegalNameValidator.normalize("Test Legal Name"), LegalNameValidator.Validation.FULL) } - @Test - fun `no trailing white space`() { + @Test(timeout=300_000) + fun `no trailing white space`() { assertFailsWith(IllegalArgumentException::class) { LegalNameValidator.validateOrganization("Test ", LegalNameValidator.Validation.FULL) } } - @Test - fun `no prefixed white space`() { + @Test(timeout=300_000) + fun `no prefixed white space`() { assertFailsWith(IllegalArgumentException::class) { LegalNameValidator.validateOrganization(" Test", LegalNameValidator.Validation.FULL) } } - @Test - fun `blacklisted characters`() { + @Test(timeout=300_000) + fun `blacklisted characters`() { LegalNameValidator.validateOrganization("Test", LegalNameValidator.Validation.FULL) assertFailsWith(IllegalArgumentException::class) { LegalNameValidator.validateOrganization("\$Test", LegalNameValidator.Validation.FULL) @@ -44,8 +44,8 @@ class LegalNameValidatorTest { } } - @Test - fun `unicode range in organization`() { + @Test(timeout=300_000) + fun `unicode range in organization`() { LegalNameValidator.validateOrganization("The quick brown fox jumped over the lazy dog.1234567890", LegalNameValidator.Validation.FULL) assertFailsWith(IllegalArgumentException::class) { // Null @@ -69,8 +69,8 @@ class LegalNameValidatorTest { } } - @Test - fun `unicode range in general attributes`() { + @Test(timeout=300_000) + fun `unicode range in general attributes`() { LegalNameValidator.validateNameAttribute("The quick brown fox jumped over the lazy dog.1234567890", LegalNameValidator.Validation.FULL) assertFailsWith(IllegalArgumentException::class) { // Right to left direction override @@ -92,8 +92,8 @@ class LegalNameValidatorTest { } } - @Test - fun `legal name length less then 256 characters`() { + @Test(timeout=300_000) + fun `legal name length less then 256 characters`() { val longLegalName = StringBuilder() while (longLegalName.length < 255) { longLegalName.append("A") @@ -105,8 +105,8 @@ class LegalNameValidatorTest { } } - @Test - fun `legal name should be capitalized`() { + @Test(timeout=300_000) + fun `legal name should be capitalized`() { LegalNameValidator.validateOrganization("Good legal name", LegalNameValidator.Validation.FULL) assertFailsWith(IllegalArgumentException::class) { LegalNameValidator.validateOrganization("bad name", LegalNameValidator.Validation.FULL) @@ -116,8 +116,8 @@ class LegalNameValidatorTest { } } - @Test - fun `correctly handle whitespaces`() { + @Test(timeout=300_000) + fun `correctly handle whitespaces`() { assertEquals("Legal Name With Tab", LegalNameValidator.normalize("Legal Name With\tTab")) assertEquals("Legal Name With Unicode Whitespaces", LegalNameValidator.normalize("Legal Name\u2004With\u0009Unicode\u0020Whitespaces")) assertEquals("Legal Name With Line Breaks", LegalNameValidator.normalize("Legal Name With\n\rLine\nBreaks")) diff --git a/core/src/test/kotlin/net/corda/core/internal/NamedCacheTest.kt b/core/src/test/kotlin/net/corda/core/internal/NamedCacheTest.kt index 4d9f9297ab..0074b209a0 100644 --- a/core/src/test/kotlin/net/corda/core/internal/NamedCacheTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/NamedCacheTest.kt @@ -26,8 +26,8 @@ class NamedCacheTest : NamedCacheFactory { assertEquals(throws, exceptionThrown) } - @Test - fun TestCheckCacheName() { + @Test(timeout=300_000) + fun TestCheckCacheName() { checkNameHelper("abc_123.234", false) checkNameHelper("", true) checkNameHelper("abc 123", true) diff --git a/core/src/test/kotlin/net/corda/core/internal/PathUtilsTest.kt b/core/src/test/kotlin/net/corda/core/internal/PathUtilsTest.kt index 154a5eb2f7..75398c991c 100644 --- a/core/src/test/kotlin/net/corda/core/internal/PathUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/PathUtilsTest.kt @@ -13,37 +13,37 @@ class PathUtilsTest { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `deleteRecursively - non-existent path`() { + @Test(timeout=300_000) + fun `deleteRecursively - non-existent path`() { val path = tempFolder.root.toPath() / "non-existent" path.deleteRecursively() assertThat(path).doesNotExist() } - @Test - fun `deleteRecursively - file`() { + @Test(timeout=300_000) + fun `deleteRecursively - file`() { val file = (tempFolder.root.toPath() / "file").createFile() file.deleteRecursively() assertThat(file).doesNotExist() } - @Test - fun `deleteRecursively - empty folder`() { + @Test(timeout=300_000) + fun `deleteRecursively - empty folder`() { val emptyDir = (tempFolder.root.toPath() / "empty").createDirectories() emptyDir.deleteRecursively() assertThat(emptyDir).doesNotExist() } - @Test - fun `deleteRecursively - dir with single file`() { + @Test(timeout=300_000) + fun `deleteRecursively - dir with single file`() { val dir = (tempFolder.root.toPath() / "dir").createDirectories() (dir / "file").createFile() dir.deleteRecursively() assertThat(dir).doesNotExist() } - @Test - fun `deleteRecursively - nested single file`() { + @Test(timeout=300_000) + fun `deleteRecursively - nested single file`() { val dir = (tempFolder.root.toPath() / "dir").createDirectories() val dir2 = (dir / "dir2").createDirectories() (dir2 / "file").createFile() @@ -51,8 +51,8 @@ class PathUtilsTest { assertThat(dir).doesNotExist() } - @Test - fun `deleteRecursively - complex`() { + @Test(timeout=300_000) + fun `deleteRecursively - complex`() { val dir = (tempFolder.root.toPath() / "dir").createDirectories() (dir / "file1").createFile() val dir2 = (dir / "dir2").createDirectories() @@ -63,8 +63,8 @@ class PathUtilsTest { assertThat(dir).doesNotExist() } - @Test - fun `copyToDirectory - copy into zip directory`() { + @Test(timeout=300_000) + fun `copyToDirectory - copy into zip directory`() { val source: Path = tempFolder.newFile("source.txt").let { it.writeText("Example Text") it.toPath() diff --git a/core/src/test/kotlin/net/corda/core/internal/StatePointerSearchTests.kt b/core/src/test/kotlin/net/corda/core/internal/StatePointerSearchTests.kt index cf1686e1f0..37c63d8379 100644 --- a/core/src/test/kotlin/net/corda/core/internal/StatePointerSearchTests.kt +++ b/core/src/test/kotlin/net/corda/core/internal/StatePointerSearchTests.kt @@ -42,16 +42,16 @@ class StatePointerSearchTests { override val participants: List get() = listOf() } - @Test - fun `find pointer in state with generic type`() { + @Test(timeout=300_000) + fun `find pointer in state with generic type`() { val linearPointer = LinearPointer(UniqueIdentifier(), LinearState::class.java) val testState = StateWithGeneric(Amount(100L, Issued(partyAndRef, linearPointer))) val results = StatePointerSearch(testState).search() assertEquals(results, setOf(linearPointer)) } - @Test - fun `find pointers which are inside a list`() { + @Test(timeout=300_000) + fun `find pointers which are inside a list`() { val linearPointerOne = LinearPointer(UniqueIdentifier(), LinearState::class.java) val linearPointerTwo = LinearPointer(UniqueIdentifier(), LinearState::class.java) val testState = StateWithList(listOf(linearPointerOne, linearPointerTwo)) @@ -59,8 +59,8 @@ class StatePointerSearchTests { assertEquals(results, setOf(linearPointerOne, linearPointerTwo)) } - @Test - fun `find pointers which are inside a map`() { + @Test(timeout=300_000) + fun `find pointers which are inside a map`() { val linearPointerOne = LinearPointer(UniqueIdentifier(), LinearState::class.java) val linearPointerTwo = LinearPointer(UniqueIdentifier(), LinearState::class.java) val testState = StateWithMap(mapOf(linearPointerOne to 1, 2 to linearPointerTwo)) @@ -68,24 +68,24 @@ class StatePointerSearchTests { assertEquals(results, setOf(linearPointerOne, linearPointerTwo)) } - @Test - fun `find pointers which are inside a set`() { + @Test(timeout=300_000) + fun `find pointers which are inside a set`() { val linearPointer = LinearPointer(UniqueIdentifier(), LinearState::class.java) val testState = StateWithSet(setOf(linearPointer)) val results = StatePointerSearch(testState).search() assertEquals(results, setOf(linearPointer)) } - @Test - fun `find pointers which are inside nested iterables`() { + @Test(timeout=300_000) + fun `find pointers which are inside nested iterables`() { val linearPointer = LinearPointer(UniqueIdentifier(), LinearState::class.java) val testState = StateWithListOfList(listOf(listOf(linearPointer))) val results = StatePointerSearch(testState).search() assertEquals(results, setOf(linearPointer)) } - @Test - fun `ignore static fields`() { + @Test(timeout=300_000) + fun `ignore static fields`() { val results = StatePointerSearch(StateWithStaticField(1)).search() assertThat(results).isEmpty() } diff --git a/core/src/test/kotlin/net/corda/core/internal/ToggleFieldTest.kt b/core/src/test/kotlin/net/corda/core/internal/ToggleFieldTest.kt index 40a750f785..446b41a3e5 100644 --- a/core/src/test/kotlin/net/corda/core/internal/ToggleFieldTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/ToggleFieldTest.kt @@ -52,8 +52,8 @@ class ToggleFieldTest { } } - @Test - fun `toggle is enforced`() { + @Test(timeout=300_000) + fun `toggle is enforced`() { listOf(SimpleToggleField("simple"), ThreadLocalToggleField("local"), inheritableThreadLocalToggleField()).forEach { field -> assertNull(field.get()) assertThatThrownBy { field.set(null) }.isInstanceOf(IllegalStateException::class.java) @@ -67,8 +67,8 @@ class ToggleFieldTest { } } - @Test - fun `write-at-most-once field works`() { + @Test(timeout=300_000) + fun `write-at-most-once field works`() { val field = SimpleToggleField("field", true) assertNull(field.get()) assertThatThrownBy { field.set(null) }.isInstanceOf(IllegalStateException::class.java) @@ -80,8 +80,8 @@ class ToggleFieldTest { } } - @Test - fun `thread local works`() { + @Test(timeout=300_000) + fun `thread local works`() { val field = ThreadLocalToggleField("field") assertNull(field.get()) field.set("hello") @@ -93,8 +93,8 @@ class ToggleFieldTest { assertNull(field.get()) } - @Test - fun `inheritable thread local works`() { + @Test(timeout=300_000) + fun `inheritable thread local works`() { val field = inheritableThreadLocalToggleField() assertNull(field.get()) field.set("hello") @@ -106,8 +106,8 @@ class ToggleFieldTest { assertNull(field.get()) } - @Test - fun `existing threads do not inherit`() { + @Test(timeout=300_000) + fun `existing threads do not inherit`() { val field = inheritableThreadLocalToggleField() withSingleThreadExecutor { field.set("hello") @@ -116,8 +116,8 @@ class ToggleFieldTest { } } - @Test - fun `inherited values are poisoned on clear`() { + @Test(timeout=300_000) + fun `inherited values are poisoned on clear`() { val field = inheritableThreadLocalToggleField() field.set("hello") withSingleThreadExecutor { @@ -139,8 +139,8 @@ class ToggleFieldTest { } /** We log a warning rather than failing-fast as the new thread may be an undetected global. */ - @Test - fun `leaked thread propagates holder to non-global thread, with warning`() { + @Test(timeout=300_000) + fun `leaked thread propagates holder to non-global thread, with warning`() { val field = inheritableThreadLocalToggleField() field.set("hello") withSingleThreadExecutor { @@ -169,8 +169,8 @@ class ToggleFieldTest { } } - @Test - fun `leaked thread does not propagate holder to global thread, with warning`() { + @Test(timeout=300_000) + fun `leaked thread does not propagate holder to global thread, with warning`() { val field = inheritableThreadLocalToggleField() field.set("hello") withSingleThreadExecutor { @@ -190,8 +190,8 @@ class ToggleFieldTest { } } - @Test - fun `non-leaked thread does not propagate holder to global thread, without warning`() { + @Test(timeout=300_000) + fun `non-leaked thread does not propagate holder to global thread, without warning`() { val field = inheritableThreadLocalToggleField() field.set("hello") withSingleThreadExecutor { diff --git a/core/src/test/kotlin/net/corda/core/internal/concurrent/CordaFutureImplTest.kt b/core/src/test/kotlin/net/corda/core/internal/concurrent/CordaFutureImplTest.kt index 0ca6be9afb..365b06993c 100644 --- a/core/src/test/kotlin/net/corda/core/internal/concurrent/CordaFutureImplTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/concurrent/CordaFutureImplTest.kt @@ -14,8 +14,8 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue class CordaFutureTest { - @Test - fun `fork works`() { + @Test(timeout=300_000) + fun `fork works`() { val e = Executors.newSingleThreadExecutor() try { assertEquals(100, e.fork { 100 }.getOrThrow()) @@ -27,8 +27,8 @@ class CordaFutureTest { } } - @Test - fun `if a listener fails its throwable is logged`() { + @Test(timeout=300_000) + fun `if a listener fails its throwable is logged`() { val f = CordaFutureImpl() val x = Exception() val log = mock() @@ -41,8 +41,8 @@ class CordaFutureTest { assertTrue(flag.get()) } - @Test - fun `map works`() { + @Test(timeout=300_000) + fun `map works`() { run { val f = CordaFutureImpl() val g = f.map { it * 2 } @@ -67,8 +67,8 @@ class CordaFutureTest { } } - @Test - fun `flatMap works`() { + @Test(timeout=300_000) + fun `flatMap works`() { run { val f = CordaFutureImpl() val g = f.flatMap { CordaFutureImpl().apply { set(it * 2) } } @@ -100,8 +100,8 @@ class CordaFutureTest { } } - @Test - fun `andForget works`() { + @Test(timeout=300_000) + fun `andForget works`() { val log = mock() doNothing().whenever(log).error(any(), any()) val throwable = Exception("Boom") @@ -111,8 +111,8 @@ class CordaFutureTest { verify(log).error(any(), same(throwable)) } - @Test - fun `captureLater works`() { + @Test(timeout=300_000) + fun `captureLater works`() { val failingFuture = CordaFutureImpl() val anotherFailingFuture = CordaFutureImpl() anotherFailingFuture.captureLater(failingFuture) @@ -129,13 +129,13 @@ class TransposeTest { private val b = openFuture() private val c = openFuture() private val f = listOf(a, b, c).transpose() - @Test - fun `transpose empty collection`() { + @Test(timeout=300_000) + fun `transpose empty collection`() { assertEquals(emptyList(), emptyList>().transpose().getOrThrow()) } - @Test - fun `transpose values are in the same order as the collection of futures`() { + @Test(timeout=300_000) + fun `transpose values are in the same order as the collection of futures`() { b.set(2) c.set(3) assertFalse(f.isDone) @@ -143,8 +143,8 @@ class TransposeTest { assertEquals(listOf(1, 2, 3), f.getOrThrow()) } - @Test - fun `transpose throwables are reported in the order they were thrown`() { + @Test(timeout=300_000) + fun `transpose throwables are reported in the order they were thrown`() { val ax = Exception() val bx = Exception() val cx = Exception() @@ -158,8 +158,8 @@ class TransposeTest { assertEquals(emptyList(), cx.suppressed.asList()) } - @Test - fun `transpose mixture of outcomes`() { + @Test(timeout=300_000) + fun `transpose mixture of outcomes`() { val bx = Exception() val cx = Exception() b.setException(bx) diff --git a/core/src/test/kotlin/net/corda/core/internal/cordapp/CordappResolverTest.kt b/core/src/test/kotlin/net/corda/core/internal/cordapp/CordappResolverTest.kt index 3bd2e5da4e..be8e04c3d3 100644 --- a/core/src/test/kotlin/net/corda/core/internal/cordapp/CordappResolverTest.kt +++ b/core/src/test/kotlin/net/corda/core/internal/cordapp/CordappResolverTest.kt @@ -16,8 +16,8 @@ class CordappResolverTest { CordappResolver.clear() } - @Test - fun `the correct cordapp resolver is used after calling withCordappInfo`() { + @Test(timeout=300_000) + fun `the correct cordapp resolver is used after calling withCordappInfo`() { val defaultTargetVersion = 222 CordappResolver.register(CordappImpl.TEST_INSTANCE.copy( @@ -35,8 +35,8 @@ class CordappResolverTest { assertEquals(defaultTargetVersion, CordappResolver.currentTargetVersion) } - @Test - fun `when the same cordapp is registered for the same class multiple times, the resolver deduplicates and returns it as the current one`() { + @Test(timeout=300_000) + fun `when the same cordapp is registered for the same class multiple times, the resolver deduplicates and returns it as the current one`() { CordappResolver.register(CordappImpl.TEST_INSTANCE.copy( contractClassNames = listOf(javaClass.name), minimumPlatformVersion = 3, @@ -50,8 +50,8 @@ class CordappResolverTest { assertThat(CordappResolver.currentCordapp).isNotNull() } - @Test - fun `when different cordapps are registered for the same (non-contract) class, the resolver returns null`() { + @Test(timeout=300_000) + fun `when different cordapps are registered for the same (non-contract) class, the resolver returns null`() { CordappResolver.register(CordappImpl.TEST_INSTANCE.copy( contractClassNames = listOf("ContractClass1"), minimumPlatformVersion = 3, @@ -67,8 +67,8 @@ class CordappResolverTest { assertThat(CordappResolver.currentCordapp).isNull() } - @Test - fun `when different cordapps are registered for the same (contract) class, the resolver throws an exception`() { + @Test(timeout=300_000) + fun `when different cordapps are registered for the same (contract) class, the resolver throws an exception`() { val firstCordapp = CordappImpl.TEST_INSTANCE.copy( contractClassNames = listOf(javaClass.name), minimumPlatformVersion = 3, diff --git a/core/src/test/kotlin/net/corda/core/node/services/VaultEnumTypesTest.kt b/core/src/test/kotlin/net/corda/core/node/services/VaultEnumTypesTest.kt index fd775e2ba2..6367bbc786 100644 --- a/core/src/test/kotlin/net/corda/core/node/services/VaultEnumTypesTest.kt +++ b/core/src/test/kotlin/net/corda/core/node/services/VaultEnumTypesTest.kt @@ -4,8 +4,8 @@ import org.assertj.core.api.Assertions import org.junit.Test class VaultEnumTypesTest { - @Test - fun vaultStatusReflectsOrdinalValues() { + @Test(timeout=300_000) + fun vaultStatusReflectsOrdinalValues() { /** * Warning!!! Do not change the order of this Enum as ordinal values are stored in the database */ diff --git a/core/src/test/kotlin/net/corda/core/utilities/ByteArraysTest.kt b/core/src/test/kotlin/net/corda/core/utilities/ByteArraysTest.kt index b18bc42b78..11454f0723 100644 --- a/core/src/test/kotlin/net/corda/core/utilities/ByteArraysTest.kt +++ b/core/src/test/kotlin/net/corda/core/utilities/ByteArraysTest.kt @@ -12,8 +12,8 @@ import java.nio.ReadOnlyBufferException import kotlin.test.assertEquals class ByteArraysTest { - @Test - fun `slice works`() { + @Test(timeout=300_000) + fun `slice works`() { byteArrayOf(9, 9, 0, 1, 2, 3, 4, 9, 9).let { sliceWorksImpl(it, OpaqueBytesSubSequence(it, 2, 5)) } @@ -46,8 +46,8 @@ class ByteArraysTest { check(byteArrayOf(), seq.slice(2, 1)) } - @Test - fun `test hex parsing strictly uppercase`() { + @Test(timeout=300_000) + fun `test hex parsing strictly uppercase`() { val HEX_REGEX = "^[0-9A-F]+\$".toRegex() val privacySalt = net.corda.core.contracts.PrivacySalt() diff --git a/core/src/test/kotlin/net/corda/core/utilities/EncodingUtilsTest.kt b/core/src/test/kotlin/net/corda/core/utilities/EncodingUtilsTest.kt index 1a9d7c694c..9ba508771b 100644 --- a/core/src/test/kotlin/net/corda/core/utilities/EncodingUtilsTest.kt +++ b/core/src/test/kotlin/net/corda/core/utilities/EncodingUtilsTest.kt @@ -15,22 +15,22 @@ class EncodingUtilsTest { val testHexString = "48656C6C6F20576F726C64" // HEX format for Hello World. // Encoding tests - @Test - fun `encoding Hello World`() { + @Test(timeout=300_000) + fun `encoding Hello World`() { assertEquals(testBase58String, testBytes.toBase58()) assertEquals(testBase64String, testBytes.toBase64()) assertEquals(testHexString, testBytes.toHex()) } - @Test - fun `empty encoding`() { + @Test(timeout=300_000) + fun `empty encoding`() { assertEquals("", EMPTY_BYTE_ARRAY.toBase58()) assertEquals("", EMPTY_BYTE_ARRAY.toBase64()) assertEquals("", EMPTY_BYTE_ARRAY.toHex()) } - @Test - fun `encoding 7 zero bytes`() { + @Test(timeout=300_000) + fun `encoding 7 zero bytes`() { val sevenZeroByteArray = ByteArray(7) assertEquals("1111111", sevenZeroByteArray.toBase58()) assertEquals("AAAAAAAAAA==", sevenZeroByteArray.toBase64()) @@ -38,22 +38,22 @@ class EncodingUtilsTest { } //Decoding tests - @Test - fun `decoding to real String`() { + @Test(timeout=300_000) + fun `decoding to real String`() { assertEquals(testString, testBase58String.base58ToRealString()) assertEquals(testString, testBase64String.base64ToRealString()) assertEquals(testString, testHexString.hexToRealString()) } - @Test - fun `decoding empty Strings`() { + @Test(timeout=300_000) + fun `decoding empty Strings`() { assertEquals("", "".base58ToRealString()) assertEquals("", "".base64ToRealString()) assertEquals("", "".hexToRealString()) } - @Test - fun `decoding lowercase and mixed HEX`() { + @Test(timeout=300_000) + fun `decoding lowercase and mixed HEX`() { val testHexStringLowercase = testHexString.toLowerCase() assertEquals(testHexString.hexToRealString(), testHexStringLowercase.hexToRealString()) @@ -61,8 +61,8 @@ class EncodingUtilsTest { assertEquals(testHexString.hexToRealString(), testHexStringMixed.hexToRealString()) } - @Test - fun `decoding on wrong format`() { + @Test(timeout=300_000) + fun `decoding on wrong format`() { // the String "Hello World" is not a valid Base58 or Base64 or HEX format try { testString.base58ToRealString() @@ -87,8 +87,8 @@ class EncodingUtilsTest { } //Encoding changers tests - @Test - fun `change encoding between base58, base64, hex`() { + @Test(timeout=300_000) + fun `change encoding between base58, base64, hex`() { // base58 to base64 assertEquals(testBase64String, testBase58String.base58toBase64()) // base58 to hex diff --git a/core/src/test/kotlin/net/corda/core/utilities/LazyMappedListTest.kt b/core/src/test/kotlin/net/corda/core/utilities/LazyMappedListTest.kt index c1dc7cf1cb..82920cef91 100644 --- a/core/src/test/kotlin/net/corda/core/utilities/LazyMappedListTest.kt +++ b/core/src/test/kotlin/net/corda/core/utilities/LazyMappedListTest.kt @@ -15,8 +15,8 @@ class LazyMappedListTest { @get:Rule val exception: ExpectedException = ExpectedException.none() - @Test - fun `LazyMappedList works`() { + @Test(timeout=300_000) + fun `LazyMappedList works`() { val originalList = (1 until 10).toList() var callCounter = 0 @@ -42,8 +42,8 @@ class LazyMappedListTest { assertEquals(1, callCounter) } - @Test - fun testMissingAttachments() { + @Test(timeout=300_000) + fun testMissingAttachments() { exception.expect(MissingAttachmentsException::class.java) exception.expectMessage("Uncatchable!") @@ -54,8 +54,8 @@ class LazyMappedListTest { lazyList.eagerDeserialise { _, _ -> -999 } } - @Test - fun testDeserialisationExceptions() { + @Test(timeout=300_000) + fun testDeserialisationExceptions() { val lazyList = (0 until 5).toList().lazyMapped { _, index -> throw TransactionDeserialisationException( OUTPUTS_GROUP, index, IllegalStateException("Catch this!")) diff --git a/core/src/test/kotlin/net/corda/core/utilities/NetworkHostAndPortTest.kt b/core/src/test/kotlin/net/corda/core/utilities/NetworkHostAndPortTest.kt index 62298b7ddf..b368e22ef5 100644 --- a/core/src/test/kotlin/net/corda/core/utilities/NetworkHostAndPortTest.kt +++ b/core/src/test/kotlin/net/corda/core/utilities/NetworkHostAndPortTest.kt @@ -8,8 +8,8 @@ class NetworkHostAndPortTest { /** * If a host isn't known-good it should go via the parser, which does some validation. */ - @Test - fun `constructor is not fussy about host`() { + @Test(timeout=300_000) + fun `constructor is not fussy about host`() { assertEquals("", NetworkHostAndPort("", 1234).host) assertEquals("x", NetworkHostAndPort("x", 1234).host) assertEquals("500", NetworkHostAndPort("500", 1234).host) @@ -17,8 +17,8 @@ class NetworkHostAndPortTest { assertEquals("[::1]", NetworkHostAndPort("[::1]", 1234).host) // Don't do this. } - @Test - fun `constructor requires a valid port`() { + @Test(timeout=300_000) + fun `constructor requires a valid port`() { assertEquals(0, NetworkHostAndPort("example.com", 0).port) assertEquals(65535, NetworkHostAndPort("example.com", 65535).port) listOf(65536, -1).forEach { @@ -28,8 +28,8 @@ class NetworkHostAndPortTest { } } - @Test - fun `toString works`() { + @Test(timeout=300_000) + fun `toString works`() { assertEquals("example.com:1234", NetworkHostAndPort("example.com", 1234).toString()) assertEquals("example.com:65535", NetworkHostAndPort("example.com", 65535).toString()) assertEquals("1.2.3.4:1234", NetworkHostAndPort("1.2.3.4", 1234).toString()) @@ -39,8 +39,8 @@ class NetworkHostAndPortTest { assertEquals(":1234", NetworkHostAndPort("", 1234).toString()) // URI won't parse this. } - @Test - fun `parseNetworkHostAndPort works`() { + @Test(timeout=300_000) + fun `parseNetworkHostAndPort works`() { assertEquals(NetworkHostAndPort("example.com", 1234), NetworkHostAndPort.parse("example.com:1234")) assertEquals(NetworkHostAndPort("example.com", 65535), NetworkHostAndPort.parse("example.com:65535")) assertEquals(NetworkHostAndPort("1.2.3.4", 1234), NetworkHostAndPort.parse("1.2.3.4:1234")) diff --git a/detekt-baseline.xml b/detekt-baseline.xml index d652aa4996..687cece47d 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -90,7 +90,7 @@ ComplexCondition:TopLevelTransition.kt$TopLevelTransition$currentState.isTransactionTracked && checkpoint.flowState is FlowState.Started && checkpoint.flowState.flowIORequest is FlowIORequest.WaitForLedgerCommit && checkpoint.flowState.flowIORequest.hash == event.transaction.id ComplexCondition:WireTransaction.kt$WireTransaction$notary != null && (inputs.isNotEmpty() || references.isNotEmpty() || timeWindow != null) ComplexMethod:AMQPBridgeManager.kt$AMQPBridgeManager.AMQPBridge$private fun clientArtemisMessageHandler(artemisMessage: ClientMessage) - ComplexMethod:AMQPBridgeTest.kt$AMQPBridgeTest$@Test fun `test acked and nacked messages`() + ComplexMethod:AMQPBridgeTest.kt$AMQPBridgeTest$@Test(timeout=300_000) fun `test acked and nacked messages`() ComplexMethod:AMQPChannelHandler.kt$AMQPChannelHandler$override fun userEventTriggered(ctx: ChannelHandlerContext, evt: Any) ComplexMethod:AMQPTypeIdentifierParser.kt$AMQPTypeIdentifierParser$// Make sure our inputs aren't designed to blow things up. private fun validate(typeString: String) ComplexMethod:ANSIProgressRenderer.kt$ANSIProgressRenderer$// Returns number of lines rendered. private fun renderLevel(ansi: Ansi, error: Boolean): Int @@ -102,7 +102,7 @@ ComplexMethod:AbstractNode.kt$AbstractNode$private fun installCordaServices() ComplexMethod:AbstractReplayedList.kt$AbstractReplayedList$override fun sourceChanged(c: ListChangeListener.Change<out A>) ComplexMethod:ActionExecutorImpl.kt$ActionExecutorImpl$@Suspendable override fun executeAction(fiber: FlowFiber, action: Action) - ComplexMethod:AggregatedListTest.kt$AggregatedListTest$@Test fun removeWorks() + ComplexMethod:AggregatedListTest.kt$AggregatedListTest$@Test(timeout=300_000) fun removeWorks() ComplexMethod:Amount.kt$AmountTransfer$ fun apply(balances: List<SourceAndAmount<T, P>>, newRef: Any? = null): List<SourceAndAmount<T, P>> ComplexMethod:Amount.kt$AmountTransfer$ override fun equals(other: Any?): Boolean ComplexMethod:AppendOnlyPersistentMap.kt$AppendOnlyPersistentMapBase$private fun set(key: K, value: V, logWarning: Boolean, store: (K, V) -> V?): Boolean @@ -120,7 +120,7 @@ ComplexMethod:CheckpointDumperImpl.kt$CheckpointDumperImpl$fun dumpCheckpoints() ComplexMethod:CheckpointDumperImpl.kt$CheckpointDumperImpl$private fun FlowIORequest<*>.toSuspendedOn(suspendedTimestamp: Instant, now: Instant): SuspendedOn ComplexMethod:ClassCarpenter.kt$ClassCarpenterImpl$ private fun validateSchema(schema: Schema) - ComplexMethod:CompatibleTransactionTests.kt$CompatibleTransactionTests$@Test fun `Command visibility tests`() + ComplexMethod:CompatibleTransactionTests.kt$CompatibleTransactionTests$@Test(timeout=300_000) fun `Command visibility tests`() ComplexMethod:ConfigUtilities.kt$// For Iterables figure out the type parameter and apply the same logic as above on the individual elements. private fun Iterable<*>.toConfigIterable(field: Field): Iterable<Any?> ComplexMethod:ConfigUtilities.kt$// TODO Move this to KeyStoreConfigHelpers. fun MutualSslConfiguration.configureDevKeyAndTrustStores(myLegalName: CordaX500Name, signingCertificateStore: FileBasedCertificateStoreSupplier, certificatesDirectory: Path, cryptoService: CryptoService? = null) ComplexMethod:ConfigUtilities.kt$@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") // Reflect over the fields of the receiver and generate a value Map that can use to create Config object. private fun Any.toConfigMap(): Map<String, Any> @@ -133,7 +133,7 @@ ComplexMethod:CordaCliWrapper.kt$fun CordaCliWrapper.start(args: Array<String>) ComplexMethod:CordaPersistence.kt$CordaPersistence$private fun <T> inTopLevelTransaction(isolationLevel: TransactionIsolationLevel, recoverableFailureTolerance: Int, recoverAnyNestedSQLException: Boolean, statement: DatabaseTransaction.() -> T): T ComplexMethod:CordaRPCClient.kt$CordaRPCClientConfiguration$override fun equals(other: Any?): Boolean - ComplexMethod:CordaRPCClientTest.kt$CordaRPCClientTest$@Test fun `shutdown command stops the node`() + ComplexMethod:CordaRPCClientTest.kt$CordaRPCClientTest$@Test(timeout=300_000) fun `shutdown command stops the node`() ComplexMethod:CustomSerializerRegistry.kt$CachingCustomSerializerRegistry$private fun doFindCustomSerializer(clazz: Class<*>, declaredType: Type): AMQPSerializer<Any>? ComplexMethod:DeserializationInput.kt$DeserializationInput$fun readObject(obj: Any, schemas: SerializationSchemas, type: Type, context: SerializationContext): Any ComplexMethod:DriverDSLImpl.kt$DriverDSLImpl$override fun start() @@ -142,7 +142,7 @@ ComplexMethod:FlowMonitor.kt$FlowMonitor$private fun warningMessageForFlowWaitingOnIo(request: FlowIORequest<*>, flow: FlowStateMachineImpl<*>, suspensionDuration: Duration): String ComplexMethod:FlowStateMachineImpl.kt$FlowStateMachineImpl$ @Suspendable private fun processEventsUntilFlowIsResumed(isDbTransactionOpenOnEntry: Boolean, isDbTransactionOpenOnExit: Boolean): Any? ComplexMethod:GenerateRpcSslCertsCli.kt$GenerateRpcSslCerts$private fun generateRpcSslCertificates(conf: NodeConfiguration) - ComplexMethod:GenericsTests.kt$GenericsTests$@Test fun nestedSerializationInMultipleContextsDoesntColideGenericTypes() + ComplexMethod:GenericsTests.kt$GenericsTests$@Test(timeout=300_000) fun nestedSerializationInMultipleContextsDoesntColideGenericTypes() ComplexMethod:HTTPNetworkRegistrationService.kt$HTTPNetworkRegistrationService$@Throws(CertificateRequestException::class) override fun retrieveCertificates(requestId: String): CertificateResponse ComplexMethod:HibernateQueryCriteriaParser.kt$HibernateAttachmentQueryCriteriaParser$override fun parseCriteria(criteria: AttachmentQueryCriteria.AttachmentsQueryCriteria): Collection<Predicate> ComplexMethod:HibernateQueryCriteriaParser.kt$HibernateQueryCriteriaParser$override fun parseCriteria(criteria: CommonQueryCriteria): Collection<Predicate> @@ -185,7 +185,7 @@ ComplexMethod:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ErrorInterceptingHandler$ private fun doInvoke(method: Method, args: Array<out Any>?, maxNumberOfAttempts: Int): Any? ComplexMethod:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ReconnectingRPCConnection$ private tailrec fun establishConnectionWithRetry( retryInterval: Duration, roundRobinIndex: Int = 0, retries: Int = -1 ): CordaRPCConnection? ComplexMethod:RemoteTypeCarpenter.kt$SchemaBuildingRemoteTypeCarpenter$override fun carpent(typeInformation: RemoteTypeInformation): Type - ComplexMethod:RpcReconnectTests.kt$RpcReconnectTests$ @Test fun `test that the RPC client is able to reconnect and proceed after node failure, restart, or connection reset`() + ComplexMethod:RpcReconnectTests.kt$RpcReconnectTests$ @Test(timeout=300_000) fun `test that the RPC client is able to reconnect and proceed after node failure, restart, or connection reset`() ComplexMethod:SchemaMigration.kt$SchemaMigration$ private fun migrateOlderDatabaseToUseLiquibase(existingCheckpoints: Boolean): Boolean ComplexMethod:SchemaMigration.kt$SchemaMigration$private fun doRunMigration( run: Boolean, check: Boolean, existingCheckpoints: Boolean? = null ) ComplexMethod:SendTransactionFlow.kt$DataVendingFlow$@Suspendable override fun call(): Void? @@ -193,8 +193,8 @@ ComplexMethod:StartedFlowTransition.kt$StartedFlowTransition$override fun transition(): TransitionResult ComplexMethod:StatusTransitions.kt$StatusTransitions$ fun verify(tx: LedgerTransaction) ComplexMethod:StringToMethodCallParser.kt$StringToMethodCallParser$ @Throws(UnparseableCallException::class) fun parse(target: T?, command: String): ParsedMethodCall - ComplexMethod:TlsDiffAlgorithmsTest.kt$TlsDiffAlgorithmsTest$@Test fun testClientServerTlsExchange() - ComplexMethod:TlsDiffProtocolsTest.kt$TlsDiffProtocolsTest$@Test fun testClientServerTlsExchange() + ComplexMethod:TlsDiffAlgorithmsTest.kt$TlsDiffAlgorithmsTest$@Test(timeout=300_000) fun testClientServerTlsExchange() + ComplexMethod:TlsDiffProtocolsTest.kt$TlsDiffProtocolsTest$@Test(timeout=300_000) fun testClientServerTlsExchange() ComplexMethod:TransactionUtils.kt$ fun createComponentGroups(inputs: List<StateRef>, outputs: List<TransactionState<ContractState>>, commands: List<Command<*>>, attachments: List<SecureHash>, notary: Party?, timeWindow: TimeWindow?, references: List<StateRef>, networkParametersHash: SecureHash?): List<ComponentGroup> ComplexMethod:TransitionExecutorImpl.kt$TransitionExecutorImpl$@Suppress("NestedBlockDepth", "ReturnCount") @Suspendable override fun executeTransition( fiber: FlowFiber, previousState: StateMachineState, event: Event, transition: TransitionResult, actionExecutor: ActionExecutor ): Pair<FlowContinuation, StateMachineState> ComplexMethod:TypeModellingFingerPrinter.kt$FingerPrintingState$// For a type we haven't seen before, determine the correct path depending on the type of type it is. private fun fingerprintNewType(type: LocalTypeInformation) @@ -504,25 +504,25 @@ ForbiddenComment:WireTransaction.kt$WireTransaction$// TODO: prevent notary field from being set if there are no inputs and no time-window. ForbiddenComment:WireTransaction.kt$WireTransaction$// TODO: revisit once Deterministic JVM code updated ForbiddenComment:X509Utilities.kt$CertificateType.LEGAL_IDENTITY$// TODO: Identity certs should have tight name constraints on child certificates - FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test fun rpc_client_certificate_untrusted_to_server() - FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test fun rpc_with_no_ssl_on_client_side_and_ssl_on_server_side() - FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test fun rpc_with_ssl_disabled() - FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test fun rpc_with_ssl_enabled() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Boolean() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun CordaX500Name() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Double() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Enum() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Instant() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Int() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun LocalDate() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Long() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun NetworkHostAndPort() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Path() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun Set() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun String() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun URL() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun UUID() - FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test fun X500Principal() + FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test(timeout=300_000) fun rpc_client_certificate_untrusted_to_server() + FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test(timeout=300_000) fun rpc_with_no_ssl_on_client_side_and_ssl_on_server_side() + FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test(timeout=300_000) fun rpc_with_ssl_disabled() + FunctionNaming:ArtemisRpcTests.kt$ArtemisRpcTests$@Test(timeout=300_000) fun rpc_with_ssl_enabled() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Boolean() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun CordaX500Name() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Double() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Enum() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Instant() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Int() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun LocalDate() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Long() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun NetworkHostAndPort() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Path() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun Set() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun String() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun URL() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun UUID() + FunctionNaming:ConfigParsingTest.kt$ConfigParsingTest$@Test(timeout=300_000) fun X500Principal() FunctionNaming:ContractFunctions.kt$// building an fx swap using abstract swap fun fx_swap2(expiry: String, notional: Long, strike: Double, foreignCurrency: Currency, domesticCurrency: Currency, partyA: Party, partyB: Party) FunctionNaming:ContractFunctions.kt$fun fx_swap(expiry: String, notional: BigDecimal, strike: BigDecimal, foreignCurrency: Currency, domesticCurrency: Currency, partyA: Party, partyB: Party) FunctionNaming:Currencies.kt$fun <T : Any> AMOUNT(amount: Double, token: T): Amount<T> @@ -537,101 +537,101 @@ FunctionNaming:Currencies.kt$fun SWISS_FRANCS(amount: Double): Amount<Currency> FunctionNaming:Currencies.kt$fun SWISS_FRANCS(amount: Int): Amount<Currency> FunctionNaming:Currencies.kt$fun SWISS_FRANCS(amount: Long): Amount<Currency> - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun AnonymousParty() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun ByteSequence() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun CertPath() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun Command() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun CompositeKey() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun CordaX500Name() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun DigitalSignature() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun DigitalSignatureWithCert() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun Instant() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun NetworkHostAndPort() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun PrivacySalt() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun PublicKey() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun SerializedBytes() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun SignatureMetadata() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun TransactionSignature() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun TransactionState() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun UUID() - FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test fun X500Principal() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun AnonymousParty() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun ByteSequence() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun CertPath() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun Command() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun CompositeKey() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun CordaX500Name() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun DigitalSignature() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun DigitalSignatureWithCert() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun Instant() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun NetworkHostAndPort() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun PrivacySalt() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun PublicKey() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun SerializedBytes() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun SignatureMetadata() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun TransactionSignature() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun TransactionState() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun UUID() + FunctionNaming:JacksonSupportTest.kt$JacksonSupportTest$@Test(timeout=300_000) fun X500Principal() FunctionNaming:LedgerDSLInterpreter.kt$LedgerDSLInterpreter$ fun _transaction(transactionLabel: String?, transactionBuilder: TransactionBuilder, dsl: T.() -> EnforceVerifyOrFail): WireTransaction FunctionNaming:LedgerDSLInterpreter.kt$LedgerDSLInterpreter$ fun _tweak(dsl: LedgerDSLInterpreter<T>.() -> Unit) FunctionNaming:LedgerDSLInterpreter.kt$LedgerDSLInterpreter$ fun _unverifiedTransaction(transactionLabel: String?, transactionBuilder: TransactionBuilder, dsl: T.() -> Unit): WireTransaction - FunctionNaming:NamedCacheTest.kt$NamedCacheTest$@Test fun TestCheckCacheName() - FunctionNaming:NodeHandleTests.kt$NodeHandleTests$@Test fun object_defined_functions_are_static_for_node_rpc_ops() + FunctionNaming:NamedCacheTest.kt$NamedCacheTest$@Test(timeout=300_000) fun TestCheckCacheName() + FunctionNaming:NodeHandleTests.kt$NodeHandleTests$@Test(timeout=300_000) fun object_defined_functions_are_static_for_node_rpc_ops() FunctionNaming:NodeVaultService.kt$NodeVaultService$@Throws(VaultQueryException::class) private fun <T : ContractState> _queryBy(criteria: QueryCriteria, paging_: PageSpecification, sorting: Sort, contractStateType: Class<out T>, skipPagingChecks: Boolean): Vault.Page<T> - FunctionNaming:PasswordTest.kt$PasswordTest$@Test fun constructor_and_getters() - FunctionNaming:PasswordTest.kt$PasswordTest$@Test fun toString_is_masked() + FunctionNaming:PasswordTest.kt$PasswordTest$@Test(timeout=300_000) fun constructor_and_getters() + FunctionNaming:PasswordTest.kt$PasswordTest$@Test(timeout=300_000) fun toString_is_masked() FunctionNaming:ProgressTracker.kt$ProgressTracker$private fun _allSteps(level: Int = 0): List<Pair<Int, Step>> FunctionNaming:ProgressTracker.kt$ProgressTracker$private fun _allStepsLabels(level: Int = 0): List<Pair<Int, String>> - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun absent_value() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun absent_value_of_list_type_with_single_element_and_whole_list_mapping() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun absent_value_of_list_type_with_whole_list_mapping() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_absent_value() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_absent_value_of_list_type() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_absent_value_of_list_type_with_default_value() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_absent_with_default_value() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_present_value_of_list_type() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_present_value_with_correct_type() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun optional_present_value_with_wrong_type() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun present_value_of_list_type() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun present_value_of_list_type_with_single_element_and_whole_list_mapping() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun present_value_of_list_type_with_whole_list_mapping() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun present_value_with_correct_type() - FunctionNaming:PropertyTest.kt$PropertyTest$@Test fun present_value_with_wrong_type() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun absent_list_value() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun absent_value() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun absent_value_in_nested_property() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun integer_numeric_type_when_floating_expected_works() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun invalid_mapped_property() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun list_type_when_declared_single() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun missing_list_value() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun missing_value() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun missing_value_in_nested_property() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun nested_property_without_schema_does_not_validate() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun single_type_when_declared_list() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun valid_mapped_property() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun whole_list_validation_invalid_value() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun whole_list_validation_valid_value() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun wrong_element_type_for_list() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun wrong_floating_numeric_type_when_integer_expected() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun wrong_type() - FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test fun wrong_type_in_nested_property() - FunctionNaming:ReceiveAllFlowTests.kt$ReceiveMultipleFlowTests$@Test fun showcase_flows_as_closures() - FunctionNaming:SchemaTest.kt$SchemaTest$@Test fun describe_with_nested_properties_does_not_show_sensitive_values() - FunctionNaming:SchemaTest.kt$SchemaTest$@Test fun describe_with_nested_properties_list_does_not_show_sensitive_values() - FunctionNaming:SchemaTest.kt$SchemaTest$@Test fun validation_with_nested_properties() - FunctionNaming:SchemaTest.kt$SchemaTest$@Test fun validation_with_unknown_properties() - FunctionNaming:SchemaTest.kt$SchemaTest$@Test fun validation_with_unknown_properties_non_strict() - FunctionNaming:SchemaTest.kt$SchemaTest$@Test fun validation_with_wrong_nested_properties() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun absent_value() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun absent_value_of_list_type_with_single_element_and_whole_list_mapping() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun absent_value_of_list_type_with_whole_list_mapping() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_absent_value() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_absent_value_of_list_type() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_absent_value_of_list_type_with_default_value() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_absent_with_default_value() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_present_value_of_list_type() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_present_value_with_correct_type() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun optional_present_value_with_wrong_type() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun present_value_of_list_type() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun present_value_of_list_type_with_single_element_and_whole_list_mapping() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun present_value_of_list_type_with_whole_list_mapping() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun present_value_with_correct_type() + FunctionNaming:PropertyTest.kt$PropertyTest$@Test(timeout=300_000) fun present_value_with_wrong_type() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun absent_list_value() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun absent_value() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun absent_value_in_nested_property() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun integer_numeric_type_when_floating_expected_works() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun invalid_mapped_property() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun list_type_when_declared_single() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun missing_list_value() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun missing_value() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun missing_value_in_nested_property() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun nested_property_without_schema_does_not_validate() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun single_type_when_declared_list() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun valid_mapped_property() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun whole_list_validation_invalid_value() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun whole_list_validation_valid_value() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun wrong_element_type_for_list() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun wrong_floating_numeric_type_when_integer_expected() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun wrong_type() + FunctionNaming:PropertyValidationTest.kt$PropertyValidationTest$@Test(timeout=300_000) fun wrong_type_in_nested_property() + FunctionNaming:ReceiveAllFlowTests.kt$ReceiveMultipleFlowTests$@Test(timeout=300_000) fun showcase_flows_as_closures() + FunctionNaming:SchemaTest.kt$SchemaTest$@Test(timeout=300_000) fun describe_with_nested_properties_does_not_show_sensitive_values() + FunctionNaming:SchemaTest.kt$SchemaTest$@Test(timeout=300_000) fun describe_with_nested_properties_list_does_not_show_sensitive_values() + FunctionNaming:SchemaTest.kt$SchemaTest$@Test(timeout=300_000) fun validation_with_nested_properties() + FunctionNaming:SchemaTest.kt$SchemaTest$@Test(timeout=300_000) fun validation_with_unknown_properties() + FunctionNaming:SchemaTest.kt$SchemaTest$@Test(timeout=300_000) fun validation_with_unknown_properties_non_strict() + FunctionNaming:SchemaTest.kt$SchemaTest$@Test(timeout=300_000) fun validation_with_wrong_nested_properties() FunctionNaming:SerializationOutput.kt$SerializationOutput$internal fun <T : Any> _serialize(obj: T, context: SerializationContext): SerializedBytes<T> - FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test fun chained_delegated_properties_are_not_added_multiple_times() - FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test fun parse_list_aggregation() - FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test fun validate_list_aggregation() - FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test fun validate_with_domain_specific_errors() - FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test fun args_to_config() - FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test fun cmd_options_override_config_from_file() - FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test fun cmd_options_to_config_from_file() - FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test fun empty_args_to_cmd_options() + FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test(timeout=300_000) fun chained_delegated_properties_are_not_added_multiple_times() + FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test(timeout=300_000) fun parse_list_aggregation() + FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test(timeout=300_000) fun validate_list_aggregation() + FunctionNaming:SpecificationTest.kt$SpecificationTest$@Test(timeout=300_000) fun validate_with_domain_specific_errors() + FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test(timeout=300_000) fun args_to_config() + FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test(timeout=300_000) fun cmd_options_override_config_from_file() + FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test(timeout=300_000) fun cmd_options_to_config_from_file() + FunctionNaming:StandaloneShellArgsParserTest.kt$StandaloneShellArgsParserTest$@Test(timeout=300_000) fun empty_args_to_cmd_options() FunctionNaming:TransactionDSLInterpreter.kt$TransactionDSLInterpreter$ fun _attachment(contractClassName: ContractClassName) FunctionNaming:TransactionDSLInterpreter.kt$TransactionDSLInterpreter$ fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>) FunctionNaming:TransactionDSLInterpreter.kt$TransactionDSLInterpreter$ fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>, jarManifestAttributes: Map<String,String>) FunctionNaming:TransactionDSLInterpreter.kt$TransactionDSLInterpreter$ fun _tweak(dsl: TransactionDSLInterpreter.() -> EnforceVerifyOrFail): EnforceVerifyOrFail - FunctionNaming:UtilsTest.kt$UtilsTest$@Test fun serialize_deserialize_configuration() - FunctionNaming:VaultQueryTests.kt$VaultQueryTests$ @Test fun trackCashStates_unconsumed() - FunctionNaming:VaultQueryTests.kt$VaultQueryTests$@Test fun trackCashStates_all() - FunctionNaming:VaultQueryTests.kt$VaultQueryTests$@Test fun trackCashStates_consumed() - FunctionNaming:VaultQueryTests.kt$VaultQueryTestsBase$@Test fun unconsumedCashStatesForSpending_single_issuer_reference() + FunctionNaming:UtilsTest.kt$UtilsTest$@Test(timeout=300_000) fun serialize_deserialize_configuration() + FunctionNaming:VaultQueryTests.kt$VaultQueryTests$ @Test(timeout=300_000) fun trackCashStates_unconsumed() + FunctionNaming:VaultQueryTests.kt$VaultQueryTests$@Test(timeout=300_000) fun trackCashStates_all() + FunctionNaming:VaultQueryTests.kt$VaultQueryTests$@Test(timeout=300_000) fun trackCashStates_consumed() + FunctionNaming:VaultQueryTests.kt$VaultQueryTestsBase$@Test(timeout=300_000) fun unconsumedCashStatesForSpending_single_issuer_reference() FunctionNaming:VaultService.kt$VaultService$ @Throws(VaultQueryException::class) fun <T : ContractState> _queryBy(criteria: QueryCriteria, paging: PageSpecification, sorting: Sort, contractStateType: Class<out T>): Vault.Page<T> FunctionNaming:VaultService.kt$VaultService$ @Throws(VaultQueryException::class) fun <T : ContractState> _trackBy(criteria: QueryCriteria, paging: PageSpecification, sorting: Sort, contractStateType: Class<out T>): DataFeed<Vault.Page<T>, Vault.Update<T>> - FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test fun version_header_extraction_no_configuration() - FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test fun version_header_extraction_no_key() - FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test fun version_header_extraction_no_metadata() - FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test fun version_header_extraction_no_value() - FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test fun version_header_extraction_present() - FunctionNaming:VersionedParsingExampleTest.kt$VersionedParsingExampleTest$@Test fun correct_parsing_function_is_used_for_present_version() - FunctionNaming:VersionedParsingExampleTest.kt$VersionedParsingExampleTest$@Test fun default_value_is_used_for_absent_version() + FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test(timeout=300_000) fun version_header_extraction_no_configuration() + FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test(timeout=300_000) fun version_header_extraction_no_key() + FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test(timeout=300_000) fun version_header_extraction_no_metadata() + FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test(timeout=300_000) fun version_header_extraction_no_value() + FunctionNaming:VersionExtractorTest.kt$VersionExtractorTest$@Test(timeout=300_000) fun version_header_extraction_present() + FunctionNaming:VersionedParsingExampleTest.kt$VersionedParsingExampleTest$@Test(timeout=300_000) fun correct_parsing_function_is_used_for_present_version() + FunctionNaming:VersionedParsingExampleTest.kt$VersionedParsingExampleTest$@Test(timeout=300_000) fun default_value_is_used_for_absent_version() LargeClass:AbstractNode.kt$AbstractNode<S> : SingletonSerializeAsToken LargeClass:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager : StateMachineManagerStateMachineManagerInternal LongMethod:FlowCookbook.kt$InitiatorFlow$@Suppress("RemoveExplicitTypeArguments") @Suspendable override fun call() @@ -1470,7 +1470,7 @@ ThrowsCount:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun getInitiatedFlowFactory(message: InitialSessionMessage): InitiatedFlowFactory<*> ThrowsCount:StringToMethodCallParser.kt$StringToMethodCallParser$ @Throws(UnparseableCallException::class) fun parse(target: T?, command: String): ParsedMethodCall ThrowsCount:StringToMethodCallParser.kt$StringToMethodCallParser$ @Throws(UnparseableCallException::class) fun parseArguments(methodNameHint: String, parameters: List<Pair<String, Type>>, args: String): Array<Any?> - ThrowsCount:StructuresTests.kt$AttachmentTest$@Test fun `openAsJAR does not leak file handle if attachment has corrupted manifest`() + ThrowsCount:StructuresTests.kt$AttachmentTest$@Test(timeout=300_000) fun `openAsJAR does not leak file handle if attachment has corrupted manifest`() ThrowsCount:TransactionVerifierServiceInternal.kt$Verifier$ private fun getUniqueContractAttachmentsByContract(): Map<ContractClassName, ContractAttachment> ThrowsCount:TransactionVerifierServiceInternal.kt$Verifier$// Using basic graph theory, a full cycle of encumbered (co-dependent) states should exist to achieve bi-directional // encumbrances. This property is important to ensure that no states involved in an encumbrance-relationship // can be spent on their own. Briefly, if any of the states is having more than one encumbrance references by // other states, a full cycle detection will fail. As a result, all of the encumbered states must be present // as "from" and "to" only once (or zero times if no encumbrance takes place). For instance, // a -> b // c -> b and a -> b // b -> a b -> c // do not satisfy the bi-directionality (full cycle) property. // // In the first example "b" appears twice in encumbrance ("to") list and "c" exists in the encumbered ("from") list only. // Due the above, one could consume "a" and "b" in the same transaction and then, because "b" is already consumed, "c" cannot be spent. // // Similarly, the second example does not form a full cycle because "a" and "c" exist in one of the lists only. // As a result, one can consume "b" and "c" in the same transactions, which will make "a" impossible to be spent. // // On other hand the following are valid constructions: // a -> b a -> c // b -> c and c -> b // c -> a b -> a // and form a full cycle, meaning that the bi-directionality property is satisfied. private fun checkBidirectionalOutputEncumbrances(statesAndEncumbrance: List<Pair<Int, Int>>) ThrowsCount:WireTransaction.kt$WireTransaction$private fun toLedgerTransactionInternal( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRefAsSerialized: (StateRef) -> SerializedBytes<TransactionState<ContractState>>?, resolveParameters: (SecureHash?) -> NetworkParameters?, isAttachmentTrusted: (Attachment) -> Boolean ): LedgerTransaction diff --git a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/KotlinIntegrationTestingTutorial.kt b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/KotlinIntegrationTestingTutorial.kt index b18f6f402b..fc37a5c760 100644 --- a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/KotlinIntegrationTestingTutorial.kt +++ b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/KotlinIntegrationTestingTutorial.kt @@ -27,8 +27,8 @@ import java.util.* import kotlin.test.assertEquals class KotlinIntegrationTestingTutorial { - @Test - fun `alice bob cash exchange example`() { + @Test(timeout=300_000) + fun `alice bob cash exchange example`() { // START 1 driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = FINANCE_CORDAPPS)) { val aliceUser = User("aliceUser", "testPassword1", permissions = setOf( diff --git a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/TutorialFlowAsyncOperationTest.kt b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/TutorialFlowAsyncOperationTest.kt index e006df105c..7ea1ec3735 100644 --- a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/TutorialFlowAsyncOperationTest.kt +++ b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/kotlin/tutorial/test/TutorialFlowAsyncOperationTest.kt @@ -16,8 +16,8 @@ import kotlin.test.assertEquals class TutorialFlowAsyncOperationTest { // DOCSTART summingWorks - @Test - fun summingWorks() { + @Test(timeout=300_000) + fun summingWorks() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(cordappWithPackages("net.corda.docs.kotlin.tutorial.flowstatemachines")))) { val aliceUser = User("aliceUser", "testPassword1", permissions = setOf(Permissions.all())) val alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(aliceUser)).getOrThrow() diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/ExampleConfigTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/ExampleConfigTest.kt index b66fbc3cb5..10e998fa8e 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/ExampleConfigTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/ExampleConfigTest.kt @@ -26,8 +26,8 @@ class ExampleConfigTest { } } - @Test - fun `example node_confs parses fine`() { + @Test(timeout=300_000) + fun `example node_confs parses fine`() { readAndCheckConfigurations("example-node.conf") { val baseDirectory = Paths.get("some-example-base-dir") assertThat(ConfigHelper.loadConfig(baseDirectory = baseDirectory, configFile = it).parseAsNodeConfiguration().isValid).isTrue() diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorialTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorialTest.kt index 96daede1f2..45e97656d5 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorialTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/FxTransactionBuildTutorialTest.kt @@ -35,8 +35,8 @@ class FxTransactionBuildTutorialTest { mockNet.stopNodes() } - @Test - fun `Run ForeignExchangeFlow to completion`() { + @Test(timeout=300_000) + fun `Run ForeignExchangeFlow to completion`() { // Use NodeA as issuer and create some dollars and wait for the flow to stop nodeA.startFlow(CashIssueFlow(DOLLARS(1000), OpaqueBytes.of(0x01), diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt index 7b77ca27dd..a981ad2467 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt @@ -107,8 +107,8 @@ class TutorialTestDSL { // DOCEND 3 // DOCSTART 4 - @Test - fun simpleCPMoveFails() { + @Test(timeout=300_000) + fun simpleCPMoveFails() { val inState = getPaper() ledgerServices.ledger(dummyNotary.party) { transaction { @@ -122,8 +122,8 @@ class TutorialTestDSL { // DOCEND 4 // DOCSTART 5 - @Test - fun simpleCPMoveFailureAndSuccess() { + @Test(timeout=300_000) + fun simpleCPMoveFailureAndSuccess() { val inState = getPaper() ledgerServices.ledger(dummyNotary.party) { transaction { @@ -139,8 +139,8 @@ class TutorialTestDSL { // DOCEND 5 // DOCSTART 13 - @Test - fun simpleCPMoveSuccess() { + @Test(timeout=300_000) + fun simpleCPMoveSuccess() { val inState = getPaper() ledgerServices.ledger(dummyNotary.party) { transaction { @@ -156,8 +156,8 @@ class TutorialTestDSL { // DOCEND 13 // DOCSTART 6 - @Test - fun `simple issuance with tweak`() { + @Test(timeout=300_000) + fun `simple issuance with tweak`() { ledgerServices.ledger(dummyNotary.party) { transaction { output(CP_PROGRAM_ID, "paper", getPaper()) // Some CP is issued onto the ledger by MegaCorp. @@ -177,8 +177,8 @@ class TutorialTestDSL { // DOCEND 6 // DOCSTART 7 - @Test - fun `simple issuance with tweak and top level transaction`() { + @Test(timeout=300_000) + fun `simple issuance with tweak and top level transaction`() { ledgerServices.transaction(dummyNotary.party) { output(CP_PROGRAM_ID, "paper", getPaper()) // Some CP is issued onto the ledger by MegaCorp. attachments(CP_PROGRAM_ID) @@ -196,8 +196,8 @@ class TutorialTestDSL { // DOCEND 7 // DOCSTART 8 - @Test - fun `chain commercial paper`() { + @Test(timeout=300_000) + fun `chain commercial paper`() { val issuer = megaCorp.party.ref(123) ledgerServices.ledger(dummyNotary.party) { unverifiedTransaction { @@ -229,8 +229,8 @@ class TutorialTestDSL { // DOCEND 8 // DOCSTART 9 - @Test - fun `chain commercial paper double spend`() { + @Test(timeout=300_000) + fun `chain commercial paper double spend`() { val issuer = megaCorp.party.ref(123) ledgerServices.ledger(dummyNotary.party) { unverifiedTransaction { @@ -271,8 +271,8 @@ class TutorialTestDSL { // DOCEND 9 // DOCSTART 10 - @Test - fun `chain commercial tweak`() { + @Test(timeout=300_000) + fun `chain commercial tweak`() { val issuer = megaCorp.party.ref(123) ledgerServices.ledger(dummyNotary.party) { unverifiedTransaction { diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/txbuild/WorkflowTransactionBuildTutorialTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/txbuild/WorkflowTransactionBuildTutorialTest.kt index b75214eae5..85fe0faf59 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/txbuild/WorkflowTransactionBuildTutorialTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/txbuild/WorkflowTransactionBuildTutorialTest.kt @@ -46,8 +46,8 @@ class WorkflowTransactionBuildTutorialTest { mockNet.stopNodes() } - @Test - fun `Run workflow to completion`() { + @Test(timeout=300_000) + fun `Run workflow to completion`() { // Setup a vault subscriber to wait for successful upload of the proposal to NodeB val nodeBVaultUpdate = bobNode.services.vaultService.updates.toFuture() // Kick of the proposal flow diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/vault/CustomVaultQueryTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/vault/CustomVaultQueryTest.kt index e4bffe678b..27715a16bc 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/vault/CustomVaultQueryTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/vault/CustomVaultQueryTest.kt @@ -43,8 +43,8 @@ class CustomVaultQueryTest { mockNet.stopNodes() } - @Test - fun `query by max recorded time`() { + @Test(timeout=300_000) + fun `query by max recorded time`() { nodeA.startFlow(IOUFlow(1000, nodeB.info.singleIdentity())).getOrThrow() nodeA.startFlow(IOUFlow(500, nodeB.info.singleIdentity())).getOrThrow() @@ -58,8 +58,8 @@ class CustomVaultQueryTest { assertThatCode { results.otherResults.single() }.doesNotThrowAnyException() } - @Test - fun `test custom vault query`() { + @Test(timeout=300_000) + fun `test custom vault query`() { // issue some cash in several currencies issueCashForCurrency(POUNDS(1000)) issueCashForCurrency(DOLLARS(900)) diff --git a/experimental/corda-utils/src/test/kotlin/io/cryptoblk/core/StatusTransitionsTest.kt b/experimental/corda-utils/src/test/kotlin/io/cryptoblk/core/StatusTransitionsTest.kt index aef2debc58..7a7035fbfc 100644 --- a/experimental/corda-utils/src/test/kotlin/io/cryptoblk/core/StatusTransitionsTest.kt +++ b/experimental/corda-utils/src/test/kotlin/io/cryptoblk/core/StatusTransitionsTest.kt @@ -102,8 +102,8 @@ class StatusTransitionsTest { private val ledgerServices = MockServices(ALICE_ID, BOB_ID, BIGCORP_ID) } - @Test - fun `basic correct cases`() { + @Test(timeout=300_000) + fun `basic correct cases`() { ledgerServices.ledger { transaction { output(integerContract, IntegerTestState("1")) @@ -134,8 +134,8 @@ class StatusTransitionsTest { } } - @Test - fun `disallowed output`() { + @Test(timeout=300_000) + fun `disallowed output`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("1")) @@ -147,8 +147,8 @@ class StatusTransitionsTest { } } - @Test - fun `disallowed command`() { + @Test(timeout=300_000) + fun `disallowed command`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("1")) @@ -160,8 +160,8 @@ class StatusTransitionsTest { } } - @Test - fun `disallowed signer`() { + @Test(timeout=300_000) + fun `disallowed signer`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("1")) @@ -173,8 +173,8 @@ class StatusTransitionsTest { } } - @Test - fun `irrelevant commands fail`() { + @Test(timeout=300_000) + fun `irrelevant commands fail`() { ledgerServices.ledger { transaction { output(integerContract, IntegerTestState("8")) @@ -185,8 +185,8 @@ class StatusTransitionsTest { } } - @Test - fun `multiple relevant commands accepted`() { + @Test(timeout=300_000) + fun `multiple relevant commands accepted`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("11")) @@ -199,8 +199,8 @@ class StatusTransitionsTest { } } - @Test - fun `multiple relevant commands failed`() { + @Test(timeout=300_000) + fun `multiple relevant commands failed`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("2")) @@ -213,8 +213,8 @@ class StatusTransitionsTest { } } - @Test - fun `multiple inputs failed`() { + @Test(timeout=300_000) + fun `multiple inputs failed`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("1")) @@ -227,8 +227,8 @@ class StatusTransitionsTest { } } - @Test - fun `multiple outputs failed`() { + @Test(timeout=300_000) + fun `multiple outputs failed`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("1")) @@ -241,8 +241,8 @@ class StatusTransitionsTest { } } - @Test - fun `role change signer correct`() { + @Test(timeout=300_000) + fun `role change signer correct`() { ledgerServices.ledger { transaction { output(ownedIntegerContract, TestOwnedIntegerState("0")) @@ -274,8 +274,8 @@ class StatusTransitionsTest { } } - @Test - fun `multiple signers disallowed`() { + @Test(timeout=300_000) + fun `multiple signers disallowed`() { ledgerServices.ledger { transaction { input(ownedIntegerContract, TestOwnedIntegerState("10")) @@ -287,8 +287,8 @@ class StatusTransitionsTest { } } - @Test - fun `spend disallowed`() { + @Test(timeout=300_000) + fun `spend disallowed`() { ledgerServices.ledger { transaction { input(integerContract, IntegerTestState("1")) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Cap.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Cap.kt index 6813526df0..8a07bb3810 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Cap.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Cap.kt @@ -187,8 +187,8 @@ class Cap { } } - @Test - fun issue() { + @Test(timeout=300_000) + fun issue() { transaction { output(UNIVERSAL_PROGRAM_ID, stateInitial) timeWindow(TEST_TX_TIME_1) @@ -202,8 +202,8 @@ class Cap { } } - @Test - fun `first fixing`() { + @Test(timeout=300_000) + fun `first fixing`() { transaction { input(UNIVERSAL_PROGRAM_ID, stateInitial) output(UNIVERSAL_PROGRAM_ID, stateAfterFixingFirst) @@ -241,8 +241,8 @@ class Cap { } } - @Test - fun `first execute`() { + @Test(timeout=300_000) + fun `first execute`() { transaction { input(UNIVERSAL_PROGRAM_ID, stateAfterFixingFirst) output(UNIVERSAL_PROGRAM_ID, stateAfterExecutionFirst) @@ -258,8 +258,8 @@ class Cap { } } - @Test - fun `final execute`() { + @Test(timeout=300_000) + fun `final execute`() { transaction { input(UNIVERSAL_PROGRAM_ID, stateAfterFixingFinal) output(UNIVERSAL_PROGRAM_ID, statePaymentFinal) @@ -274,8 +274,8 @@ class Cap { } } - @Test - fun `second fixing`() { + @Test(timeout=300_000) + fun `second fixing`() { transaction { input(UNIVERSAL_PROGRAM_ID, stateAfterExecutionFirst) output(UNIVERSAL_PROGRAM_ID, stateAfterFixingFinal) @@ -313,8 +313,8 @@ class Cap { } } - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `pretty print`() { println(prettyPrint(contractInitial)) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Caplet.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Caplet.kt index 51c5f3716c..61e3039a39 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Caplet.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Caplet.kt @@ -51,8 +51,8 @@ class Caplet { val stateFixed = UniversalContract.State(listOf(DUMMY_NOTARY), contractFixed) val stateFinal = UniversalContract.State(listOf(DUMMY_NOTARY), contractFinal) - @Test - fun issue() { + @Test(timeout=300_000) + fun issue() { transaction { output(UNIVERSAL_PROGRAM_ID, stateStart) timeWindow(TEST_TX_TIME_1) @@ -66,8 +66,8 @@ class Caplet { } } - @Test - fun execute() { + @Test(timeout=300_000) + fun execute() { transaction { input(UNIVERSAL_PROGRAM_ID, stateFixed) output(UNIVERSAL_PROGRAM_ID, stateFinal) @@ -82,8 +82,8 @@ class Caplet { } } - @Test - fun fixing() { + @Test(timeout=300_000) + fun fixing() { transaction { input(UNIVERSAL_PROGRAM_ID, stateStart) output(UNIVERSAL_PROGRAM_ID, stateFixed) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ContractDefinition.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ContractDefinition.kt index 0b3d22d311..4db963a9f6 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ContractDefinition.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ContractDefinition.kt @@ -75,8 +75,8 @@ class ContractDefinition { } } - /* @Test - fun `builder problem - should not compile`() { + /* @Test(timeout=300_000) + fun `builder problem - should not compile`() { val arr = arrange { actions { acmeCorp may { @@ -98,8 +98,8 @@ class ContractDefinition { } } */ - @Test - fun `builder problem - legal`() { + @Test(timeout=300_000) + fun `builder problem - legal`() { val arr = arrange { actions { acmeCorp may { diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXFwdTimeOption.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXFwdTimeOption.kt index f79734a8ad..57e1a04e7a 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXFwdTimeOption.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXFwdTimeOption.kt @@ -48,8 +48,8 @@ class FXFwdTimeOption { val inState = UniversalContract.State(listOf(DUMMY_NOTARY), initialContract) val outState1 = UniversalContract.State(listOf(DUMMY_NOTARY), outContract1) val outState2 = UniversalContract.State(listOf(DUMMY_NOTARY), outContract2) - @Test - fun `issue - signature`() { + @Test(timeout=300_000) + fun `issue - signature`() { transaction { output(UNIVERSAL_PROGRAM_ID, inState) timeWindow(TEST_TX_TIME_1) @@ -67,8 +67,8 @@ class FXFwdTimeOption { } } - @Test - fun `maturity, bank exercise`() { + @Test(timeout=300_000) + fun `maturity, bank exercise`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) @@ -96,8 +96,8 @@ class FXFwdTimeOption { } } - @Test - fun `maturity, corp exercise`() { + @Test(timeout=300_000) + fun `maturity, corp exercise`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXSwap.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXSwap.kt index 5017fa4ad9..c7458e355b 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXSwap.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/FXSwap.kt @@ -39,8 +39,8 @@ class FXSwap { val outStateBad3 = UniversalContract.State(listOf(DUMMY_NOTARY), transferBad3) val inState = UniversalContract.State(listOf(DUMMY_NOTARY), contract) - @Test - fun `issue - signature`() { + @Test(timeout=300_000) + fun `issue - signature`() { transaction { output(UNIVERSAL_PROGRAM_ID, inState) @@ -59,8 +59,8 @@ class FXSwap { } } - @Test - fun execute() { + @Test(timeout=300_000) + fun execute() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) @@ -76,8 +76,8 @@ class FXSwap { } } - @Test - fun `execute - reversed order`() { + @Test(timeout=300_000) + fun `execute - reversed order`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState2) @@ -93,8 +93,8 @@ class FXSwap { } } - @Test - fun `execute - not authorized`() { + @Test(timeout=300_000) + fun `execute - not authorized`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) @@ -105,8 +105,8 @@ class FXSwap { } } - @Test - fun `execute - before maturity`() { + @Test(timeout=300_000) + fun `execute - before maturity`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) @@ -117,8 +117,8 @@ class FXSwap { } } - @Test - fun `execute - outState mismatch 1`() { + @Test(timeout=300_000) + fun `execute - outState mismatch 1`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) @@ -128,8 +128,8 @@ class FXSwap { } } - @Test - fun `execute - outState mismatch 2`() { + @Test(timeout=300_000) + fun `execute - outState mismatch 2`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) @@ -140,8 +140,8 @@ class FXSwap { } } - @Test - fun `execute - outState mismatch 3`() { + @Test(timeout=300_000) + fun `execute - outState mismatch 3`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outStateBad1) @@ -152,8 +152,8 @@ class FXSwap { } } - @Test - fun `execute - outState mismatch 4`() { + @Test(timeout=300_000) + fun `execute - outState mismatch 4`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState1) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/IRS.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/IRS.kt index 52a85cc5d2..c7d8895502 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/IRS.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/IRS.kt @@ -131,8 +131,8 @@ class IRS { private val statePaymentFirst = UniversalContract.State(listOf(DUMMY_NOTARY), paymentFirst) - @Test - fun issue() { + @Test(timeout=300_000) + fun issue() { transaction { output(UNIVERSAL_PROGRAM_ID, stateInitial) timeWindow(testTxTime1) @@ -146,8 +146,8 @@ class IRS { } } - @Test - fun `first fixing`() { + @Test(timeout=300_000) + fun `first fixing`() { transaction { input(UNIVERSAL_PROGRAM_ID, stateInitial) output(UNIVERSAL_PROGRAM_ID, stateAfterFixingFirst) @@ -185,8 +185,8 @@ class IRS { } } - @Test - fun `first execute`() { + @Test(timeout=300_000) + fun `first execute`() { transaction { input(UNIVERSAL_PROGRAM_ID, stateAfterFixingFirst) output(UNIVERSAL_PROGRAM_ID, stateAfterExecutionFirst) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/RollOutTests.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/RollOutTests.kt index 623a5b7074..cc92c9137c 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/RollOutTests.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/RollOutTests.kt @@ -120,28 +120,28 @@ class RollOutTests { next() } - @Test - fun `arrangement equality transfer`() { + @Test(timeout=300_000) + fun `arrangement equality transfer`() { assertEquals(contract_transfer1, contract_transfer2) } - @Test - fun `arrangement equality action`() { + @Test(timeout=300_000) + fun `arrangement equality action`() { assertEquals(contract_action1, contract_action2) } - @Test - fun `arrangement equality and`() { + @Test(timeout=300_000) + fun `arrangement equality and`() { assertEquals(contract_and1, contract_and2) } - @Test - fun `arrangement equality complex`() { + @Test(timeout=300_000) + fun `arrangement equality complex`() { assertEquals(contract, contract2) } - @Test - fun issue() { + @Test(timeout=300_000) + fun issue() { transaction { output(UNIVERSAL_PROGRAM_ID, stateStart) timeWindow(TEST_TX_TIME_1) @@ -155,8 +155,8 @@ class RollOutTests { } } - @Test - fun execute() { + @Test(timeout=300_000) + fun execute() { transaction { input(UNIVERSAL_PROGRAM_ID, stateStart) output(UNIVERSAL_PROGRAM_ID, stateStep1a) diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Swaption.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Swaption.kt index 245b1f5b9e..3d22239c06 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Swaption.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/Swaption.kt @@ -57,8 +57,8 @@ class Swaption { } val stateInitial = UniversalContract.State(listOf(DUMMY_NOTARY), contractInitial) - @Test - fun issue() { + @Test(timeout=300_000) + fun issue() { transaction { output(UNIVERSAL_PROGRAM_ID, stateInitial) timeWindow(TEST_TX_TIME_1) @@ -72,8 +72,8 @@ class Swaption { } } - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `pretty print`() { println(prettyPrint(contractInitial)) } diff --git a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ZeroCouponBond.kt b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ZeroCouponBond.kt index 013dc08c91..3338fc73ec 100644 --- a/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ZeroCouponBond.kt +++ b/experimental/src/test/kotlin/net/corda/finance/contracts/universal/ZeroCouponBond.kt @@ -41,13 +41,13 @@ class ZeroCouponBond { val outStateWrong = UniversalContract.State(listOf(DUMMY_NOTARY), transferWrong) val outStateMove = UniversalContract.State(listOf(DUMMY_NOTARY), contractMove) - @Test - fun basic() { + @Test(timeout=300_000) + fun basic() { assertEquals(Zero(), Zero()) } - @Test - fun `issue - signature`() { + @Test(timeout=300_000) + fun `issue - signature`() { transaction { output(UNIVERSAL_PROGRAM_ID, inState) tweak { @@ -59,8 +59,8 @@ class ZeroCouponBond { } } - @Test - fun execute() { + @Test(timeout=300_000) + fun execute() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState) @@ -75,8 +75,8 @@ class ZeroCouponBond { } } - @Test - fun `execute - not authorized`() { + @Test(timeout=300_000) + fun `execute - not authorized`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outState) @@ -86,8 +86,8 @@ class ZeroCouponBond { } } - @Test - fun `execute - outState mismatch`() { + @Test(timeout=300_000) + fun `execute - outState mismatch`() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) output(UNIVERSAL_PROGRAM_ID, outStateWrong) @@ -97,8 +97,8 @@ class ZeroCouponBond { } } - @Test - fun move() { + @Test(timeout=300_000) + fun move() { transaction { input(UNIVERSAL_PROGRAM_ID, inState) tweak { diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt index 04a4dfc446..bdebb8f1cc 100644 --- a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt +++ b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt @@ -117,8 +117,8 @@ class CommercialPaperTestsGeneric { override fun loadState(stateRef: StateRef): TransactionState<*> = TransactionState(thisTest.getPaper(), thisTest.getContract(), dummyNotary.party) // Simulates the state is recorded in the node service } - @Test - fun `trade lifecycle test`() { + @Test(timeout=300_000) + fun `trade lifecycle test`() { val someProfits = 1200.DOLLARS `issued by` megaCorpRef ledgerServices.ledger(dummyNotary.party) { unverifiedTransaction { @@ -190,8 +190,8 @@ class CommercialPaperTestsGeneric { ledgerServices.transaction(dummyNotary.party, script) } - @Test - fun `key mismatch at issue`() { + @Test(timeout=300_000) + fun `key mismatch at issue`() { transaction { attachment(CP_PROGRAM_ID) attachment(JavaCommercialPaper.JCP_PROGRAM_ID) @@ -202,8 +202,8 @@ class CommercialPaperTestsGeneric { } } - @Test - fun `face value is not zero`() { + @Test(timeout=300_000) + fun `face value is not zero`() { transaction { attachment(CP_PROGRAM_ID) attachment(JavaCommercialPaper.JCP_PROGRAM_ID) @@ -214,8 +214,8 @@ class CommercialPaperTestsGeneric { } } - @Test - fun `maturity date not in the past`() { + @Test(timeout=300_000) + fun `maturity date not in the past`() { transaction { attachment(CP_PROGRAM_ID) attachment(JavaCommercialPaper.JCP_PROGRAM_ID) @@ -226,8 +226,8 @@ class CommercialPaperTestsGeneric { } } - @Test - fun `issue cannot replace an existing state`() { + @Test(timeout=300_000) + fun `issue cannot replace an existing state`() { transaction { attachment(CP_PROGRAM_ID) attachment(JavaCommercialPaper.JCP_PROGRAM_ID) @@ -239,8 +239,8 @@ class CommercialPaperTestsGeneric { } } - @Test - fun `issue move and then redeem`() { + @Test(timeout=300_000) + fun `issue move and then redeem`() { // Set up a test environment with 4 parties: // 1. The notary // 2. A dummy cash issuer e.g. central bank diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/FinanceTypesTest.kt b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/FinanceTypesTest.kt index 2b88126ec0..cc146ffe9e 100644 --- a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/FinanceTypesTest.kt +++ b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/FinanceTypesTest.kt @@ -10,22 +10,22 @@ import kotlin.test.assertTrue class FinanceTypesTest { - @Test - fun `valid tenor tests`() { + @Test(timeout=300_000) + fun `valid tenor tests`() { val exampleTenors = ("ON,1D,2D,3D,4D,5D,6D,7D,1W,2W,3W,1M,3M,6M,1Y,2Y,3Y,5Y,10Y,12Y,20Y").split(",") exampleTenors.all { Tenor(it).name.isNotEmpty() } // Slightly obtuse way of ensuring no exception thrown in construction. } - @Test - fun `invalid tenor tests`() { + @Test(timeout=300_000) + fun `invalid tenor tests`() { val exampleTenors = ("W,M,D,Z,2Q,p0,W1").split(",") for (t in exampleTenors) { assertFailsWith { Tenor(t) } } } - @Test - fun `tenor days to maturity adjusted for holiday`() { + @Test(timeout=300_000) + fun `tenor days to maturity adjusted for holiday`() { val tenor = Tenor("1M") val calendar = loadTestCalendar("London") val currentDay = LocalDate.of(2016, 2, 27) @@ -37,16 +37,16 @@ class FinanceTypesTest { assertEquals(actualDaysToMaturity, expectedDaysToMaturity) } - @Test - fun `schedule generator 1`() { + @Test(timeout=300_000) + fun `schedule generator 1`() { val ret = BusinessCalendar.createGenericSchedule(startDate = LocalDate.of(2014, 11, 25), period = Frequency.Monthly, noOfAdditionalPeriods = 3) // We know that Jan 25th 2015 is on the weekend -> It should not be in this list returned. assertFalse(LocalDate.of(2015, 1, 25) in ret) println(ret) } - @Test - fun `schedule generator 2`() { + @Test(timeout=300_000) + fun `schedule generator 2`() { val ret = BusinessCalendar.createGenericSchedule( startDate = LocalDate.of(2015, 11, 25), period = Frequency.Monthly, @@ -60,60 +60,60 @@ class FinanceTypesTest { } - @Test - fun `create a UK calendar`() { + @Test(timeout=300_000) + fun `create a UK calendar`() { val cal = loadTestCalendar("London") val holdates = cal.holidayDates println(holdates) assertTrue(LocalDate.of(2016, 12, 27) in holdates) // Christmas this year is at the weekend... } - @Test - fun `create a US UK calendar`() { + @Test(timeout=300_000) + fun `create a US UK calendar`() { val cal = loadTestCalendar("London") + loadTestCalendar("NewYork") assertTrue(LocalDate.of(2016, 7, 4) in cal.holidayDates) // The most American of holidays assertTrue(LocalDate.of(2016, 8, 29) in cal.holidayDates) // August Bank Holiday for brits only println("Calendar contains both US and UK holidays") } - @Test - fun `calendar test of modified following`() { + @Test(timeout=300_000) + fun `calendar test of modified following`() { val ldn = loadTestCalendar("London") val result = ldn.applyRollConvention(LocalDate.of(2016, 12, 25), DateRollConvention.ModifiedFollowing) assertEquals(LocalDate.of(2016, 12, 28), result) } - @Test - fun `calendar test of modified following pt 2`() { + @Test(timeout=300_000) + fun `calendar test of modified following pt 2`() { val ldn = loadTestCalendar("London") val result = ldn.applyRollConvention(LocalDate.of(2016, 12, 31), DateRollConvention.ModifiedFollowing) assertEquals(LocalDate.of(2016, 12, 30), result) } - @Test - fun `calendar test of modified previous`() { + @Test(timeout=300_000) + fun `calendar test of modified previous`() { val ldn = loadTestCalendar("London") val result = ldn.applyRollConvention(LocalDate.of(2016, 1, 1), DateRollConvention.ModifiedPrevious) assertEquals(LocalDate.of(2016, 1, 4), result) } - @Test - fun `calendar test of previous`() { + @Test(timeout=300_000) + fun `calendar test of previous`() { val ldn = loadTestCalendar("London") val result = ldn.applyRollConvention(LocalDate.of(2016, 12, 25), DateRollConvention.Previous) assertEquals(LocalDate.of(2016, 12, 23), result) } - @Test - fun `calendar test of following`() { + @Test(timeout=300_000) + fun `calendar test of following`() { val ldn = loadTestCalendar("London") val result = ldn.applyRollConvention(LocalDate.of(2016, 12, 25), DateRollConvention.Following) assertEquals(LocalDate.of(2016, 12, 28), result) } - @Test - fun `calendar date advancing`() { + @Test(timeout=300_000) + fun `calendar date advancing`() { val ldn = loadTestCalendar("London") val firstDay = LocalDate.of(2015, 12, 20) val expected = mapOf(0 to firstDay, @@ -132,8 +132,8 @@ class FinanceTypesTest { } } - @Test - fun `calendar date preceeding`() { + @Test(timeout=300_000) + fun `calendar date preceeding`() { val ldn = loadTestCalendar("London") val firstDay = LocalDate.of(2015, 12, 31) val expected = mapOf(0 to firstDay, diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt index ad96837eb4..4f1ce792ff 100644 --- a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt +++ b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt @@ -128,8 +128,8 @@ class CashTests { MockServices(megaCorp).transaction(dummyNotary.party, script) } - @Test - fun trivial() { + @Test(timeout=300_000) + fun trivial() { transaction { attachment(Cash.PROGRAM_ID) input(Cash.PROGRAM_ID, inState) @@ -164,8 +164,8 @@ class CashTests { } } - @Test - fun twoMoves() { + @Test(timeout=300_000) + fun twoMoves() { transaction { attachment(Cash.PROGRAM_ID) input(Cash.PROGRAM_ID, inState) @@ -185,8 +185,8 @@ class CashTests { override val participants: List = emptyList() } - @Test - fun `issue by move`() { + @Test(timeout=300_000) + fun `issue by move`() { // Check we can't "move" money into existence. transaction { attachment(Cash.PROGRAM_ID) @@ -197,8 +197,8 @@ class CashTests { } } - @Test - fun issue() { + @Test(timeout=300_000) + fun issue() { // Check we can issue money only as long as the issuer institution is a command signer, i.e. any recognised // institution is allowed to issue as much cash as they want. transaction { @@ -218,8 +218,8 @@ class CashTests { } } - @Test - fun generateIssueRaw() { + @Test(timeout=300_000) + fun generateIssueRaw() { // Test generation works. val tx: WireTransaction = TransactionBuilder(notary = null).apply { Cash().generateIssue(this, 100.DOLLARS `issued by` miniCorp.ref(12, 34), owner = AnonymousParty(alice.publicKey), notary = dummyNotary.party) @@ -233,8 +233,8 @@ class CashTests { assertEquals(miniCorp.publicKey, tx.commands[0].signers[0]) } - @Test - fun generateIssueFromAmount() { + @Test(timeout=300_000) + fun generateIssueFromAmount() { // Test issuance from an issued amount val amount = 100.DOLLARS `issued by` miniCorp.ref(12, 34) val tx: WireTransaction = TransactionBuilder(notary = null).apply { @@ -244,8 +244,8 @@ class CashTests { assertEquals(tx.outputs[0], tx.outputs[0]) } - @Test - fun `extended issue examples`() { + @Test(timeout=300_000) + fun `extended issue examples`() { // We can consume $1000 in a transaction and output $2000 as long as it's signed by an issuer. transaction { attachment(Cash.PROGRAM_ID) @@ -314,8 +314,8 @@ class CashTests { Cash().generateIssue(ptx, 100.DOLLARS `issued by` miniCorp.ref(12, 34), owner = miniCorp.party, notary = dummyNotary.party) } - @Test - fun testMergeSplit() { + @Test(timeout=300_000) + fun testMergeSplit() { // Splitting value works. transaction { attachment(Cash.PROGRAM_ID) @@ -344,8 +344,8 @@ class CashTests { } } - @Test - fun zeroSizedValues() { + @Test(timeout=300_000) + fun zeroSizedValues() { transaction { attachment(Cash.PROGRAM_ID) input(Cash.PROGRAM_ID, inState) @@ -363,8 +363,8 @@ class CashTests { } } - @Test - fun trivialMismatches() { + @Test(timeout=300_000) + fun trivialMismatches() { // Can't change issuer. transaction { attachment(Cash.PROGRAM_ID) @@ -422,8 +422,8 @@ class CashTests { } } - @Test - fun exitLedger() { + @Test(timeout=300_000) + fun exitLedger() { // Single input/output straightforward case. transaction { attachment(Cash.PROGRAM_ID) @@ -447,8 +447,8 @@ class CashTests { } } - @Test - fun `exit ledger with multiple issuers`() { + @Test(timeout=300_000) + fun `exit ledger with multiple issuers`() { // Multi-issuer case. transaction { attachment(Cash.PROGRAM_ID) @@ -465,8 +465,8 @@ class CashTests { } } - @Test - fun `exit cash not held by its issuer`() { + @Test(timeout=300_000) + fun `exit cash not held by its issuer`() { // Single input/output straightforward case. transaction { attachment(Cash.PROGRAM_ID) @@ -478,8 +478,8 @@ class CashTests { } } - @Test - fun multiIssuer() { + @Test(timeout=300_000) + fun multiIssuer() { transaction { attachment(Cash.PROGRAM_ID) // Gather 2000 dollars from two different issuers. @@ -505,8 +505,8 @@ class CashTests { } } - @Test - fun multiCurrency() { + @Test(timeout=300_000) + fun multiCurrency() { // Check we can do an atomic currency trade tx. transaction { attachment(Cash.PROGRAM_ID) @@ -552,8 +552,8 @@ class CashTests { /** * Try exiting an amount which matches a single state. */ - @Test - fun generateSimpleExit() { + @Test(timeout=300_000) + fun generateSimpleExit() { val wtx = makeExit(miniCorpServices, 100.DOLLARS, megaCorp.party, 1) assertEquals(cashStates[0].ref, wtx.inputs[0]) assertEquals(0, wtx.outputs.size) @@ -567,8 +567,8 @@ class CashTests { /** * Try exiting an amount smaller than the smallest available input state, and confirm change is generated correctly. */ - @Test - fun generatePartialExit() { + @Test(timeout=300_000) + fun generatePartialExit() { val wtx = makeExit(miniCorpServices, 50.DOLLARS, megaCorp.party, 1) val actualInput = wtx.inputs.single() // Filter the available inputs and confirm exactly one has been used @@ -584,48 +584,48 @@ class CashTests { /** * Try exiting a currency we don't have. */ - @Test - fun generateAbsentExit() { + @Test(timeout=300_000) + fun generateAbsentExit() { assertFailsWith { makeExit(miniCorpServices, 100.POUNDS, megaCorp.party, 1) } } /** * Try exiting with a reference mis-match. */ - @Test - fun generateInvalidReferenceExit() { + @Test(timeout=300_000) + fun generateInvalidReferenceExit() { assertFailsWith { makeExit(miniCorpServices, 100.POUNDS, megaCorp.party, 2) } } /** * Try exiting an amount greater than the maximum available. */ - @Test - fun generateInsufficientExit() { + @Test(timeout=300_000) + fun generateInsufficientExit() { assertFailsWith { makeExit(miniCorpServices, 1000.DOLLARS, megaCorp.party, 1) } } /** * Try exiting for an owner with no states */ - @Test - fun generateOwnerWithNoStatesExit() { + @Test(timeout=300_000) + fun generateOwnerWithNoStatesExit() { assertFailsWith { makeExit(miniCorpServices, 100.POUNDS, charlie.party, 1) } } /** * Try exiting when vault is empty */ - @Test - fun generateExitWithEmptyVault() { + @Test(timeout=300_000) + fun generateExitWithEmptyVault() { assertFailsWith { val tx = TransactionBuilder(dummyNotary.party) Cash().generateExit(tx, Amount(100, Issued(charlie.ref(1), GBP)), emptyList(), ourIdentity) } } - @Test - fun generateSimpleDirectSpend() { + @Test(timeout=300_000) + fun generateSimpleDirectSpend() { val wtx = database.transaction { makeSpend(ourServices, 100.DOLLARS, miniCorpAnonymised) @@ -638,8 +638,8 @@ class CashTests { } } - @Test - fun generateSimpleSpendWithParties() { + @Test(timeout=300_000) + fun generateSimpleSpendWithParties() { database.transaction { val tx = TransactionBuilder(dummyNotary.party) CashUtils.generateSpend(ourServices, tx, 80.DOLLARS, ourServices.myInfo.singleIdentityAndCert(), alice.party, setOf(miniCorp.party)) @@ -648,8 +648,8 @@ class CashTests { } } - @Test - fun generateSimpleSpendWithChange() { + @Test(timeout=300_000) + fun generateSimpleSpendWithChange() { val wtx = database.transaction { makeSpend(ourServices, 10.DOLLARS, miniCorpAnonymised) @@ -673,8 +673,8 @@ class CashTests { } } - @Test - fun generateSpendWithTwoInputs() { + @Test(timeout=300_000) + fun generateSpendWithTwoInputs() { val wtx = database.transaction { makeSpend(ourServices, 500.DOLLARS, miniCorpAnonymised) @@ -689,8 +689,8 @@ class CashTests { } } - @Test - fun generateSpendMixedDeposits() { + @Test(timeout=300_000) + fun generateSpendMixedDeposits() { val wtx = database.transaction { val wtx = makeSpend(ourServices, 580.DOLLARS, miniCorpAnonymised) @@ -710,8 +710,8 @@ class CashTests { } } - @Test - fun generateSpendInsufficientBalance() { + @Test(timeout=300_000) + fun generateSpendInsufficientBalance() { database.transaction { val e = assertFailsWith { makeSpend(ourServices, 1000.DOLLARS, miniCorpAnonymised) @@ -727,8 +727,8 @@ class CashTests { /** * Confirm that aggregation of states is correctly modelled. */ - @Test - fun aggregation() { + @Test(timeout=300_000) + fun aggregation() { val fiveThousandDollarsFromMega = Cash.State(5000.DOLLARS `issued by` megaCorp.ref(2), megaCorp.party) val twoThousandDollarsFromMega = Cash.State(2000.DOLLARS `issued by` megaCorp.ref(2), miniCorp.party) val oneThousandDollarsFromMini = Cash.State(1000.DOLLARS `issued by` miniCorp.ref(3), megaCorp.party) @@ -752,8 +752,8 @@ class CashTests { assertNotEquals((fiveThousandDollarsFromMega withDeposit defaultIssuer).amount.token, fiveThousandDollarsFromMega.amount.token) } - @Test - fun `summing by owner`() { + @Test(timeout=300_000) + fun `summing by owner`() { val states = listOf( Cash.State(1000.DOLLARS `issued by` defaultIssuer, miniCorp.party), Cash.State(2000.DOLLARS `issued by` defaultIssuer, megaCorp.party), @@ -771,8 +771,8 @@ class CashTests { states.sumCashBy(miniCorp.party) } - @Test - fun `summing no currencies`() { + @Test(timeout=300_000) + fun `summing no currencies`() { val states = emptyList() assertEquals(0.POUNDS `issued by` defaultIssuer, states.sumCashOrZero(GBP `issued by` defaultIssuer)) assertNull(states.sumCashOrNull()) @@ -784,8 +784,8 @@ class CashTests { states.sumCash() } - @Test - fun `summing a single currency`() { + @Test(timeout=300_000) + fun `summing a single currency`() { val states = listOf( Cash.State(1000.DOLLARS `issued by` defaultIssuer, megaCorp.party), Cash.State(2000.DOLLARS `issued by` defaultIssuer, megaCorp.party), @@ -808,8 +808,8 @@ class CashTests { } // Double spend. - @Test - fun chainCashDoubleSpendFailsWith() { + @Test(timeout=300_000) + fun chainCashDoubleSpendFailsWith() { MockServices(megaCorp).ledger(dummyNotary.party) { unverifiedTransaction { attachment(Cash.PROGRAM_ID) @@ -843,8 +843,8 @@ class CashTests { } } - @Test - fun multiSpend() { + @Test(timeout=300_000) + fun multiSpend() { val tx = TransactionBuilder(dummyNotary.party) database.transaction { val payments = listOf( @@ -866,8 +866,8 @@ class CashTests { assertEquals(megaCorp.party, out(3).amount.token.issuer.party) } - @Test - fun generateSpendTwiceWithinATransaction() { + @Test(timeout=300_000) + fun generateSpendTwiceWithinATransaction() { val tx = TransactionBuilder(dummyNotary.party) database.transaction { val payments = listOf( diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt index 2ec81a31ad..3cc9dd479c 100644 --- a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt +++ b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt @@ -111,8 +111,8 @@ class ObligationTests { ledgerServices.transaction(DUMMY_NOTARY, script) } - @Test - fun trivial() { + @Test(timeout=300_000) + fun trivial() { transaction { attachments(Obligation.PROGRAM_ID) input(Obligation.PROGRAM_ID, inState) @@ -152,8 +152,8 @@ class ObligationTests { override val participants: List = emptyList() } - @Test - fun `issue debt`() { + @Test(timeout=300_000) + fun `issue debt`() { // Check we can't "move" debt into existence. transaction { attachments(DummyContract.PROGRAM_ID, Obligation.PROGRAM_ID) @@ -270,8 +270,8 @@ class ObligationTests { } /** Test generating a transaction to net two obligations of the same size, and therefore there are no outputs. */ - @Test - fun `generate close-out net transaction`() { + @Test(timeout=300_000) + fun `generate close-out net transaction`() { val obligationAliceToBob = getStateAndRef(oneMillionDollars.OBLIGATION between Pair(ALICE, BOB), Obligation.PROGRAM_ID) val obligationBobToAlice = getStateAndRef(oneMillionDollars.OBLIGATION between Pair(BOB, ALICE), Obligation.PROGRAM_ID) val tx = TransactionBuilder(DUMMY_NOTARY).apply { @@ -281,8 +281,8 @@ class ObligationTests { } /** Test generating a transaction to net two obligations of the different sizes, and confirm the balance is correct. */ - @Test - fun `generate close-out net transaction with remainder`() { + @Test(timeout=300_000) + fun `generate close-out net transaction with remainder`() { val obligationAliceToBob = getStateAndRef((2000000.DOLLARS `issued by` defaultIssuer).OBLIGATION between Pair(ALICE, BOB), Obligation.PROGRAM_ID) val obligationBobToAlice = getStateAndRef(oneMillionDollars.OBLIGATION between Pair(BOB, ALICE), Obligation.PROGRAM_ID) val tx = TransactionBuilder(DUMMY_NOTARY).apply { @@ -295,8 +295,8 @@ class ObligationTests { } /** Test generating a transaction to net two obligations of the same size, and therefore there are no outputs. */ - @Test - fun `generate payment net transaction`() { + @Test(timeout=300_000) + fun `generate payment net transaction`() { val obligationAliceToBob = getStateAndRef(oneMillionDollars.OBLIGATION between Pair(ALICE, BOB), Obligation.PROGRAM_ID) val obligationBobToAlice = getStateAndRef(oneMillionDollars.OBLIGATION between Pair(BOB, ALICE), Obligation.PROGRAM_ID) val tx = TransactionBuilder(DUMMY_NOTARY).apply { @@ -306,8 +306,8 @@ class ObligationTests { } /** Test generating a transaction to two obligations, where one is bigger than the other and therefore there is a remainder. */ - @Test - fun `generate payment net transaction with remainder`() { + @Test(timeout=300_000) + fun `generate payment net transaction with remainder`() { val obligationAliceToBob = getStateAndRef(oneMillionDollars.OBLIGATION between Pair(ALICE, BOB), Obligation.PROGRAM_ID) val obligationAliceToBobState = obligationAliceToBob.state.data val obligationBobToAlice = getStateAndRef((2000000.DOLLARS `issued by` defaultIssuer).OBLIGATION between Pair(BOB, ALICE), Obligation.PROGRAM_ID) @@ -328,8 +328,8 @@ class ObligationTests { } /** Test generating a transaction to mark outputs as having defaulted. */ - @Test - fun `generate set lifecycle`() { + @Test(timeout=300_000) + fun `generate set lifecycle`() { // We don't actually verify the states, this is just here to make things look sensible val dueBefore = TEST_TX_TIME - 7.days @@ -366,8 +366,8 @@ class ObligationTests { } /** Test generating a transaction to settle an obligation. */ - @Test - fun `generate settlement transaction`() { + @Test(timeout=300_000) + fun `generate settlement transaction`() { val cashTx = TransactionBuilder(null).apply { Cash().generateIssue(this, 100.DOLLARS `issued by` defaultIssuer, MINI_CORP, DUMMY_NOTARY) }.toWireTransaction(miniCorpServices) @@ -386,8 +386,8 @@ class ObligationTests { assertEquals(1, settleTx.outputs.size) } - @Test - fun `close-out netting`() { + @Test(timeout=300_000) + fun `close-out netting`() { // Try netting out two obligations mockService.ledger(DUMMY_NOTARY) { cashObligationTestRoots(this) @@ -448,8 +448,8 @@ class ObligationTests { } } - @Test - fun `payment netting`() { + @Test(timeout=300_000) + fun `payment netting`() { // Try netting out two obligations mockService.ledger(DUMMY_NOTARY) { cashObligationTestRoots(this) @@ -508,8 +508,8 @@ class ObligationTests { } } - @Test - fun `cash settlement`() { + @Test(timeout=300_000) + fun `cash settlement`() { // Try settling an obligation ledgerServices.ledger(DUMMY_NOTARY) { cashObligationTestRoots(this) @@ -571,8 +571,8 @@ class ObligationTests { } } - @Test - fun `commodity settlement`() { + @Test(timeout=300_000) + fun `commodity settlement`() { val commodityContractBytes = fakeAttachment("file1.txt", "https://www.big-book-of-banking-law.gov/commodity-claims.html") val defaultFcoj = Issued(defaultIssuer, Commodity.getInstance("FCOJ")!!) val oneUnitFcoj = Amount(1, defaultFcoj) @@ -599,8 +599,8 @@ class ObligationTests { } } - @Test - fun `payment default`() { + @Test(timeout=300_000) + fun `payment default`() { // Try defaulting an obligation without a time-window. ledgerServices.ledger(DUMMY_NOTARY) { cashObligationTestRoots(this) @@ -639,8 +639,8 @@ class ObligationTests { } } - @Test - fun testMergeSplit() { + @Test(timeout=300_000) + fun testMergeSplit() { // Splitting value works. transaction { attachments(Obligation.PROGRAM_ID) @@ -667,8 +667,8 @@ class ObligationTests { } } - @Test - fun zeroSizedValues() { + @Test(timeout=300_000) + fun zeroSizedValues() { transaction { attachments(Obligation.PROGRAM_ID) command(CHARLIE.owningKey, Obligation.Commands.Move()) @@ -686,8 +686,8 @@ class ObligationTests { } } - @Test - fun trivialMismatches() { + @Test(timeout=300_000) + fun trivialMismatches() { // Can't change issuer. transaction { attachments(Obligation.PROGRAM_ID) @@ -728,8 +728,8 @@ class ObligationTests { } } - @Test - fun `exit single product obligation`() { + @Test(timeout=300_000) + fun `exit single product obligation`() { // Single input/output straightforward case. transaction { attachments(Obligation.PROGRAM_ID) @@ -754,8 +754,8 @@ class ObligationTests { } - @Test - fun `exit multiple product obligations`() { + @Test(timeout=300_000) + fun `exit multiple product obligations`() { // Multi-product case. transaction { attachments(Obligation.PROGRAM_ID) @@ -772,8 +772,8 @@ class ObligationTests { } } - @Test - fun multiIssuer() { + @Test(timeout=300_000) + fun multiIssuer() { transaction { attachments(Obligation.PROGRAM_ID) @@ -802,8 +802,8 @@ class ObligationTests { } } - @Test - fun multiCurrency() { + @Test(timeout=300_000) + fun multiCurrency() { // Check we can do an atomic currency trade tx. transaction { attachments(Obligation.PROGRAM_ID) @@ -817,8 +817,8 @@ class ObligationTests { } } - @Test - fun `nettability of settlement contracts`() { + @Test(timeout=300_000) + fun `nettability of settlement contracts`() { val fiveKDollarsFromMegaToMega = Obligation.State(Lifecycle.NORMAL, MEGA_CORP, megaCorpDollarSettlement, 5000.DOLLARS.quantity, MEGA_CORP) val twoKDollarsFromMegaToMini = Obligation.State(Lifecycle.NORMAL, MEGA_CORP, megaCorpDollarSettlement, @@ -862,8 +862,8 @@ class ObligationTests { /** * Confirm that extraction of issuance definition works correctly. */ - @Test - fun `extraction of issuance defintion`() { + @Test(timeout=300_000) + fun `extraction of issuance defintion`() { val fiveKDollarsFromMegaToMega = Obligation.State(Lifecycle.NORMAL, MEGA_CORP, megaCorpDollarSettlement, 5000.DOLLARS.quantity, MEGA_CORP) val oneKDollarsFromMiniToMega = Obligation.State(Lifecycle.NORMAL, MINI_CORP, megaCorpDollarSettlement, @@ -874,8 +874,8 @@ class ObligationTests { assertEquals(oneKDollarsFromMiniToMega.template, megaCorpDollarSettlement) } - @Test - fun `adding two settlement contracts nets them`() { + @Test(timeout=300_000) + fun `adding two settlement contracts nets them`() { val megaCorpDollarSettlement = Obligation.Terms(trustedCashContract, megaIssuedDollars, fivePm) val fiveKDollarsFromMegaToMini = Obligation.State(Lifecycle.NORMAL, MEGA_CORP, megaCorpDollarSettlement, 5000.DOLLARS.quantity, MINI_CORP) @@ -900,8 +900,8 @@ class ObligationTests { } } - @Test - fun `extracting amounts due between parties from a list of states`() { + @Test(timeout=300_000) + fun `extracting amounts due between parties from a list of states`() { val megaCorpDollarSettlement = Obligation.Terms(trustedCashContract, megaIssuedDollars, fivePm) val fiveKDollarsFromMegaToMini = Obligation.State(Lifecycle.NORMAL, MEGA_CORP, megaCorpDollarSettlement, 5000.DOLLARS.quantity, MINI_CORP) @@ -911,8 +911,8 @@ class ObligationTests { assertEquals(expected, actual) } - @Test - fun `netting equal balances due between parties`() { + @Test(timeout=300_000) + fun `netting equal balances due between parties`() { // Now try it with two balances, which cancel each other out val balanced: Map, Amount> = mapOf( Pair(Pair(ALICE, BOB), Amount(100000000, GBP)), @@ -923,8 +923,8 @@ class ObligationTests { assertEquals(expected, actual) } - @Test - fun `netting difference balances due between parties`() { + @Test(timeout=300_000) + fun `netting difference balances due between parties`() { // Now try it with two balances, which cancel each other out val balanced: Map, Amount> = mapOf( Pair(Pair(ALICE, BOB), Amount(100000000, GBP)), @@ -937,24 +937,24 @@ class ObligationTests { assertEquals(expected, actual) } - @Test - fun `summing empty balances due between parties`() { + @Test(timeout=300_000) + fun `summing empty balances due between parties`() { val empty = emptyMap, Amount>() val expected = emptyMap() val actual = sumAmountsDue(empty) assertEquals(expected, actual) } - @Test - fun `summing balances due between parties`() { + @Test(timeout=300_000) + fun `summing balances due between parties`() { val simple: Map, Amount> = mapOf(Pair(Pair(ALICE, BOB), Amount(100000000, GBP))) val expected: Map = mapOf(Pair(ALICE, -100000000L), Pair(BOB, 100000000L)) val actual = sumAmountsDue(simple) assertEquals(expected, actual) } - @Test - fun `summing balances due between parties which net to zero`() { + @Test(timeout=300_000) + fun `summing balances due between parties which net to zero`() { // Now try it with two balances, which cancel each other out val balanced: Map, Amount> = mapOf( Pair(Pair(ALICE, BOB), Amount(100000000, GBP)), diff --git a/finance/workflows/src/integration-test/kotlin/net/corda/finance/workflows/CashExceptionSerialisationTest.kt b/finance/workflows/src/integration-test/kotlin/net/corda/finance/workflows/CashExceptionSerialisationTest.kt index edf0c8d6a8..7c2887919f 100644 --- a/finance/workflows/src/integration-test/kotlin/net/corda/finance/workflows/CashExceptionSerialisationTest.kt +++ b/finance/workflows/src/integration-test/kotlin/net/corda/finance/workflows/CashExceptionSerialisationTest.kt @@ -15,8 +15,8 @@ import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Test class CashExceptionSerialisationTest { - @Test - fun `cash exception with a cause can be serialised with AMQP`() { + @Test(timeout=300_000) + fun `cash exception with a cause can be serialised with AMQP`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode(rpcUsers = listOf(User("mark", "dadada", setOf(all())))).getOrThrow() val action = { node.rpc.startFlow(CashExceptionSerialisationTest::CashExceptionThrowingFlow).returnValue.getOrThrow() } diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/CurrenciesTests.kt b/finance/workflows/src/test/kotlin/net/corda/finance/CurrenciesTests.kt index d6d842992a..e3839fc234 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/CurrenciesTests.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/CurrenciesTests.kt @@ -5,15 +5,15 @@ import org.junit.Test import kotlin.test.assertEquals class CurrenciesTests { - @Test - fun `basic currency`() { + @Test(timeout=300_000) + fun `basic currency`() { val expected = 1000L val amount = Amount(expected, GBP) assertEquals(expected, amount.quantity) } - @Test - fun parseCurrency() { + @Test(timeout=300_000) + fun parseCurrency() { assertEquals(Amount(1234L, GBP), Amount.parseCurrency("£12.34")) assertEquals(Amount(1200L, GBP), Amount.parseCurrency("£12")) assertEquals(Amount(1000L, USD), Amount.parseCurrency("$10")) @@ -22,8 +22,8 @@ class CurrenciesTests { assertEquals(Amount(1500000000L, CHF), Amount.parseCurrency("15,000,000 CHF")) } - @Test - fun rendering() { + @Test(timeout=300_000) + fun rendering() { assertEquals("5000 JPY", Amount.parseCurrency("¥5000").toString()) assertEquals("50.12 USD", Amount.parseCurrency("$50.12").toString()) } diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashExitFlowTests.kt b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashExitFlowTests.kt index 87bb3ac51b..9040929e0d 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashExitFlowTests.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashExitFlowTests.kt @@ -42,8 +42,8 @@ class CashExitFlowTests { mockNet.stopNodes() } - @Test - fun `exit some cash`() { + @Test(timeout=300_000) + fun `exit some cash`() { val exitAmount = 500.DOLLARS val future = bankOfCordaNode.startFlow(CashExitFlow(exitAmount, ref)) mockNet.runNetwork() @@ -55,8 +55,8 @@ class CashExitFlowTests { assertEquals(expected, output.amount) } - @Test - fun `exit zero cash`() { + @Test(timeout=300_000) + fun `exit zero cash`() { val expected = 0.DOLLARS val future = bankOfCordaNode.startFlow(CashExitFlow(expected, ref)) mockNet.runNetwork() diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashIssueFlowTests.kt b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashIssueFlowTests.kt index 5be31773f1..03c1fd91bc 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashIssueFlowTests.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashIssueFlowTests.kt @@ -37,8 +37,8 @@ class CashIssueFlowTests { mockNet.stopNodes() } - @Test - fun `issue some cash`() { + @Test(timeout=300_000) + fun `issue some cash`() { val expected = 500.DOLLARS val ref = OpaqueBytes.of(0x01) val future = bankOfCordaNode.startFlow(CashIssueFlow(expected, ref, notary)) @@ -48,8 +48,8 @@ class CashIssueFlowTests { assertEquals(expected.`issued by`(bankOfCorda.ref(ref)), output.amount) } - @Test - fun `issue zero cash`() { + @Test(timeout=300_000) + fun `issue zero cash`() { val expected = 0.DOLLARS val ref = OpaqueBytes.of(0x01) val future = bankOfCordaNode.startFlow(CashIssueFlow(expected, ref, notary)) diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashPaymentFlowTests.kt b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashPaymentFlowTests.kt index 6e7e54f366..788911a89f 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashPaymentFlowTests.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashPaymentFlowTests.kt @@ -45,8 +45,8 @@ class CashPaymentFlowTests { mockNet.stopNodes() } - @Test - fun `pay some cash`() { + @Test(timeout=300_000) + fun `pay some cash`() { val payTo = aliceNode.info.singleIdentity() val expectedPayment = 500.DOLLARS val expectedChange = 1500.DOLLARS @@ -82,8 +82,8 @@ class CashPaymentFlowTests { } } - @Test - fun `pay more than we have`() { + @Test(timeout=300_000) + fun `pay more than we have`() { val payTo = aliceNode.info.singleIdentity() val expected = 4000.DOLLARS val future = bankOfCordaNode.startFlow(CashPaymentFlow(expected, @@ -94,8 +94,8 @@ class CashPaymentFlowTests { } } - @Test - fun `pay zero cash`() { + @Test(timeout=300_000) + fun `pay zero cash`() { val payTo = aliceNode.info.singleIdentity() val expected = 0.DOLLARS val future = bankOfCordaNode.startFlow(CashPaymentFlow(expected, diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashSelectionTest.kt b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashSelectionTest.kt index cd519e54c0..eaf9a44fcc 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashSelectionTest.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CashSelectionTest.kt @@ -27,8 +27,8 @@ class CashSelectionTest { mockNet.stopNodes() } - @Test - fun `unconsumed cash states`() { + @Test(timeout=300_000) + fun `unconsumed cash states`() { val issuerRef = OpaqueBytes.of(0) val issuedAmount = 1000.DOLLARS @@ -47,8 +47,8 @@ class CashSelectionTest { assertThat(availableBalanceAfterExit).isEqualTo(issuedAmount - exitedAmount) } - @Test - fun `cash selection sees states added in the same transaction`() { + @Test(timeout=300_000) + fun `cash selection sees states added in the same transaction`() { val node = mockNet.createNode() val nodeIdentity = node.services.myInfo.singleIdentity() val issuer = nodeIdentity.ref(1) @@ -72,8 +72,8 @@ class CashSelectionTest { assertThat(exitStates.size).isEqualTo(returnedCoinsNumber) } - @Test - fun `don't return extra coins if the selected amount has been reached`() { + @Test(timeout=300_000) + fun `don't return extra coins if the selected amount has been reached`() { val node = mockNet.createNode() val nodeIdentity = node.services.myInfo.singleIdentity() @@ -102,8 +102,8 @@ class CashSelectionTest { assertThat(exitStates.size).isEqualTo(returnedCoinsNumber) } - @Test - fun `select cash states issued by single transaction and give change`() { + @Test(timeout=300_000) + fun `select cash states issued by single transaction and give change`() { val node = mockNet.createNode() val nodeIdentity = node.services.myInfo.singleIdentity() diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CompatibilityTest.kt b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CompatibilityTest.kt index 9bfc13fc17..27a6f4324a 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/flows/CompatibilityTest.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/flows/CompatibilityTest.kt @@ -30,8 +30,8 @@ class CompatibilityTest { register(PublicKeySerializer) } - @Test - fun issueCashTansactionReadTest() { + @Test(timeout=300_000) + fun issueCashTansactionReadTest() { val inputStream = javaClass.classLoader.getResourceAsStream("compatibilityData/v3/node_transaction.dat") assertNotNull(inputStream) diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/internal/CashConfigDataFlowTest.kt b/finance/workflows/src/test/kotlin/net/corda/finance/internal/CashConfigDataFlowTest.kt index 1461d67b09..04b0f9f66b 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/internal/CashConfigDataFlowTest.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/internal/CashConfigDataFlowTest.kt @@ -17,8 +17,8 @@ class CashConfigDataFlowTest { @After fun cleanUp() = mockNet.stopNodes() - @Test - fun `issuable currencies read in from cordapp config`() { + @Test(timeout=300_000) + fun `issuable currencies read in from cordapp config`() { val node = mockNet.createNode(MockNodeParameters( additionalCordapps = listOf(FINANCE_WORKFLOWS_CORDAPP.withConfig(mapOf("issuableCurrencies" to listOf("EUR", "USD")))) )) diff --git a/finance/workflows/src/test/kotlin/net/corda/finance/workflows/asset/selection/CashSelectionH2ImplTest.kt b/finance/workflows/src/test/kotlin/net/corda/finance/workflows/asset/selection/CashSelectionH2ImplTest.kt index c231d3f7ac..3d9c2b2c74 100644 --- a/finance/workflows/src/test/kotlin/net/corda/finance/workflows/asset/selection/CashSelectionH2ImplTest.kt +++ b/finance/workflows/src/test/kotlin/net/corda/finance/workflows/asset/selection/CashSelectionH2ImplTest.kt @@ -27,8 +27,8 @@ class CashSelectionH2ImplTest { mockNet.stopNodes() } - @Test - fun `selecting pennies amount larger than max int, which is split across multiple cash states`() { + @Test(timeout=300_000) + fun `selecting pennies amount larger than max int, which is split across multiple cash states`() { val node = mockNet.createNode() // The amount has to split across at least two states, probably to trigger the H2 accumulator variable during the // spend operation below. @@ -40,8 +40,8 @@ class CashSelectionH2ImplTest { node.startFlow(CashPaymentFlow((Integer.MAX_VALUE + 1L).POUNDS, node.info.legalIdentities[0])).getOrThrow() } - @Test - fun `check does not hold connection over retries`() { + @Test(timeout=300_000) + fun `check does not hold connection over retries`() { val bankA = mockNet.createNode(MockNodeParameters( // Tweak connections to be minimal to make this easier (1 results in a hung node during start up, so use 2 connections). configOverrides = MockNodeConfigOverrides(extraDataSourceProperties = mapOf("maximumPoolSize" to "2")) @@ -58,8 +58,8 @@ class CashSelectionH2ImplTest { assertThatThrownBy { flow3.getOrThrow() }.isInstanceOf(CashException::class.java) } - @Test - fun `select pennies amount from cash states with more than two different issuers and expect change`() { + @Test(timeout=300_000) + fun `select pennies amount from cash states with more than two different issuers and expect change`() { val node = mockNet.createNode() val notary = mockNet.defaultNotaryIdentity @@ -73,8 +73,8 @@ class CashSelectionH2ImplTest { assertNotNull(paymentResult.recipient) } - @Test - fun `multiple issuers in issuerConstraint condition`() { + @Test(timeout=300_000) + fun `multiple issuers in issuerConstraint condition`() { val node = mockNet.createNode() node.startFlow(CashIssueFlow(1.POUNDS, OpaqueBytes.of(1), mockNet.defaultNotaryIdentity)).getOrThrow() val request = CashPaymentFlow.PaymentRequest(1.POUNDS, node.info.legalIdentities[0], true, setOf(node.info.legalIdentities[0], mockNet.defaultNotaryIdentity)) diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt index 8e859ce955..a63ca7dcdb 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt @@ -93,8 +93,8 @@ class AttachmentsClassLoaderStaticContractTests { .getLatestContractAttachments(AttachmentDummyContract.ATTACHMENT_PROGRAM_ID) } - @Test - fun `test serialization of WireTransaction with statically loaded contract`() { + @Test(timeout=300_000) + fun `test serialization of WireTransaction with statically loaded contract`() { val tx = AttachmentDummyContract().generateInitial(MEGA_CORP.ref(0), 42, DUMMY_NOTARY) val wireTransaction = tx.toWireTransaction(serviceHub) val bytes = wireTransaction.serialize() @@ -104,8 +104,8 @@ class AttachmentsClassLoaderStaticContractTests { assertEquals(42, (copiedWireTransaction.outputs[0].data as AttachmentDummyContract.State).magicNumber) } - @Test - fun `verify that contract DummyContract is in classPath`() { + @Test(timeout=300_000) + fun `verify that contract DummyContract is in classPath`() { val contractClass = Class.forName(ATTACHMENT_PROGRAM_ID) assertThat(contractClass.getDeclaredConstructor().newInstance()).isInstanceOf(Contract::class.java) } diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt index 25fb95067c..7b7cea187f 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/CordaPersistenceTest.kt @@ -22,15 +22,15 @@ class CordaPersistenceTest { database.close() } - @Test - fun `onAllOpenTransactionsClosed with zero transactions calls back immediately`() { + @Test(timeout=300_000) + fun `onAllOpenTransactionsClosed with zero transactions calls back immediately`() { val counter = AtomicInteger(0) database.onAllOpenTransactionsClosed { counter.incrementAndGet() } assertEquals(1, counter.get()) } - @Test - fun `onAllOpenTransactionsClosed with one transaction calls back after closing`() { + @Test(timeout=300_000) + fun `onAllOpenTransactionsClosed with one transaction calls back after closing`() { val counter = AtomicInteger(0) database.transaction { database.onAllOpenTransactionsClosed { counter.incrementAndGet() } @@ -39,8 +39,8 @@ class CordaPersistenceTest { assertEquals(1, counter.get()) } - @Test - fun `onAllOpenTransactionsClosed after one transaction has closed calls back immediately`() { + @Test(timeout=300_000) + fun `onAllOpenTransactionsClosed after one transaction has closed calls back immediately`() { val counter = AtomicInteger(0) database.transaction { database.onAllOpenTransactionsClosed { counter.incrementAndGet() } @@ -51,8 +51,8 @@ class CordaPersistenceTest { assertEquals(2, counter.get()) } - @Test - fun `onAllOpenTransactionsClosed with two transactions calls back after closing both`() { + @Test(timeout=300_000) + fun `onAllOpenTransactionsClosed with two transactions calls back after closing both`() { val counter = AtomicInteger(0) val phaser = openTransactionInOtherThreadAndCloseWhenISay() // Wait for tx to be started. @@ -67,7 +67,7 @@ class CordaPersistenceTest { assertEquals(1, counter.get()) } - @Test + @Test(timeout = 10_000) fun `onAllOpenTransactionsClosed with two transactions calls back after closing both - instigator closes last`() { val counter = AtomicInteger(0) val phaser = openTransactionInOtherThreadAndCloseWhenISay() diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt index 0d6659e31d..6b82e1b9d2 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt @@ -28,23 +28,23 @@ class SignedNodeInfoTest { private val nodeInfoBuilder = TestNodeInfoBuilder() - @Test - fun `verifying single identity`() { + @Test(timeout=300_000) + fun `verifying single identity`() { nodeInfoBuilder.addLegalIdentity(ALICE_NAME) val (nodeInfo, signedNodeInfo) = nodeInfoBuilder.buildWithSigned() assertThat(signedNodeInfo.verified()).isEqualTo(nodeInfo) } - @Test - fun `verifying multiple identities`() { + @Test(timeout=300_000) + fun `verifying multiple identities`() { nodeInfoBuilder.addLegalIdentity(ALICE_NAME) nodeInfoBuilder.addLegalIdentity(BOB_NAME) val (nodeInfo, signedNodeInfo) = nodeInfoBuilder.buildWithSigned() assertThat(signedNodeInfo.verified()).isEqualTo(nodeInfo) } - @Test - fun `verifying missing signature`() { + @Test(timeout=300_000) + fun `verifying missing signature`() { val (_, aliceKey) = nodeInfoBuilder.addLegalIdentity(ALICE_NAME) nodeInfoBuilder.addLegalIdentity(BOB_NAME) val nodeInfo = nodeInfoBuilder.build() @@ -54,8 +54,8 @@ class SignedNodeInfoTest { .hasMessageContaining("Missing signatures") } - @Test - fun `verifying composite keys only`() { + @Test(timeout=300_000) + fun `verifying composite keys only`() { val aliceKeyPair = generateKeyPair() val bobKeyPair = generateKeyPair() val identityKeyPair = generateKeyPair() @@ -67,8 +67,8 @@ class SignedNodeInfoTest { .hasMessageContaining("At least one identity with a non-composite key needs to be specified.") } - @Test - fun `verifying extra signature`() { + @Test(timeout=300_000) + fun `verifying extra signature`() { val (_, aliceKey) = nodeInfoBuilder.addLegalIdentity(ALICE_NAME) val nodeInfo = nodeInfoBuilder.build() val signedNodeInfo = nodeInfo.signWith(listOf(aliceKey, generateKeyPair().private)) @@ -77,8 +77,8 @@ class SignedNodeInfoTest { .hasMessageContaining("Extra signatures") } - @Test - fun `verifying incorrect signature`() { + @Test(timeout=300_000) + fun `verifying incorrect signature`() { nodeInfoBuilder.addLegalIdentity(ALICE_NAME) val nodeInfo = nodeInfoBuilder.build() val signedNodeInfo = nodeInfo.signWith(listOf(generateKeyPair().private)) @@ -87,8 +87,8 @@ class SignedNodeInfoTest { .hasMessageContaining(ALICE_NAME.toString()) } - @Test - fun `verifying with signatures in wrong order`() { + @Test(timeout=300_000) + fun `verifying with signatures in wrong order`() { val (_, aliceKey) = nodeInfoBuilder.addLegalIdentity(ALICE_NAME) val (_, bobKey) = nodeInfoBuilder.addLegalIdentity(BOB_NAME) val nodeInfo = nodeInfoBuilder.build() diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/config/ConfigParsingTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/config/ConfigParsingTest.kt index cb92e9431b..ef6bec0348 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/config/ConfigParsingTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/config/ConfigParsingTest.kt @@ -20,28 +20,28 @@ import javax.security.auth.x500.X500Principal import kotlin.reflect.full.primaryConstructor class ConfigParsingTest { - @Test - fun String() { + @Test(timeout=300_000) + fun String() { testPropertyType("hello world!", "bye") } - @Test - fun Int() { + @Test(timeout=300_000) + fun Int() { testPropertyType(1, 2) } - @Test - fun Long() { + @Test(timeout=300_000) + fun Long() { testPropertyType(Long.MAX_VALUE, Long.MIN_VALUE) } - @Test - fun Double() { + @Test(timeout=300_000) + fun Double() { testPropertyType(1.2, 3.4) } - @Test - fun Boolean() { + @Test(timeout=300_000) + fun Boolean() { testPropertyType(true, false) assertThat(config(Pair("value", "false")).parseAs().value).isEqualTo(false) assertThat(config(Pair("value", "False")).parseAs().value).isEqualTo(false) @@ -53,60 +53,60 @@ class ConfigParsingTest { .isInstanceOf(ConfigException.WrongType::class.java) .hasMessageContaining("hardcoded value: value has type STRING rather than BOOLEAN") } - @Test - fun Enum() { + @Test(timeout=300_000) + fun Enum() { testPropertyType(TestEnum.Value2, TestEnum.Value1, valuesToString = true) } - @Test - fun `unknown Enum`() { + @Test(timeout=300_000) + fun `unknown Enum`() { val config = config("value" to "UnknownValue") assertThatThrownBy { config.parseAs() } .hasMessageContaining(TestEnum.Value1.name) .hasMessageContaining(TestEnum.Value2.name) } - @Test - fun LocalDate() { + @Test(timeout=300_000) + fun LocalDate() { testPropertyType(LocalDate.now(), LocalDate.now().plusDays(1), valuesToString = true) } - @Test - fun Instant() { + @Test(timeout=300_000) + fun Instant() { testPropertyType(Instant.now(), Instant.now().plusMillis(100), valuesToString = true) } - @Test - fun NetworkHostAndPort() { + @Test(timeout=300_000) + fun NetworkHostAndPort() { testPropertyType( NetworkHostAndPort("localhost", 2223), NetworkHostAndPort("localhost", 2225), valuesToString = true) } - @Test - fun Path() { + @Test(timeout=300_000) + fun Path() { val path = "tmp" / "test" testPropertyType(path, path / "file", valuesToString = true) } - @Test - fun URL() { + @Test(timeout=300_000) + fun URL() { testPropertyType(URL("http://localhost:1234"), URL("http://localhost:1235"), valuesToString = true) } - @Test - fun X500Principal() { + @Test(timeout=300_000) + fun X500Principal() { testPropertyType(X500Principal("C=US, L=New York, CN=Corda Root CA, OU=Corda, O=R3 HoldCo LLC"), X500Principal("O=Bank A,L=London,C=GB"), valuesToString = true) } - @Test - fun UUID() { + @Test(timeout=300_000) + fun UUID() { testPropertyType(UUID.randomUUID(), UUID.randomUUID(), valuesToString = true) } - @Test - fun CordaX500Name() { + @Test(timeout=300_000) + fun CordaX500Name() { val name1 = CordaX500Name(organisation = "Mock Party", locality = "London", country = "GB") testPropertyType( name1, @@ -118,31 +118,31 @@ class ConfigParsingTest { assertThat(config.parseAs().value).isEqualTo(name1) } - @Test - fun `flat Properties`() { + @Test(timeout=300_000) + fun `flat Properties`() { val config = config("value" to mapOf("key" to "prop")) val data = PropertiesData(Properties().apply { this["key"] = "prop" }) assertThat(config.parseAs()).isEqualTo(data) assertThat(data.toConfig()).isEqualTo(config) } - @Test - fun `Properties key with dot`() { + @Test(timeout=300_000) + fun `Properties key with dot`() { val config = config("value" to mapOf("key.key2" to "prop")) val data = PropertiesData(Properties().apply { this["key.key2"] = "prop" }) assertThat(config.parseAs().value).isEqualTo(data.value) } - @Test - fun `nested Properties`() { + @Test(timeout=300_000) + fun `nested Properties`() { val config = config("value" to mapOf("first" to mapOf("second" to "prop"))) val data = PropertiesData(Properties().apply { this["first.second"] = "prop" }) assertThat(config.parseAs().value).isEqualTo(data.value) assertThat(data.toConfig()).isEqualTo(config) } - @Test - fun `List of Properties`() { + @Test(timeout=300_000) + fun `List of Properties`() { val config = config("values" to listOf(emptyMap(), mapOf("key" to "prop"))) val data = PropertiesListData(listOf( Properties(), @@ -151,16 +151,16 @@ class ConfigParsingTest { assertThat(data.toConfig()).isEqualTo(config) } - @Test - fun Set() { + @Test(timeout=300_000) + fun Set() { val data = StringSetData(setOf("a", "b")) assertThat(config("values" to listOf("a", "a", "b")).parseAs()).isEqualTo(data) assertThat(data.toConfig()).isEqualTo(config("values" to listOf("a", "b"))) assertThat(empty().parseAs().values).isEmpty() } - @Test - fun `multi property data class`() { + @Test(timeout=300_000) + fun `multi property data class`() { val config = config( "b" to true, "i" to 123, @@ -172,8 +172,8 @@ class ConfigParsingTest { assertThat(data.toConfig()).isEqualTo(config) } - @Test - fun `nested data classes`() { + @Test(timeout=300_000) + fun `nested data classes`() { val config = config( "first" to mapOf( "value" to "nested")) @@ -182,8 +182,8 @@ class ConfigParsingTest { assertThat(data.toConfig()).isEqualTo(config) } - @Test - fun `List of data classes`() { + @Test(timeout=300_000) + fun `List of data classes`() { val config = config( "list" to listOf( mapOf("value" to "1"), @@ -193,43 +193,43 @@ class ConfigParsingTest { assertThat(data.toConfig()).isEqualTo(config) } - @Test - fun `default value property`() { + @Test(timeout=300_000) + fun `default value property`() { assertThat(config("a" to 3).parseAs()).isEqualTo(DefaultData(3, 2)) assertThat(config("a" to 3, "defaultOfTwo" to 3).parseAs()).isEqualTo(DefaultData(3, 3)) assertThat(DefaultData(3).toConfig()).isEqualTo(config("a" to 3, "defaultOfTwo" to 2)) } - @Test - fun `nullable property`() { + @Test(timeout=300_000) + fun `nullable property`() { assertThat(empty().parseAs().nullable).isNull() assertThat(config("nullable" to null).parseAs().nullable).isNull() assertThat(config("nullable" to "not null").parseAs().nullable).isEqualTo("not null") assertThat(NullableData(null).toConfig()).isEqualTo(empty()) } - @Test - fun `data class with checks`() { + @Test(timeout=300_000) + fun `data class with checks`() { val config = config("positive" to -1) assertThatExceptionOfType(IllegalArgumentException::class.java) .isThrownBy { config.parseAs() } .withMessageContaining("-1") } - @Test - fun `old config property`() { + @Test(timeout=300_000) + fun `old config property`() { assertThat(config("oldValue" to "old").parseAs().newValue).isEqualTo("old") assertThat(config("newValue" to "new").parseAs().newValue).isEqualTo("new") assertThat(OldData("old").toConfig()).isEqualTo(config("newValue" to "old")) } - @Test - fun `static field`() { + @Test(timeout=300_000) + fun `static field`() { assertThat(DataWithCompanion(3).toConfig()).isEqualTo(config("value" to 3)) } - @Test - fun `unknown configuration keys raise exception`() { + @Test(timeout=300_000) + fun `unknown configuration keys raise exception`() { // intentional typo here, parsing should throw rather than sneakily return default value val knownKey = "mandatory" @@ -243,8 +243,8 @@ class ConfigParsingTest { } } - @Test - fun `parse with provided parser`() { + @Test(timeout=300_000) + fun `parse with provided parser`() { val type1Config = mapOf("type" to "1", "value" to "type 1 value") val type2Config = mapOf("type" to "2", "value" to "type 2 value") diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt index dff02c527f..983f59c185 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt @@ -14,8 +14,8 @@ class AliasPrivateKeyTest { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `store AliasPrivateKey entry and cert to keystore`() { + @Test(timeout=300_000) + fun `store AliasPrivateKey entry and cert to keystore`() { val alias = "01234567890" val aliasPrivateKey = AliasPrivateKey(alias) val certificatesDirectory = tempFolder.root.toPath() diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/DevCertificatesTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/DevCertificatesTest.kt index e586a6c642..49f905d7d8 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/DevCertificatesTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/DevCertificatesTest.kt @@ -18,8 +18,8 @@ class DevCertificatesTest { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `create server certificate in keystore for SSL`() { + @Test(timeout=300_000) + fun `create server certificate in keystore for SSL`() { // given val newTrustStore = loadDevCaTrustStore() val newTrustRoot = newTrustStore[X509Utilities.CORDA_ROOT_CA] diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffAlgorithmsTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffAlgorithmsTest.kt index a44f475aca..06db0385ad 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffAlgorithmsTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffAlgorithmsTest.kt @@ -54,8 +54,8 @@ class TlsDiffAlgorithmsTest(private val serverAlgo: String, private val clientAl @JvmField val tempFolder = TemporaryFolder() - @Test - fun testClientServerTlsExchange() { + @Test(timeout=300_000) + fun testClientServerTlsExchange() { //System.setProperty("javax.net.debug", "all") diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffProtocolsTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffProtocolsTest.kt index 1e865e202f..14cbc53e5c 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffProtocolsTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/TlsDiffProtocolsTest.kt @@ -83,8 +83,8 @@ class TlsDiffProtocolsTest(private val serverAlgo: String, private val clientAlg @JvmField val tempFolder = TemporaryFolder() - @Test - fun testClientServerTlsExchange() { + @Test(timeout=300_000) + fun testClientServerTlsExchange() { //System.setProperty("javax.net.debug", "all") diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt index 749dddb0ba..a086e91306 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt @@ -105,8 +105,8 @@ class X509UtilitiesTest { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `create valid self-signed CA certificate`() { + @Test(timeout=300_000) + fun `create valid self-signed CA certificate`() { Crypto.supportedSignatureSchemes().filter { it != COMPOSITE_KEY }.forEach { validSelfSignedCertificate(it) } } @@ -126,8 +126,8 @@ class X509UtilitiesTest { } } - @Test - fun `load and save a PEM file certificate`() { + @Test(timeout=300_000) + fun `load and save a PEM file certificate`() { Crypto.supportedSignatureSchemes().filter { it != COMPOSITE_KEY }.forEach { loadSavePEMCert(it) } } @@ -140,8 +140,8 @@ class X509UtilitiesTest { assertEquals(caCert, readCertificate) } - @Test - fun `create valid server certificate chain`() { + @Test(timeout=300_000) + fun `create valid server certificate chain`() { certChainSchemeCombinations.forEach { createValidServerCertChain(it.first, it.second) } } @@ -178,8 +178,8 @@ class X509UtilitiesTest { return CaAndChildKeysCertsAndSubjects(caKeyPair, caCert, childKeyPair, childCert, rootSubject, childSubject) } - @Test - fun `create valid server certificate chain includes CRL info`() { + @Test(timeout=300_000) + fun `create valid server certificate chain includes CRL info`() { certChainSchemeCombinations.forEach { createValidServerCertIncludeCRL(it.first, it.second) } } @@ -204,8 +204,8 @@ class X509UtilitiesTest { } } - @Test - fun `storing all supported key types in java keystore`() { + @Test(timeout=300_000) + fun `storing all supported key types in java keystore`() { Crypto.supportedSignatureSchemes().filter { it != COMPOSITE_KEY }.forEach { storeKeyToKeystore(it) } } @@ -234,8 +234,8 @@ class X509UtilitiesTest { assertEquals(keyPair.private, reloadedPrivateKey) } - @Test - fun `create server certificate in keystore for SSL`() { + @Test(timeout=300_000) + fun `create server certificate in keystore for SSL`() { val certificatesDirectory = tempFolder.root.toPath() val signingCertStore = CertificateStoreStubs.Signing.withCertificatesDirectory(certificatesDirectory, "serverstorepass") val p2pSslConfig = CertificateStoreStubs.P2P.withCertificatesDirectory(certificatesDirectory, keyStorePassword = "serverstorepass") @@ -269,8 +269,8 @@ class X509UtilitiesTest { assertTrue { Crypto.isValid(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME, serverCert.publicKey, signature, testData) } } - @Test - fun `create server cert and use in SSL socket`() { + @Test(timeout=300_000) + fun `create server cert and use in SSL socket`() { val sslConfig = CertificateStoreStubs.P2P.withCertificatesDirectory(tempFolder.root.toPath(), keyStorePassword = "serverstorepass") val (rootCa, intermediateCa) = createDevIntermediateCaCertPath() @@ -361,8 +361,8 @@ class X509UtilitiesTest { assertTrue(done) } - @Test - fun `create server cert and use in OpenSSL channel`() { + @Test(timeout=300_000) + fun `create server cert and use in OpenSSL channel`() { val sslConfig = CertificateStoreStubs.P2P.withCertificatesDirectory(tempFolder.root.toPath(), keyStorePassword = "serverstorepass") val (rootCa, intermediateCa) = createDevIntermediateCaCertPath() @@ -427,8 +427,8 @@ class X509UtilitiesTest { trustStore[X509Utilities.CORDA_ROOT_CA] = rootCert } - @Test - fun `get correct private key type from Keystore`() { + @Test(timeout=300_000) + fun `get correct private key type from Keystore`() { schemeToKeyTypes.forEach { getCorrectKeyFromKeystore(it.first, it.second, it.third) } } @@ -450,8 +450,8 @@ class X509UtilitiesTest { return Pair(keyFromKeystore, keyFromKeystoreCasted) } - @Test - fun `serialize - deserialize X509Certificate`() { + @Test(timeout=300_000) + fun `serialize - deserialize X509Certificate`() { Crypto.supportedSignatureSchemes().filter { it != COMPOSITE_KEY }.forEach { serializeDeserializeX509Cert(it) } } @@ -470,8 +470,8 @@ class X509UtilitiesTest { assertEquals(expected, actual) } - @Test - fun `serialize - deserialize X509CertPath`() { + @Test(timeout=300_000) + fun `serialize - deserialize X509CertPath`() { Crypto.supportedSignatureSchemes().filter { it != COMPOSITE_KEY }.forEach { serializeDeserializeX509CertPath(it) } } @@ -495,8 +495,8 @@ class X509UtilitiesTest { assertEquals(expected, actual) } - @Test - fun `signing a key type with another key type certificate then store and reload correctly from keystore`() { + @Test(timeout=300_000) + fun `signing a key type with another key type certificate then store and reload correctly from keystore`() { certChainSchemeCombinations.forEach { signCertWithOtherKeyTypeAndTestKeystoreReload(it.first, it.second) } } @@ -524,8 +524,8 @@ class X509UtilitiesTest { assertEquals(childKeyPair.private, reloadedPrivateKey) } - @Test - fun `check certificate validity or print warning if expiry is within 30 days`() { + @Test(timeout=300_000) + fun `check certificate validity or print warning if expiry is within 30 days`() { val keyPair = generateKeyPair(DEFAULT_TLS_SIGNATURE_SCHEME) val testName = X500Principal("CN=Test,O=R3 Ltd,L=London,C=GB") val cert = X509Utilities.createSelfSignedCACertificate(testName, keyPair, 0.days to 50.days) diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt index 81cb8d945e..0f441b0ae6 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt @@ -55,8 +55,8 @@ class BCCryptoServiceTests { wrappingKeyStorePath = certificatesDirectory / "wrappingkeystore.pkcs12" } - @Test - fun `BCCryptoService generate key pair and sign both data and cert`() { + @Test(timeout=300_000) + fun `BCCryptoService generate key pair and sign both data and cert`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) // Testing every supported scheme. Crypto.supportedSignatureSchemes().filter { it != Crypto.COMPOSITE_KEY }.forEach { generateKeyAndSignForScheme(cryptoService, it) } @@ -87,8 +87,8 @@ class BCCryptoServiceTests { certificate.verify(pubKey) } - @Test - fun `BCCryptoService generate key pair and sign with existing schemes`() { + @Test(timeout=300_000) + fun `BCCryptoService generate key pair and sign with existing schemes`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) // Testing every supported scheme. Crypto.supportedSignatureSchemes().filter { it != Crypto.COMPOSITE_KEY @@ -101,8 +101,8 @@ class BCCryptoServiceTests { } } - @Test - fun `BCCryptoService generate key pair and sign with passed signing algorithm`() { + @Test(timeout=300_000) + fun `BCCryptoService generate key pair and sign with passed signing algorithm`() { assertTrue{signAndVerify(signAlgo = "NONEwithRSA", alias = "myKeyAlias", keyTypeAlgo = "RSA")} assertTrue{signAndVerify(signAlgo = "MD2withRSA", alias = "myKeyAlias", keyTypeAlgo = "RSA")} @@ -163,8 +163,8 @@ class BCCryptoServiceTests { certificateStoreFileName = keyStoreFilename) } - @Test - fun `When key does not exist getPublicKey, sign and getSigner should throw`() { + @Test(timeout=300_000) + fun `When key does not exist getPublicKey, sign and getSigner should throw`() { val nonExistingAlias = "nonExistingAlias" val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) assertFalse { cryptoService.containsKey(nonExistingAlias) } @@ -173,16 +173,16 @@ class BCCryptoServiceTests { assertFailsWith { cryptoService.getSigner(nonExistingAlias) } } - @Test - fun `cryptoService supports degraded mode of wrapping`() { + @Test(timeout=300_000) + fun `cryptoService supports degraded mode of wrapping`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) val supportedMode = cryptoService.getWrappingMode() assertThat(supportedMode).isEqualTo(WrappingMode.DEGRADED_WRAPPED) } - @Test - fun `cryptoService does not fail when requested to create same wrapping key twice with failIfExists is false`() { + @Test(timeout=300_000) + fun `cryptoService does not fail when requested to create same wrapping key twice with failIfExists is false`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) val keyAlias = UUID.randomUUID().toString() @@ -190,8 +190,8 @@ class BCCryptoServiceTests { cryptoService.createWrappingKey(keyAlias, failIfExists = false) } - @Test - fun `cryptoService does fail when requested to create same wrapping key twice with failIfExists is true`() { + @Test(timeout=300_000) + fun `cryptoService does fail when requested to create same wrapping key twice with failIfExists is true`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) val keyAlias = UUID.randomUUID().toString() @@ -202,8 +202,8 @@ class BCCryptoServiceTests { .hasMessage("There is an existing key with the alias: $keyAlias") } - @Test - fun `cryptoService fails when asked to generate wrapped key pair or sign, but the master key specified does not exist`() { + @Test(timeout=300_000) + fun `cryptoService fails when asked to generate wrapped key pair or sign, but the master key specified does not exist`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) val wrappingKeyAlias = UUID.randomUUID().toString() @@ -219,8 +219,8 @@ class BCCryptoServiceTests { .hasMessage("There is no master key under the alias: $wrappingKeyAlias") } - @Test - fun `cryptoService can generate wrapped key pair and sign with the private key successfully, using default algorithm`() { + @Test(timeout=300_000) + fun `cryptoService can generate wrapped key pair and sign with the private key successfully, using default algorithm`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) val wrappingKeyAlias = UUID.randomUUID().toString() @@ -228,8 +228,8 @@ class BCCryptoServiceTests { generateWrappedKeyPairSignAndVerify(cryptoService, wrappingKeyAlias) } - @Test - fun `cryptoService can generate wrapped key pair and sign with the private key successfully`() { + @Test(timeout=300_000) + fun `cryptoService can generate wrapped key pair and sign with the private key successfully`() { val cryptoService = BCCryptoService(ALICE_NAME.x500Principal, signingCertificateStore, wrappingKeyStorePath) val wrappingKeyAlias = UUID.randomUUID().toString() diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/lifecycle/NodeLifecycleEventsDistributorMultiThreadedTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/lifecycle/NodeLifecycleEventsDistributorMultiThreadedTest.kt index a5da9f740b..e7ae3f00e6 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/lifecycle/NodeLifecycleEventsDistributorMultiThreadedTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/lifecycle/NodeLifecycleEventsDistributorMultiThreadedTest.kt @@ -19,8 +19,8 @@ internal class NodeLifecycleEventsDistributorMultiThreadedTest { private val eventsDeliveredCounter = AtomicLong() - @Test - fun addAndDistributeConcurrently() { + @Test(timeout=300_000) + fun addAndDistributeConcurrently() { NodeLifecycleEventsDistributor().use { instance -> diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt index f1f8145853..ff2cdb00eb 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt @@ -107,15 +107,15 @@ class NetworkBootstrapperTest { } } - @Test - fun `empty dir`() { + @Test(timeout=300_000) + fun `empty dir`() { assertThatThrownBy { bootstrap() }.hasMessage("No nodes found") } - @Test - fun `single node conf file`() { + @Test(timeout=300_000) + fun `single node conf file`() { createNodeConfFile("node1", bobConfig) bootstrap() val networkParameters = assertBootstrappedNetwork(fakeEmbeddedCorda, "node1" to bobConfig) @@ -126,31 +126,31 @@ class NetworkBootstrapperTest { } } - @Test - fun `node conf file and corda jar`() { + @Test(timeout=300_000) + fun `node conf file and corda jar`() { createNodeConfFile("node1", bobConfig) val fakeCordaJar = fakeFileBytes(rootDir / "corda.jar") bootstrap() assertBootstrappedNetwork(fakeCordaJar, "node1" to bobConfig) } - @Test - fun `single node directory with just node conf file`() { + @Test(timeout=300_000) + fun `single node directory with just node conf file`() { createNodeDir("bob", bobConfig) bootstrap() assertBootstrappedNetwork(fakeEmbeddedCorda, "bob" to bobConfig) } - @Test - fun `single node directory with node conf file and corda jar`() { + @Test(timeout=300_000) + fun `single node directory with node conf file and corda jar`() { val nodeDir = createNodeDir("bob", bobConfig) val fakeCordaJar = fakeFileBytes(nodeDir / "corda.jar") bootstrap() assertBootstrappedNetwork(fakeCordaJar, "bob" to bobConfig) } - @Test - fun `single node directory with just corda jar`() { + @Test(timeout=300_000) + fun `single node directory with just corda jar`() { val nodeCordaJar = (rootDir / "alice").createDirectories() / "corda.jar" val fakeCordaJar = fakeFileBytes(nodeCordaJar) assertThatThrownBy { @@ -159,8 +159,8 @@ class NetworkBootstrapperTest { assertThat(nodeCordaJar).hasBinaryContent(fakeCordaJar) // Make sure the corda.jar is left untouched } - @Test - fun `two node conf files, one of which is a notary`() { + @Test(timeout=300_000) + fun `two node conf files, one of which is a notary`() { createNodeConfFile("alice", aliceConfig) createNodeConfFile("notary", notaryConfig) bootstrap() @@ -168,8 +168,8 @@ class NetworkBootstrapperTest { networkParameters.assertContainsNotary("notary") } - @Test - fun `two node conf files with the same legal name`() { + @Test(timeout=300_000) + fun `two node conf files with the same legal name`() { createNodeConfFile("node1", aliceConfig) createNodeConfFile("node2", aliceConfig) assertThatThrownBy { @@ -177,16 +177,16 @@ class NetworkBootstrapperTest { }.hasMessageContaining("Nodes must have unique legal names") } - @Test - fun `one node directory and one node conf file`() { + @Test(timeout=300_000) + fun `one node directory and one node conf file`() { createNodeConfFile("alice", aliceConfig) createNodeDir("bob", bobConfig) bootstrap() assertBootstrappedNetwork(fakeEmbeddedCorda, "alice" to aliceConfig, "bob" to bobConfig) } - @Test - fun `node conf file and CorDapp jar`() { + @Test(timeout=300_000) + fun `node conf file and CorDapp jar`() { createNodeConfFile("alice", aliceConfig) val cordappBytes = createFakeCordappJar("sample-app", listOf("contract.class")) bootstrap() @@ -197,8 +197,8 @@ class NetworkBootstrapperTest { )) } - @Test - fun `no copy CorDapps`() { + @Test(timeout=300_000) + fun `no copy CorDapps`() { createNodeConfFile("alice", aliceConfig) val cordappBytes = createFakeCordappJar("sample-app", listOf("contract.class")) bootstrap(copyCordapps = CopyCordapps.No) @@ -209,8 +209,8 @@ class NetworkBootstrapperTest { )) } - @Test - fun `add node to existing network`() { + @Test(timeout=300_000) + fun `add node to existing network`() { createNodeConfFile("alice", aliceConfig) bootstrap() val networkParameters1 = (rootDir / "alice").networkParameters @@ -220,8 +220,8 @@ class NetworkBootstrapperTest { assertThat(networkParameters1).isEqualTo(networkParameters2) } - @Test - fun `add notary to existing network`() { + @Test(timeout=300_000) + fun `add notary to existing network`() { createNodeConfFile("alice", aliceConfig) bootstrap() createNodeConfFile("notary", notaryConfig) @@ -231,8 +231,8 @@ class NetworkBootstrapperTest { assertThat(networkParameters.epoch).isEqualTo(2) } - @Test - fun `network parameters overrides`() { + @Test(timeout=300_000) + fun `network parameters overrides`() { createNodeConfFile("alice", aliceConfig) val minimumPlatformVersion = 2 val maxMessageSize = 10000 @@ -255,15 +255,15 @@ class NetworkBootstrapperTest { private val alicePackageName = "com.example.alice" private val bobPackageName = "com.example.bob" - @Test - fun `register new package namespace in existing network`() { + @Test(timeout=300_000) + fun `register new package namespace in existing network`() { createNodeConfFile("alice", aliceConfig) bootstrap(packageOwnership = mapOf(Pair(alicePackageName, ALICE.publicKey))) assertContainsPackageOwner("alice", mapOf(Pair(alicePackageName, ALICE.publicKey))) } - @Test - fun `register additional package namespace in existing network`() { + @Test(timeout=300_000) + fun `register additional package namespace in existing network`() { createNodeConfFile("alice", aliceConfig) bootstrap(packageOwnership = mapOf(Pair(alicePackageName, ALICE.publicKey))) assertContainsPackageOwner("alice", mapOf(Pair(alicePackageName, ALICE.publicKey))) @@ -273,8 +273,8 @@ class NetworkBootstrapperTest { assertContainsPackageOwner("bob", mapOf(Pair(alicePackageName, ALICE.publicKey), Pair(bobPackageName, BOB.publicKey))) } - @Test - fun `attempt to register overlapping namespaces in existing network`() { + @Test(timeout=300_000) + fun `attempt to register overlapping namespaces in existing network`() { createNodeConfFile("alice", aliceConfig) val greedyNamespace = "com.example" bootstrap(packageOwnership = mapOf(Pair(greedyNamespace, ALICE.publicKey))) @@ -286,8 +286,8 @@ class NetworkBootstrapperTest { bootstrap(packageOwnership = mapOf(Pair(greedyNamespace, ALICE.publicKey), Pair(bobPackageName, BOB.publicKey))) } - @Test - fun `unregister single package namespace in network of one`() { + @Test(timeout=300_000) + fun `unregister single package namespace in network of one`() { createNodeConfFile("alice", aliceConfig) bootstrap(packageOwnership = mapOf(Pair(alicePackageName, ALICE.publicKey))) assertContainsPackageOwner("alice", mapOf(Pair(alicePackageName, ALICE.publicKey))) @@ -296,8 +296,8 @@ class NetworkBootstrapperTest { assertContainsPackageOwner("alice", emptyMap()) } - @Test - fun `unregister single package namespace in network of many`() { + @Test(timeout=300_000) + fun `unregister single package namespace in network of many`() { createNodeConfFile("alice", aliceConfig) bootstrap(packageOwnership = mapOf(Pair(alicePackageName, ALICE.publicKey), Pair(bobPackageName, BOB.publicKey))) // unregister package name @@ -305,8 +305,8 @@ class NetworkBootstrapperTest { assertContainsPackageOwner("alice", mapOf(Pair(alicePackageName, ALICE.publicKey))) } - @Test - fun `unregister all package namespaces in existing network`() { + @Test(timeout=300_000) + fun `unregister all package namespaces in existing network`() { createNodeConfFile("alice", aliceConfig) bootstrap(packageOwnership = mapOf(Pair(alicePackageName, ALICE.publicKey), Pair(bobPackageName, BOB.publicKey))) // unregister all package names diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NodeInfoFilesCopierTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NodeInfoFilesCopierTest.kt index ab419c544c..ee4458067a 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NodeInfoFilesCopierTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NodeInfoFilesCopierTest.kt @@ -48,8 +48,8 @@ class NodeInfoFilesCopierTest { nodeInfoFilesCopier = NodeInfoFilesCopier(scheduler) } - @Test - fun `files created before a node is started are copied to that node`() { + @Test(timeout=300_000) + fun `files created before a node is started are copied to that node`() { // Configure the first node. nodeInfoFilesCopier.addConfig(node1RootPath) // Ensure directories are created. @@ -69,8 +69,8 @@ class NodeInfoFilesCopierTest { } } - @Test - fun `polling of running nodes`() { + @Test(timeout=300_000) + fun `polling of running nodes`() { // Configure 2 nodes. nodeInfoFilesCopier.addConfig(node1RootPath) nodeInfoFilesCopier.addConfig(node2RootPath) @@ -87,8 +87,8 @@ class NodeInfoFilesCopierTest { } } - @Test - fun `remove nodes`() { + @Test(timeout=300_000) + fun `remove nodes`() { // Configure 2 nodes. nodeInfoFilesCopier.addConfig(node1RootPath) nodeInfoFilesCopier.addConfig(node2RootPath) @@ -111,8 +111,8 @@ class NodeInfoFilesCopierTest { } } - @Test - fun clear() { + @Test(timeout=300_000) + fun clear() { // Configure 2 nodes. nodeInfoFilesCopier.addConfig(node1RootPath) nodeInfoFilesCopier.addConfig(node2RootPath) diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/WhitelistGeneratorTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/WhitelistGeneratorTest.kt index 2bfb9c68b4..a1c9166cb4 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/WhitelistGeneratorTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/WhitelistGeneratorTest.kt @@ -9,34 +9,34 @@ import org.assertj.core.api.Assertions.assertThatIllegalArgumentException import org.junit.Test class WhitelistGeneratorTest { - @Test - fun `no jars against empty whitelist`() { + @Test(timeout=300_000) + fun `no jars against empty whitelist`() { val whitelist = generateWhitelist(emptyMap(), emptyList(), emptyList()) assertThat(whitelist).isEmpty() } - @Test - fun `no jars against single whitelist`() { + @Test(timeout=300_000) + fun `no jars against single whitelist`() { val existingWhitelist = mapOf("class1" to listOf(SecureHash.randomSHA256())) val newWhitelist = generateWhitelist(existingWhitelist, emptyList(), emptyList()) assertThat(newWhitelist).isEqualTo(existingWhitelist) } - @Test - fun `empty jar against empty whitelist`() { + @Test(timeout=300_000) + fun `empty jar against empty whitelist`() { val whitelist = generateWhitelist(emptyMap(), emptyList(), listOf(TestContractsJar(contractClassNames = emptyList()))) assertThat(whitelist).isEmpty() } - @Test - fun `empty jar against single whitelist`() { + @Test(timeout=300_000) + fun `empty jar against single whitelist`() { val existingWhitelist = mapOf("class1" to listOf(SecureHash.randomSHA256())) val newWhitelist = generateWhitelist(existingWhitelist, emptyList(), listOf(TestContractsJar(contractClassNames = emptyList()))) assertThat(newWhitelist).isEqualTo(existingWhitelist) } - @Test - fun `jar with single contract against empty whitelist`() { + @Test(timeout=300_000) + fun `jar with single contract against empty whitelist`() { val jar = TestContractsJar(contractClassNames = listOf("class1")) val whitelist = generateWhitelist(emptyMap(), emptyList(), listOf(jar)) assertThat(whitelist).isEqualTo(mapOf( @@ -44,8 +44,8 @@ class WhitelistGeneratorTest { )) } - @Test - fun `single contract jar against single whitelist of different contract`() { + @Test(timeout=300_000) + fun `single contract jar against single whitelist of different contract`() { val class1JarHash = SecureHash.randomSHA256() val existingWhitelist = mapOf("class1" to listOf(class1JarHash)) val jar = TestContractsJar(contractClassNames = listOf("class2")) @@ -56,8 +56,8 @@ class WhitelistGeneratorTest { )) } - @Test - fun `same jar with single contract`() { + @Test(timeout=300_000) + fun `same jar with single contract`() { val jarHash = SecureHash.randomSHA256() val existingWhitelist = mapOf("class1" to listOf(jarHash)) val jar = TestContractsJar(hash = jarHash, contractClassNames = listOf("class1")) @@ -65,8 +65,8 @@ class WhitelistGeneratorTest { assertThat(newWhitelist).isEqualTo(existingWhitelist) } - @Test - fun `jar with updated contract`() { + @Test(timeout=300_000) + fun `jar with updated contract`() { val previousJarHash = SecureHash.randomSHA256() val existingWhitelist = mapOf("class1" to listOf(previousJarHash)) val newContractsJar = TestContractsJar(contractClassNames = listOf("class1")) @@ -76,8 +76,8 @@ class WhitelistGeneratorTest { )) } - @Test - fun `jar with one existing contract and one new one`() { + @Test(timeout=300_000) + fun `jar with one existing contract and one new one`() { val previousJarHash = SecureHash.randomSHA256() val existingWhitelist = mapOf("class1" to listOf(previousJarHash)) val newContractsJar = TestContractsJar(contractClassNames = listOf("class1", "class2")) @@ -88,8 +88,8 @@ class WhitelistGeneratorTest { )) } - @Test - fun `two versions of the same contract`() { + @Test(timeout=300_000) + fun `two versions of the same contract`() { val version1Jar = TestContractsJar(contractClassNames = listOf("class1")) val version2Jar = TestContractsJar(contractClassNames = listOf("class1")) val newWhitelist = generateWhitelist(emptyMap(), emptyList(), listOf(version1Jar, version2Jar)) @@ -98,15 +98,15 @@ class WhitelistGeneratorTest { )) } - @Test - fun `jar with single new contract that's excluded`() { + @Test(timeout=300_000) + fun `jar with single new contract that's excluded`() { val jar = TestContractsJar(contractClassNames = listOf("class1")) val whitelist = generateWhitelist(emptyMap(), listOf("class1"), listOf(jar)) assertThat(whitelist).isEmpty() } - @Test - fun `jar with two new contracts, one of which is excluded`() { + @Test(timeout=300_000) + fun `jar with two new contracts, one of which is excluded`() { val jar = TestContractsJar(contractClassNames = listOf("class1", "class2")) val whitelist = generateWhitelist(emptyMap(), listOf("class1"), listOf(jar)) assertThat(whitelist).isEqualTo(mapOf( @@ -114,8 +114,8 @@ class WhitelistGeneratorTest { )) } - @Test - fun `jar with updated contract but it's excluded`() { + @Test(timeout=300_000) + fun `jar with updated contract but it's excluded`() { val existingWhitelist = mapOf("class1" to listOf(SecureHash.randomSHA256())) val jar = TestContractsJar(contractClassNames = listOf("class1")) assertThatIllegalArgumentException().isThrownBy { diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt index 0bd0b4dbb4..1c975cd93a 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/persistence/MissingSchemaMigrationTest.kt @@ -43,24 +43,24 @@ class MissingSchemaMigrationTest { TestIdentity(ALICE_NAME, 70).name, forceThrowOnMissingMigration) } - @Test - fun `test that an error is thrown when forceThrowOnMissingMigration is set and a mapped schema is missing a migration`() { + @Test(timeout=300_000) + fun `test that an error is thrown when forceThrowOnMissingMigration is set and a mapped schema is missing a migration`() { assertThatThrownBy { createSchemaMigration(setOf(GoodSchema), true) .nodeStartup(dataSource.connection.use { DBCheckpointStorage().getCheckpointCount(it) != 0L }) }.isInstanceOf(MissingMigrationException::class.java) } - @Test - fun `test that an error is not thrown when forceThrowOnMissingMigration is not set and a mapped schema is missing a migration`() { + @Test(timeout=300_000) + fun `test that an error is not thrown when forceThrowOnMissingMigration is not set and a mapped schema is missing a migration`() { assertDoesNotThrow { createSchemaMigration(setOf(GoodSchema), false) .nodeStartup(dataSource.connection.use { DBCheckpointStorage().getCheckpointCount(it) != 0L }) } } - @Test - fun `test that there are no missing migrations for the node`() { + @Test(timeout=300_000) + fun `test that there are no missing migrations for the node`() { assertDoesNotThrow("This test failure indicates " + "a new table has been added to the node without the appropriate migration scripts being present") { createSchemaMigration(NodeSchemaService().internalSchemas(), false) diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt index 1791a48f4c..00a2bc3650 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/SSLHelperTest.kt @@ -12,8 +12,8 @@ import javax.net.ssl.TrustManagerFactory import kotlin.test.assertEquals class SSLHelperTest { - @Test - fun `ensure SNI header in correct format`() { + @Test(timeout=300_000) + fun `ensure SNI header in correct format`() { val legalName = CordaX500Name("Test", "London", "GB") val sslConfig = configureTestSSL(legalName) diff --git a/node/src/integration-test-slow/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt b/node/src/integration-test-slow/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt index d26cf61fcf..e75e444607 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/client/rpc/FlowsExecutionModeRpcTest.kt @@ -12,8 +12,8 @@ import org.junit.Test class FlowsExecutionModeRpcTest { - @Test - fun `persistent state survives node restart`() { + @Test(timeout=300_000) + fun `persistent state survives node restart`() { // Temporary disable this test when executed on Windows. It is known to be sporadically failing. // More investigation is needed to establish why. Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/flows/FlowCheckpointVersionNodeStartupCheckTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/flows/FlowCheckpointVersionNodeStartupCheckTest.kt index af5fb7970b..1e60ce62fb 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/flows/FlowCheckpointVersionNodeStartupCheckTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/flows/FlowCheckpointVersionNodeStartupCheckTest.kt @@ -31,8 +31,8 @@ class FlowCheckpointVersionNodeStartupCheckTest { val defaultCordapp = enclosedCordapp() } - @Test - fun `restart node with mismatch between suspended flow and installed CorDapps`() { + @Test(timeout=300_000) + fun `restart node with mismatch between suspended flow and installed CorDapps`() { driver(DriverParameters( startNodesInProcess = false, inMemoryDB = false, // Ensure database is persisted between node restarts so we can keep suspended flows diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/logging/IssueCashLoggingTests.kt b/node/src/integration-test-slow/kotlin/net/corda/node/logging/IssueCashLoggingTests.kt index 9653b60f56..f07e564913 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/logging/IssueCashLoggingTests.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/logging/IssueCashLoggingTests.kt @@ -18,8 +18,8 @@ import java.io.File class IssueCashLoggingTests { - @Test - fun `issuing and sending cash as payment do not result in duplicate insertion warnings`() { + @Test(timeout=300_000) + fun `issuing and sending cash as payment do not result in duplicate insertion warnings`() { val user = User("mark", "dadada", setOf(all())) driver(DriverParameters(cordappsForAllNodes = FINANCE_CORDAPPS)) { val nodeA = startNode(rpcUsers = listOf(user)).getOrThrow() diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/persistence/NodeStatePersistenceTests.kt b/node/src/integration-test-slow/kotlin/net/corda/node/persistence/NodeStatePersistenceTests.kt index 19025508be..a05e93bffa 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/persistence/NodeStatePersistenceTests.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/persistence/NodeStatePersistenceTests.kt @@ -31,8 +31,8 @@ import kotlin.test.assertEquals import kotlin.test.assertNotNull class NodeStatePersistenceTests { - @Test - fun `persistent state survives node restart`() { + @Test(timeout=300_000) + fun `persistent state survives node restart`() { val user = User("mark", "dadada", setOf(Permissions.startFlow(), Permissions.invokeRpc("vaultQuery"))) val message = Message("Hello world!") val stateAndRef: StateAndRef? = driver(DriverParameters( @@ -63,8 +63,8 @@ class NodeStatePersistenceTests { assertEquals(message, retrievedMessage) } - @Test - fun `persistent state survives node restart without reinitialising database schema`() { + @Test(timeout=300_000) + fun `persistent state survives node restart without reinitialising database schema`() { // Temporary disable this test when executed on Windows. It is known to be sporadically failing. // More investigation is needed to establish why. Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/services/distributed/DistributedServiceTests.kt b/node/src/integration-test-slow/kotlin/net/corda/node/services/distributed/DistributedServiceTests.kt index 82eaec0d59..9a6c22ab20 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/services/distributed/DistributedServiceTests.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/services/distributed/DistributedServiceTests.kt @@ -81,8 +81,8 @@ class DistributedServiceTests { } // TODO This should be in RaftNotaryServiceTests - @Test - fun `cluster survives if a notary is killed`() { + @Test(timeout=300_000) + fun `cluster survives if a notary is killed`() { setup { // Issue 100 pounds, then pay ourselves 10x5 pounds issueCash(100.POUNDS) @@ -119,15 +119,15 @@ class DistributedServiceTests { // TODO Use a dummy distributed service rather than a Raft Notary Service as this test is only about Artemis' ability // to handle distributed services - @Test - fun `requests are distributed evenly amongst the nodes`() { + @Test(timeout=300_000) + fun `requests are distributed evenly amongst the nodes`() { setup { checkRequestsDistributedEvenly() } } - @Test - fun `requests are distributed evenly amongst the nodes with a composite public key`() { + @Test(timeout=300_000) + fun `requests are distributed evenly amongst the nodes with a composite public key`() { setup(true) { checkRequestsDistributedEvenly() } diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/services/rpc/RpcReconnectTests.kt b/node/src/integration-test-slow/kotlin/net/corda/node/services/rpc/RpcReconnectTests.kt index 9efd987260..9ec17b4bf8 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/services/rpc/RpcReconnectTests.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/services/rpc/RpcReconnectTests.kt @@ -75,8 +75,8 @@ class RpcReconnectTests { * This test runs flows in a loop and in the background kills the node or restarts it. * Also the RPC connection is made through a proxy that introduces random latencies and is also periodically killed. */ - @Test - fun `test that the RPC client is able to reconnect and proceed after node failure, restart, or connection reset`() { + @Test(timeout=300_000) + fun `test that the RPC client is able to reconnect and proceed after node failure, restart, or connection reset`() { val nodeRunningTime = { Random().nextInt(12000) + 8000 } val demoUser = User("demo", "demo", setOf(Permissions.all())) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineFinalityErrorHandlingTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineFinalityErrorHandlingTest.kt index b9c7c34c0a..1855aa11c3 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineFinalityErrorHandlingTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineFinalityErrorHandlingTest.kt @@ -33,8 +33,8 @@ class StatemachineFinalityErrorHandlingTest : StatemachineErrorHandlingTest() { * Only the responding node keeps a checkpoint. The initiating flow has completed successfully as it has complete its * send to the responding node and the responding node successfully received it. */ - @Test - fun `error recording a transaction inside of ReceiveFinalityFlow will keep the flow in for observation`() { + @Test(timeout=300_000) + fun `error recording a transaction inside of ReceiveFinalityFlow will keep the flow in for observation`() { startDriver(notarySpec = NotarySpec(DUMMY_NOTARY_NAME, validating = false)) { val charlie = createBytemanNode(CHARLIE_NAME, FINANCE_CORDAPPS) val alice = createNode(ALICE_NAME, FINANCE_CORDAPPS) @@ -104,8 +104,8 @@ class StatemachineFinalityErrorHandlingTest : StatemachineErrorHandlingTest() { * Only the responding node keeps a checkpoint. The initiating flow has completed successfully as it has complete its * send to the responding node and the responding node successfully received it. */ - @Test - fun `error resolving a transaction's dependencies inside of ReceiveFinalityFlow will keep the flow in for observation`() { + @Test(timeout=300_000) + fun `error resolving a transaction's dependencies inside of ReceiveFinalityFlow will keep the flow in for observation`() { startDriver(notarySpec = NotarySpec(DUMMY_NOTARY_NAME, validating = false)) { val charlie = createBytemanNode(CHARLIE_NAME, FINANCE_CORDAPPS) val alice = createNode(ALICE_NAME, FINANCE_CORDAPPS) @@ -177,8 +177,8 @@ class StatemachineFinalityErrorHandlingTest : StatemachineErrorHandlingTest() { * The [StaffedFlowHospital.TransitionErrorGeneralPractitioner] catches these errors instead of the [StaffedFlowHospital.FinalityDoctor]. Due to this, the * flow is retried instead of moving straight to observation. */ - @Test - fun `error during transition with CommitTransaction action while receiving a transaction inside of ReceiveFinalityFlow will be retried and complete successfully`() { + @Test(timeout=300_000) + fun `error during transition with CommitTransaction action while receiving a transaction inside of ReceiveFinalityFlow will be retried and complete successfully`() { startDriver(notarySpec = NotarySpec(DUMMY_NOTARY_NAME, validating = false)) { val charlie = createBytemanNode(CHARLIE_NAME, FINANCE_CORDAPPS) val alice = createNode(ALICE_NAME, FINANCE_CORDAPPS) @@ -272,8 +272,8 @@ class StatemachineFinalityErrorHandlingTest : StatemachineErrorHandlingTest() { * The [StaffedFlowHospital.TransitionErrorGeneralPractitioner] catches these errors instead of the [StaffedFlowHospital.FinalityDoctor]. Due to this, the * flow is retried instead of moving straight to observation. */ - @Test - fun `error during transition with CommitTransaction action while receiving a transaction inside of ReceiveFinalityFlow will be retried and be kept for observation is error persists`() { + @Test(timeout=300_000) + fun `error during transition with CommitTransaction action while receiving a transaction inside of ReceiveFinalityFlow will be retried and be kept for observation is error persists`() { startDriver(notarySpec = NotarySpec(DUMMY_NOTARY_NAME, validating = false)) { val charlie = createBytemanNode(CHARLIE_NAME, FINANCE_CORDAPPS) val alice = createNode(ALICE_NAME, FINANCE_CORDAPPS) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineGeneralErrorHandlingTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineGeneralErrorHandlingTest.kt index e73e345e50..8308328827 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineGeneralErrorHandlingTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineGeneralErrorHandlingTest.kt @@ -25,8 +25,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * This causes the transition to be discharged from the hospital 3 times (retries 3 times) and is then kept in * the hospital for observation. */ - @Test - fun `error during transition with SendInitial action is retried 3 times and kept for observation if error persists`() { + @Test(timeout=300_000) + fun `error during transition with SendInitial action is retried 3 times and kept for observation if error persists`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -105,8 +105,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * This causes the transition to be discharged from the hospital 3 times (retries 3 times). On the final retry the transition * succeeds and the flow finishes. */ - @Test - fun `error during transition with SendInitial action that does not persist will retry and complete successfully`() { + @Test(timeout=300_000) + fun `error during transition with SendInitial action that does not persist will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -185,8 +185,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * The exceptions should be swallowed. Therefore there should be no trips to the hospital and no retries. * The flow should complete successfully as the error is swallowed. */ - @Test - fun `error during transition with AcknowledgeMessages action is swallowed and flow completes successfully`() { + @Test(timeout=300_000) + fun `error during transition with AcknowledgeMessages action is swallowed and flow completes successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -270,8 +270,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to * verify that 3 retries are attempted before recovering. */ - @Test - fun `error during transition with CommitTransaction action that occurs during the beginning of execution will retry and complete successfully`() { + @Test(timeout=300_000) + fun `error during transition with CommitTransaction action that occurs during the beginning of execution will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -356,8 +356,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * * CORDA-3352 - it is currently hanging after putting the flow in for observation */ - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `error during transition with CommitTransaction action that occurs during the beginning of execution will retry and be kept for observation if error persists`() { startDriver { val charlie = createNode(CHARLIE_NAME) @@ -443,8 +443,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to * verify that 3 retries are attempted before recovering. */ - @Test - fun `error during transition with CommitTransaction action that occurs after the first suspend will retry and complete successfully`() { + @Test(timeout=300_000) + fun `error during transition with CommitTransaction action that occurs after the first suspend will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -540,8 +540,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * * Each time the flow retries, it begins from the previous checkpoint where it suspended before failing. */ - @Test - fun `error during transition with CommitTransaction action that occurs when completing a flow and deleting its checkpoint will retry and complete successfully`() { + @Test(timeout=300_000) + fun `error during transition with CommitTransaction action that occurs when completing a flow and deleting its checkpoint will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -629,8 +629,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * The flow is discharged and replayed from the hospital once. After failing during the replay, the flow is forced into overnight * observation. It is not ran again after this point */ - @Test - fun `error during retry of a flow will force the flow into overnight observation`() { + @Test(timeout=300_000) + fun `error during retry of a flow will force the flow into overnight observation`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -729,8 +729,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * flow will still finish successfully. This is due to the even being scheduled as part of the retry and the failure in the database * commit occurs after this point. As the flow is already scheduled, the failure has not affect on it. */ - @Test - fun `error during commit transaction action when retrying a flow will retry the flow again and complete successfully`() { + @Test(timeout=300_000) + fun `error during commit transaction action when retrying a flow will retry the flow again and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -828,8 +828,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * CORDA-3352 - it is currently hanging after putting the flow in for observation * */ - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `error during retrying a flow that failed when committing its original checkpoint will force the flow into overnight observation`() { startDriver { val charlie = createNode(CHARLIE_NAME) @@ -910,8 +910,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * * Each time the flow retries, it begins from the previous checkpoint where it suspended before failing. */ - @Test - fun `error during transition with CommitTransaction action and ConstraintViolationException that occurs when completing a flow will retry and be kept for observation if error persists`() { + @Test(timeout=300_000) + fun `error during transition with CommitTransaction action and ConstraintViolationException that occurs when completing a flow will retry and be kept for observation if error persists`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -1009,8 +1009,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to verify * that 3 retries are attempted before recovering. */ - @Test - fun `responding flow - error during transition with CommitTransaction action that occurs during the beginning of execution will retry and complete successfully`() { + @Test(timeout=300_000) + fun `responding flow - error during transition with CommitTransaction action that occurs during the beginning of execution will retry and complete successfully`() { startDriver { val charlie = createBytemanNode(CHARLIE_NAME) val alice = createNode(ALICE_NAME) @@ -1104,8 +1104,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * able to recover when the node is restarted (by using the events). The initiating flow maintains the checkpoint as it is waiting for * the responding flow to recover and finish its flow. */ - @Test - fun `responding flow - error during transition with CommitTransaction action that occurs during the beginning of execution will retry and be kept for observation if error persists`() { + @Test(timeout=300_000) + fun `responding flow - error during transition with CommitTransaction action that occurs during the beginning of execution will retry and be kept for observation if error persists`() { startDriver { val charlie = createBytemanNode(CHARLIE_NAME) val alice = createNode(ALICE_NAME) @@ -1192,8 +1192,8 @@ class StatemachineGeneralErrorHandlingTest : StatemachineErrorHandlingTest() { * This causes the transition to be discharged from the hospital 3 times (retries 3 times). On the final retry the transition * succeeds and the flow finishes. */ - @Test - fun `responding flow - error during transition with CommitTransaction action that occurs when completing a flow and deleting its checkpoint will retry and complete successfully`() { + @Test(timeout=300_000) + fun `responding flow - error during transition with CommitTransaction action that occurs when completing a flow and deleting its checkpoint will retry and complete successfully`() { startDriver { val charlie = createBytemanNode(CHARLIE_NAME) val alice = createNode(ALICE_NAME) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineKillFlowErrorHandlingTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineKillFlowErrorHandlingTest.kt index f0a68a8ac7..6e4f7bf2d8 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineKillFlowErrorHandlingTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineKillFlowErrorHandlingTest.kt @@ -30,8 +30,8 @@ class StatemachineKillFlowErrorHandlingTest : StatemachineErrorHandlingTest() { * * No pass through the hospital is recorded. As the flow is marked as `isRemoved`. */ - @Test - fun `error during transition due to an InterruptedException (killFlow) will terminate the flow`() { + @Test(timeout=300_000) + fun `error during transition due to an InterruptedException (killFlow) will terminate the flow`() { startDriver { val alice = createBytemanNode(ALICE_NAME) @@ -116,8 +116,8 @@ class StatemachineKillFlowErrorHandlingTest : StatemachineErrorHandlingTest() { * * No pass through the hospital is recorded. As the flow is marked as `isRemoved`. */ - @Test - fun `flow killed during user code execution stops and removes the flow correctly`() { + @Test(timeout=300_000) + fun `flow killed during user code execution stops and removes the flow correctly`() { startDriver { val alice = createBytemanNode(ALICE_NAME) @@ -199,8 +199,8 @@ class StatemachineKillFlowErrorHandlingTest : StatemachineErrorHandlingTest() { * Killing the flow does not lead to any passes through the hospital. All the recorded passes through the hospital are * from the original flow that was put in for observation. */ - @Test - fun `flow killed when it is in the flow hospital for observation is removed correctly`() { + @Test(timeout=300_000) + fun `flow killed when it is in the flow hospital for observation is removed correctly`() { startDriver { val alice = createBytemanNode(ALICE_NAME) val charlie = createNode(CHARLIE_NAME) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineSubflowErrorHandlingTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineSubflowErrorHandlingTest.kt index 4c55655e69..fd491eab97 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineSubflowErrorHandlingTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineSubflowErrorHandlingTest.kt @@ -37,8 +37,8 @@ class StatemachineSubflowErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to verify * that 3 retries are attempted before recovering. */ - @Test - fun `initiating subflow - error during transition with CommitTransaction action that occurs during the first send will retry and complete successfully`() { + @Test(timeout=300_000) + fun `initiating subflow - error during transition with CommitTransaction action that occurs during the first send will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -147,8 +147,8 @@ class StatemachineSubflowErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to verify * that 3 retries are attempted before recovering. */ - @Test - fun `initiating subflow - error during transition with CommitTransaction action that occurs after the first receive will retry and complete successfully`() { + @Test(timeout=300_000) + fun `initiating subflow - error during transition with CommitTransaction action that occurs after the first receive will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -249,8 +249,8 @@ class StatemachineSubflowErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to verify * that 3 retries are attempted before recovering. */ - @Test - fun `inline subflow - error during transition with CommitTransaction action that occurs during the first send will retry and complete successfully`() { + @Test(timeout=300_000) + fun `inline subflow - error during transition with CommitTransaction action that occurs during the first send will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) @@ -343,8 +343,8 @@ class StatemachineSubflowErrorHandlingTest : StatemachineErrorHandlingTest() { * if an error transition moves into another error transition. The flow still recovers from this state. 5 exceptions were thrown to verify * that 3 retries are attempted before recovering. */ - @Test - fun `inline subflow - error during transition with CommitTransaction action that occurs during the first receive will retry and complete successfully`() { + @Test(timeout=300_000) + fun `inline subflow - error during transition with CommitTransaction action that occurs during the first receive will retry and complete successfully`() { startDriver { val charlie = createNode(CHARLIE_NAME) val alice = createBytemanNode(ALICE_NAME) diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt index 20bd039032..b2e24591d7 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt @@ -73,8 +73,8 @@ class NodeRegistrationTest { server.close() } - @Test - fun `node registration correct root cert`() { + @Test(timeout=300_000) + fun `node registration correct root cert`() { val compatibilityZone = SharedCompatibilityZoneParams( URL("http://$serverHostAndPort"), null, diff --git a/node/src/integration-test-slow/kotlin/net/corda/services/vault/VaultRestartTest.kt b/node/src/integration-test-slow/kotlin/net/corda/services/vault/VaultRestartTest.kt index 86e48b79c3..c8ab9710e0 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/services/vault/VaultRestartTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/services/vault/VaultRestartTest.kt @@ -18,8 +18,8 @@ import org.junit.Test class VaultRestartTest { - @Test - fun `restart and query vault after adding some cash states`() { + @Test(timeout=300_000) + fun `restart and query vault after adding some cash states`() { driver(DriverParameters(inMemoryDB = false, startNodesInProcess = false, isDebug = true, extraCordappPackagesToScan = listOf("net.corda.finance", "migration"))) { val node = startNode(providedName = DUMMY_BANK_A_NAME, customOverrides = mapOf("p2pAddress" to "localhost:30000")).getOrThrow() diff --git a/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintGatingTests.kt b/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintGatingTests.kt index ae1ca0ec72..b1bb931718 100644 --- a/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintGatingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintGatingTests.kt @@ -21,8 +21,8 @@ class SignatureConstraintGatingTests { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `signature constraints can be used with up to the maximum allowed number of (RSA) keys`() { + @Test(timeout=300_000) + fun `signature constraints can be used with up to the maximum allowed number of (RSA) keys`() { tempFolder.root.toPath().let {path -> val financeCordapp = cordappWithPackages("net.corda.finance.contracts", "net.corda.finance.schemas") .signed(keyStorePath = path, numberOfSignatures = 20, keyAlgorithm = "RSA") @@ -41,8 +41,8 @@ class SignatureConstraintGatingTests { } } - @Test - fun `signature constraints can be used with up to the maximum allowed number of (EC) keys`() { + @Test(timeout=300_000) + fun `signature constraints can be used with up to the maximum allowed number of (EC) keys`() { tempFolder.root.toPath().let {path -> val financeCordapp = cordappWithPackages("net.corda.finance.contracts", "net.corda.finance.schemas") .signed(keyStorePath = path, numberOfSignatures = 20, keyAlgorithm = "EC") @@ -61,8 +61,8 @@ class SignatureConstraintGatingTests { } } - @Test - fun `signature constraints cannot be used with more than the maximum allowed number of keys`() { + @Test(timeout=300_000) + fun `signature constraints cannot be used with more than the maximum allowed number of keys`() { tempFolder.root.toPath().let {path -> val financeCordapp = cordappWithPackages("net.corda.finance.contracts", "net.corda.finance.schemas") .signed(keyStorePath = path, numberOfSignatures = 21) diff --git a/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromHashConstraintsTests.kt b/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromHashConstraintsTests.kt index 9fe1ee7183..bcee8d3c11 100644 --- a/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromHashConstraintsTests.kt +++ b/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromHashConstraintsTests.kt @@ -21,8 +21,8 @@ import kotlin.test.assertTrue open class SignatureConstraintMigrationFromHashConstraintsTests : SignatureConstraintVersioningTests() { - @Test - fun `can evolve from lower contract class version to higher one`() { + @Test(timeout=300_000) + fun `can evolve from lower contract class version to higher one`() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val stateAndRef: StateAndRef? = internalDriver( @@ -68,8 +68,8 @@ open class SignatureConstraintMigrationFromHashConstraintsTests : SignatureConst assertEquals(transformedMessage, stateAndRef!!.state.data.message) } - @Test - fun `auto migration from HashConstraint to SignatureConstraint`() { + @Test(timeout=300_000) + fun `auto migration from HashConstraint to SignatureConstraint`() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, @@ -84,8 +84,8 @@ open class SignatureConstraintMigrationFromHashConstraintsTests : SignatureConst assertTrue(consumingTransaction.outputs.single().constraint is SignatureAttachmentConstraint) } - @Test - fun `HashConstraint cannot be migrated if 'disableHashConstraints' system property is not set to true`() { + @Test(timeout=300_000) + fun `HashConstraint cannot be migrated if 'disableHashConstraints' system property is not set to true`() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, @@ -100,8 +100,8 @@ open class SignatureConstraintMigrationFromHashConstraintsTests : SignatureConst assertTrue(consumingTransaction.outputs.single().constraint is HashAttachmentConstraint) } - @Test - fun `HashConstraint cannot be migrated to SignatureConstraint if new jar is not signed`() { + @Test(timeout=300_000) + fun `HashConstraint cannot be migrated to SignatureConstraint if new jar is not signed`() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, @@ -116,8 +116,8 @@ open class SignatureConstraintMigrationFromHashConstraintsTests : SignatureConst assertTrue(consumingTransaction.outputs.single().constraint is HashAttachmentConstraint) } - @Test - fun `HashConstraint cannot be migrated to SignatureConstraint if platform version is not 4 or greater`() { + @Test(timeout=300_000) + fun `HashConstraint cannot be migrated to SignatureConstraint if platform version is not 4 or greater`() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, @@ -133,8 +133,8 @@ open class SignatureConstraintMigrationFromHashConstraintsTests : SignatureConst assertTrue(consumingTransaction.outputs.single().constraint is HashAttachmentConstraint) } - @Test - fun `HashConstraint cannot be migrated to SignatureConstraint if a HashConstraint is specified for one state and another uses an AutomaticPlaceholderConstraint`() { + @Test(timeout=300_000) + fun `HashConstraint cannot be migrated to SignatureConstraint if a HashConstraint is specified for one state and another uses an AutomaticPlaceholderConstraint`() { assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, diff --git a/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromWhitelistConstraintTests.kt b/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromWhitelistConstraintTests.kt index 7f896680a7..c3e0688548 100644 --- a/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromWhitelistConstraintTests.kt +++ b/node/src/integration-test/kotlin/net/corda/contracts/SignatureConstraintMigrationFromWhitelistConstraintTests.kt @@ -24,8 +24,8 @@ import kotlin.test.assertTrue open class SignatureConstraintMigrationFromWhitelistConstraintTests : SignatureConstraintVersioningTests() { - @Test - fun `can evolve from lower contract class version to higher one`() { + @Test(timeout=300_000) + fun `can evolve from lower contract class version to higher one`() { Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val stateAndRef: StateAndRef? = internalDriver( @@ -71,8 +71,8 @@ open class SignatureConstraintMigrationFromWhitelistConstraintTests : Signature assertEquals(transformedMessage, stateAndRef!!.state.data.message) } - @Test - fun `auto migration from WhitelistConstraint to SignatureConstraint`() { + @Test(timeout=300_000) + fun `auto migration from WhitelistConstraint to SignatureConstraint`() { Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, @@ -92,8 +92,8 @@ open class SignatureConstraintMigrationFromWhitelistConstraintTests : Signature assertTrue(consumingTransaction.outputs.single().constraint is SignatureAttachmentConstraint) } - @Test - fun `WhitelistConstraint cannot be migrated to SignatureConstraint if platform version is not 4 or greater`() { + @Test(timeout=300_000) + fun `WhitelistConstraint cannot be migrated to SignatureConstraint if platform version is not 4 or greater`() { Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, @@ -114,8 +114,8 @@ open class SignatureConstraintMigrationFromWhitelistConstraintTests : Signature assertTrue(consumingTransaction.outputs.single().constraint is WhitelistedByZoneAttachmentConstraint) } - @Test - fun `WhitelistConstraint cannot be migrated to SignatureConstraint if signed JAR is not whitelisted`() { + @Test(timeout=300_000) + fun `WhitelistConstraint cannot be migrated to SignatureConstraint if signed JAR is not whitelisted`() { Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. Assertions.assertThatExceptionOfType(CordaRuntimeException::class.java).isThrownBy { upgradeCorDappBetweenTransactions( @@ -129,8 +129,8 @@ open class SignatureConstraintMigrationFromWhitelistConstraintTests : Signature .withMessageContaining("Selected output constraint: $WhitelistedByZoneAttachmentConstraint not satisfying") } - @Test - fun `auto migration from WhitelistConstraint to SignatureConstraint will only transition states that do not have a constraint specified`() { + @Test(timeout=300_000) + fun `auto migration from WhitelistConstraint to SignatureConstraint will only transition states that do not have a constraint specified`() { Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win")) // See NodeStatePersistenceTests.kt. val (issuanceTransaction, consumingTransaction) = upgradeCorDappBetweenTransactions( cordapp = oldUnsignedCordapp, diff --git a/node/src/integration-test/kotlin/net/corda/node/AddressBindingFailureTests.kt b/node/src/integration-test/kotlin/net/corda/node/AddressBindingFailureTests.kt index 283f450fd8..0bef72552d 100644 --- a/node/src/integration-test/kotlin/net/corda/node/AddressBindingFailureTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/AddressBindingFailureTests.kt @@ -20,20 +20,20 @@ class AddressBindingFailureTests { private val portAllocation = incrementalPortAllocation() } - @Test - fun `p2p address`() = assertBindExceptionForOverrides { address -> mapOf("p2pAddress" to address.toString()) } + @Test(timeout=300_000) + fun `p2p address`() = assertBindExceptionForOverrides { address -> mapOf("p2pAddress" to address.toString()) } - @Test - fun `rpc address`() = assertBindExceptionForOverrides { address -> mapOf("rpcSettings" to mapOf("address" to address.toString())) } + @Test(timeout=300_000) + fun `rpc address`() = assertBindExceptionForOverrides { address -> mapOf("rpcSettings" to mapOf("address" to address.toString())) } - @Test - fun `rpc admin address`() = assertBindExceptionForOverrides { address -> mapOf("rpcSettings" to mapOf("adminAddress" to address.toString())) } + @Test(timeout=300_000) + fun `rpc admin address`() = assertBindExceptionForOverrides { address -> mapOf("rpcSettings" to mapOf("adminAddress" to address.toString())) } - @Test - fun `H2 address`() = assertBindExceptionForOverrides { address -> mapOf("h2Settings" to mapOf("address" to address.toString()), "dataSourceProperties.dataSource.password" to "password") } + @Test(timeout=300_000) + fun `H2 address`() = assertBindExceptionForOverrides { address -> mapOf("h2Settings" to mapOf("address" to address.toString()), "dataSourceProperties.dataSource.password" to "password") } - @Test - fun `notary P2P address`() { + @Test(timeout=300_000) + fun `notary P2P address`() { ServerSocket(0).use { socket -> val notaryName = CordaX500Name.parse("O=Notary Cleaning Service, L=Zurich, C=CH") diff --git a/node/src/integration-test/kotlin/net/corda/node/AuthDBTests.kt b/node/src/integration-test/kotlin/net/corda/node/AuthDBTests.kt index a901718f05..70293b6074 100644 --- a/node/src/integration-test/kotlin/net/corda/node/AuthDBTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/AuthDBTests.kt @@ -97,13 +97,13 @@ class AuthDBTests : NodeBasedTest() { client = CordaRPCClient(node.node.configuration.rpcOptions.address) } - @Test - fun `login with correct credentials`() { + @Test(timeout=300_000) + fun `login with correct credentials`() { client.start("user", "foo").close() } - @Test - fun `login with wrong credentials`() { + @Test(timeout=300_000) + fun `login with wrong credentials`() { client.start("user", "foo").close() assertFailsWith( ActiveMQSecurityException::class, @@ -117,8 +117,8 @@ class AuthDBTests : NodeBasedTest() { } } - @Test - fun `check flow permissions are respected`() { + @Test(timeout=300_000) + fun `check flow permissions are respected`() { client.start("user", "foo").use { val proxy = it.proxy proxy.startFlowDynamic(DummyFlow::class.java) @@ -137,8 +137,8 @@ class AuthDBTests : NodeBasedTest() { } } - @Test - fun `check permissions on RPC calls are respected`() { + @Test(timeout=300_000) + fun `check permissions on RPC calls are respected`() { client.start("user", "foo").use { val proxy = it.proxy proxy.stateMachinesFeed() @@ -150,8 +150,8 @@ class AuthDBTests : NodeBasedTest() { } } - @Test - fun `Add new users dynamically`() { + @Test(timeout=300_000) + fun `Add new users dynamically`() { assertFailsWith( ActiveMQSecurityException::class, "Login with incorrect password should fail") { @@ -166,8 +166,8 @@ class AuthDBTests : NodeBasedTest() { client.start("user2", "bar").close() } - @Test - fun `Modify user permissions during RPC session`() { + @Test(timeout=300_000) + fun `Modify user permissions during RPC session`() { db.insert(UserAndRoles( username = "user3", password = encodePassword("bar"), @@ -186,8 +186,8 @@ class AuthDBTests : NodeBasedTest() { } } - @Test - fun `Revoke user permissions during RPC session`() { + @Test(timeout=300_000) + fun `Revoke user permissions during RPC session`() { db.insert(UserAndRoles( username = "user4", password = encodePassword("test"), diff --git a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt index 2ba2009537..711d34a7f9 100644 --- a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt @@ -32,8 +32,8 @@ import kotlin.test.assertEquals import kotlin.test.assertTrue class BootTests { - @Test - fun `java deserialization is disabled`() { + @Test(timeout=300_000) + fun `java deserialization is disabled`() { val user = User("u", "p", setOf(startFlow())) val devParams = NodeParameters(providedName = BOB_NAME, rpcUsers = listOf(user)) val params = NodeParameters(rpcUsers = listOf(user)) @@ -53,8 +53,8 @@ class BootTests { } } - @Test - fun `double node start doesn't write into log file`() { + @Test(timeout=300_000) + fun `double node start doesn't write into log file`() { driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { val alice = startNode(providedName = ALICE_NAME).get() val logFolder = alice.baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME @@ -69,8 +69,8 @@ class BootTests { } } - @Test - fun `node fails to start if legal identity is lost`() { + @Test(timeout=300_000) + fun `node fails to start if legal identity is lost`() { driver(DriverParameters( notarySpecs = emptyList(), inMemoryDB = false, diff --git a/node/src/integration-test/kotlin/net/corda/node/ContractWithCordappFixupTest.kt b/node/src/integration-test/kotlin/net/corda/node/ContractWithCordappFixupTest.kt index 24f4f43f30..50e5b1b1bd 100644 --- a/node/src/integration-test/kotlin/net/corda/node/ContractWithCordappFixupTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/ContractWithCordappFixupTest.kt @@ -56,8 +56,8 @@ class ContractWithCordappFixupTest { /* * Test that we can still build a transaction for a CorDapp with an implicit dependency. */ - @Test - fun `flow with missing cordapp dependency with fixup`() { + @Test(timeout=300_000) + fun `flow with missing cordapp dependency with fixup`() { val dependentContractId = dependentContractCorDapp.jarFile.hash val standaloneContractId = standaloneContractCorDapp.jarFile.hash val fixupCorDapp = cordappWithFixups(listOf( @@ -81,8 +81,8 @@ class ContractWithCordappFixupTest { /** * Test that our dependency is indeed missing and so requires fixing up. */ - @Test - fun `flow with missing cordapp dependency without fixup`() { + @Test(timeout=300_000) + fun `flow with missing cordapp dependency without fixup`() { driver(driverParameters(listOf(flowCorDapp, dependentContractCorDapp, standaloneContractCorDapp))) { val alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() val ex = assertFailsWith { diff --git a/node/src/integration-test/kotlin/net/corda/node/ContractWithCustomSerializerTest.kt b/node/src/integration-test/kotlin/net/corda/node/ContractWithCustomSerializerTest.kt index 44a1640502..d55787148f 100644 --- a/node/src/integration-test/kotlin/net/corda/node/ContractWithCustomSerializerTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/ContractWithCustomSerializerTest.kt @@ -32,8 +32,8 @@ class ContractWithCustomSerializerTest { } } - @Test - fun `flow with custom serializer by rpc`() { + @Test(timeout=300_000) + fun `flow with custom serializer by rpc`() { val user = User("u", "p", setOf(Permissions.all())) driver(DriverParameters( portAllocation = incrementalPortAllocation(), diff --git a/node/src/integration-test/kotlin/net/corda/node/ContractWithMissingCustomSerializerTest.kt b/node/src/integration-test/kotlin/net/corda/node/ContractWithMissingCustomSerializerTest.kt index 84c568787c..0c4d5984fe 100644 --- a/node/src/integration-test/kotlin/net/corda/node/ContractWithMissingCustomSerializerTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/ContractWithMissingCustomSerializerTest.kt @@ -56,8 +56,8 @@ class ContractWithMissingCustomSerializerTest { /* * Test that we can still verify a transaction that is missing a custom serializer. */ - @Test - fun `flow with missing custom serializer and fixup`() { + @Test(timeout=300_000) + fun `flow with missing custom serializer and fixup`() { val contractId = contractCorDapp.jarFile.hash val flowId = flowCorDapp.jarFile.hash val fixupCorDapp = cordappWithFixups(listOf(setOf(contractId) to setOf(contractId, flowId))).signed() @@ -81,8 +81,8 @@ class ContractWithMissingCustomSerializerTest { /* * Test we fail properly when we cannot fix-up a missing serializer. */ - @Test - fun `flow with missing custom serializer but without fixup`() { + @Test(timeout=300_000) + fun `flow with missing custom serializer but without fixup`() { driver(driverParameters(listOf(flowCorDapp, contractCorDapp))) { val alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() val ex = assertFailsWith { @@ -102,8 +102,8 @@ class ContractWithMissingCustomSerializerTest { * Test that TransactionBuilder prevents us from creating a * transaction that has a custom serializer missing. */ - @Test - fun `transaction builder flow with missing custom serializer by rpc`() { + @Test(timeout=300_000) + fun `transaction builder flow with missing custom serializer by rpc`() { driver(driverParameters(listOf(flowCorDapp, contractCorDapp))) { val alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() val ex = assertFailsWith { diff --git a/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt b/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt index e4f74ca07b..44205c956b 100644 --- a/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt @@ -45,8 +45,8 @@ class CordappConstraintsTests { val SIGNED_FINANCE_CORDAPP = UNSIGNED_FINANCE_CORDAPP.signed() } - @Test - fun `issue cash using signature constraints`() { + @Test(timeout=300_000) + fun `issue cash using signature constraints`() { driver(DriverParameters( networkParameters = testNetworkParameters(minimumPlatformVersion = 4), cordappsForAllNodes = emptyList(), @@ -72,8 +72,8 @@ class CordappConstraintsTests { } } - @Test - fun `issue cash using hash and signature constraints`() { + @Test(timeout=300_000) + fun `issue cash using hash and signature constraints`() { driver(DriverParameters( networkParameters = testNetworkParameters(minimumPlatformVersion = 4), cordappsForAllNodes = emptyList(), @@ -129,8 +129,8 @@ class CordappConstraintsTests { } } - @Test - fun `issue and consume cash using hash constraints`() { + @Test(timeout=300_000) + fun `issue and consume cash using hash constraints`() { driver(DriverParameters( cordappsForAllNodes = listOf(UNSIGNED_FINANCE_CORDAPP), networkParameters = testNetworkParameters(minimumPlatformVersion = 4), @@ -189,8 +189,8 @@ class CordappConstraintsTests { } } - @Test - fun `issue and consume cash using signature constraints`() { + @Test(timeout=300_000) + fun `issue and consume cash using signature constraints`() { driver(DriverParameters( cordappsForAllNodes = listOf(SIGNED_FINANCE_CORDAPP), networkParameters = testNetworkParameters(minimumPlatformVersion = 4), @@ -249,8 +249,8 @@ class CordappConstraintsTests { } } - @Test - @Ignore // TODO(mike): rework + @Test(timeout=300_000) +@Ignore // TODO(mike): rework fun `issue cash and transfer using hash to signature constraints migration`() { // signing key setup val keyStoreDir = SelfCleaningDir() diff --git a/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt b/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt index d437e16527..b594b1e623 100644 --- a/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/CordappScanningDriverTest.kt @@ -19,8 +19,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.Test class CordappScanningDriverTest { - @Test - fun `sub-classed initiated flow pointing to the same initiating flow as its super-class`() { + @Test(timeout=300_000) + fun `sub-classed initiated flow pointing to the same initiating flow as its super-class`() { val user = User("u", "p", setOf(startFlow())) // The driver will automatically pick up the annotated flows below driver(DriverParameters(notarySpecs = emptyList())) { diff --git a/node/src/integration-test/kotlin/net/corda/node/NodeConfigParsingTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodeConfigParsingTests.kt index 8085b9c3d6..fd2f7d7507 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodeConfigParsingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodeConfigParsingTests.kt @@ -13,8 +13,8 @@ import org.junit.Assert.assertTrue class NodeConfigParsingTests { - @Test - fun `config is overriden by underscore variable`() { + @Test(timeout=300_000) + fun `config is overriden by underscore variable`() { val portAllocator = incrementalPortAllocation() val sshPort = portAllocator.nextPort() @@ -31,8 +31,8 @@ class NodeConfigParsingTests { } } - @Test - fun `config is overriden by case insensitive underscore variable`() { + @Test(timeout=300_000) + fun `config is overriden by case insensitive underscore variable`() { val portAllocator = incrementalPortAllocation() val sshPort = portAllocator.nextPort() @@ -49,8 +49,8 @@ class NodeConfigParsingTests { } } - @Test - fun `config is overriden by case insensitive dot variable`() { + @Test(timeout=300_000) + fun `config is overriden by case insensitive dot variable`() { val portAllocator = incrementalPortAllocation() val sshPort = portAllocator.nextPort() @@ -68,8 +68,8 @@ class NodeConfigParsingTests { } } - @Test - fun `shadowing is forbidden`() { + @Test(timeout=300_000) + fun `shadowing is forbidden`() { val portAllocator = incrementalPortAllocation() val sshPort = portAllocator.nextPort() @@ -87,8 +87,8 @@ class NodeConfigParsingTests { } } - @Test - fun `bad keys are ignored and warned for`() { + @Test(timeout=300_000) + fun `bad keys are ignored and warned for`() { val portAllocator = incrementalPortAllocation() driver(DriverParameters( environmentVariables = mapOf( diff --git a/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt b/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt index 38be65ed66..43640b5860 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt @@ -15,8 +15,8 @@ import org.junit.Test import javax.security.auth.x500.X500Principal class NodeKeystoreCheckTest { - @Test - fun `starting node in non-dev mode with no key store`() { + @Test(timeout=300_000) + fun `starting node in non-dev mode with no key store`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { assertThatThrownBy { startNode(customOverrides = mapOf("devMode" to false)).getOrThrow() @@ -24,8 +24,8 @@ class NodeKeystoreCheckTest { } } - @Test - fun `node should throw exception if cert path does not chain to the trust root`() { + @Test(timeout=300_000) + fun `node should throw exception if cert path does not chain to the trust root`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { // Create keystores. val keystorePassword = "password" diff --git a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt index 0c6ee6c0bf..0dd0ebc872 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt @@ -47,8 +47,8 @@ class NodePerformanceTests { val averageMs: Double ) - @Test - fun `empty flow per second`() { + @Test(timeout=300_000) + fun `empty flow per second`() { driver(DriverParameters(startNodesInProcess = true)) { val a = startNode(rpcUsers = listOf(User("A", "A", setOf(startFlow())))).get() @@ -77,8 +77,8 @@ class NodePerformanceTests { } } - @Test - fun `empty flow rate`() { + @Test(timeout=300_000) + fun `empty flow rate`() { internalDriver(startNodesInProcess = true) { val a = startNode(rpcUsers = listOf(User("A", "A", setOf(startFlow())))).get() a as InProcess @@ -91,8 +91,8 @@ class NodePerformanceTests { } } - @Test - fun `self pay rate`() { + @Test(timeout=300_000) + fun `self pay rate`() { val user = User("A", "A", setOf(startFlow(), startFlow())) internalDriver( notarySpecs = listOf(NotarySpec(DUMMY_NOTARY_NAME, rpcUsers = listOf(user))), diff --git a/node/src/integration-test/kotlin/net/corda/node/NodeRPCTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodeRPCTests.kt index 518dad671a..f59887f803 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodeRPCTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodeRPCTests.kt @@ -22,8 +22,8 @@ class NodeRPCTests { private val CORDAPP_LICENCE = "Open Source (Apache 2)" private val HEXADECIMAL_REGEX = "[0-9a-fA-F]+".toRegex() - @Test - fun `run nodeDiagnosticInfo`() { + @Test(timeout=300_000) + fun `run nodeDiagnosticInfo`() { driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = CORDAPPS, extraCordappPackagesToScan = emptyList())) { val nodeDiagnosticInfo = startNode().get().rpc.nodeDiagnosticInfo() assertTrue(nodeDiagnosticInfo.version.matches(CORDA_VERSION_REGEX)) diff --git a/node/src/integration-test/kotlin/net/corda/node/NodeStartupPerformanceTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodeStartupPerformanceTests.kt index 12c434a69d..d4e2c71f48 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodeStartupPerformanceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodeStartupPerformanceTests.kt @@ -11,8 +11,8 @@ import java.util.concurrent.TimeUnit class NodeStartupPerformanceTests { // Measure the startup time of nodes. Note that this includes an RPC roundtrip, which causes e.g. Kryo initialisation. - @Test - fun `single node startup time`() { + @Test(timeout=300_000) + fun `single node startup time`() { driver { val times = ArrayList() for (i in 1..10) { diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt index fd7a8007df..0bcabb6ad4 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt @@ -47,8 +47,8 @@ class AMQPBridgeTest { private abstract class AbstractNodeConfiguration : NodeConfiguration - @Test - fun `test acked and nacked messages`() { + @Test(timeout=300_000) + fun `test acked and nacked messages`() { // Create local queue val sourceQueueName = "internal.peers." + BOB.publicKey.toStringShort() val (artemisServer, artemisClient, bridgeManager) = createArtemis(sourceQueueName) @@ -168,8 +168,8 @@ class AMQPBridgeTest { artemisServer.stop() } - @Test - fun `bridge with strict CRL checking does not connect to server with invalid certificates`() { + @Test(timeout=300_000) + fun `bridge with strict CRL checking does not connect to server with invalid certificates`() { // Note that the opposite of this test (that a connection is established if strict checking is disabled) is carried out by the // ack/nack test above. "Strict CRL checking" means that soft fail mode is disabled. val sourceQueueName = "internal.peers." + BOB.publicKey.toStringShort() diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt index 13d220cbfb..9512674d01 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt @@ -130,8 +130,8 @@ class CertificateRevocationListNodeTests { revokedNodeCerts.clear() } - @Test - fun `Simple AMPQ Client to Server connection works and soft fail is enabled`() { + @Test(timeout=300_000) + fun `Simple AMPQ Client to Server connection works and soft fail is enabled`() { val crlCheckSoftFail = true val (amqpServer, _) = createServer(serverPort, crlCheckSoftFail = crlCheckSoftFail) amqpServer.use { @@ -162,8 +162,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `Simple AMPQ Client to Server connection works and soft fail is disabled`() { + @Test(timeout=300_000) + fun `Simple AMPQ Client to Server connection works and soft fail is disabled`() { val crlCheckSoftFail = false val (amqpServer, _) = createServer(serverPort, crlCheckSoftFail = crlCheckSoftFail) amqpServer.use { @@ -194,8 +194,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `AMPQ Client to Server connection fails when client's certificate is revoked and soft fail is enabled`() { + @Test(timeout=300_000) + fun `AMPQ Client to Server connection fails when client's certificate is revoked and soft fail is enabled`() { val crlCheckSoftFail = true val (amqpServer, _) = createServer(serverPort, crlCheckSoftFail = crlCheckSoftFail) amqpServer.use { @@ -215,8 +215,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `AMPQ Client to Server connection fails when client's certificate is revoked and soft fail is disabled`() { + @Test(timeout=300_000) + fun `AMPQ Client to Server connection fails when client's certificate is revoked and soft fail is disabled`() { val crlCheckSoftFail = false val (amqpServer, _) = createServer(serverPort, crlCheckSoftFail = crlCheckSoftFail) amqpServer.use { @@ -236,8 +236,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `AMPQ Client to Server connection fails when servers's certificate is revoked`() { + @Test(timeout=300_000) + fun `AMPQ Client to Server connection fails when servers's certificate is revoked`() { val crlCheckSoftFail = true val (amqpServer, serverCert) = createServer(serverPort, crlCheckSoftFail = crlCheckSoftFail) revokedNodeCerts.add(serverCert.serialNumber) @@ -257,8 +257,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `AMPQ Client to Server connection fails when servers's certificate is revoked and soft fail is enabled`() { + @Test(timeout=300_000) + fun `AMPQ Client to Server connection fails when servers's certificate is revoked and soft fail is enabled`() { val crlCheckSoftFail = true val (amqpServer, serverCert) = createServer(serverPort, crlCheckSoftFail = crlCheckSoftFail) revokedNodeCerts.add(serverCert.serialNumber) @@ -278,8 +278,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `AMPQ Client to Server connection succeeds when CRL cannot be obtained and soft fail is enabled`() { + @Test(timeout=300_000) + fun `AMPQ Client to Server connection succeeds when CRL cannot be obtained and soft fail is enabled`() { val crlCheckSoftFail = true val (amqpServer, _) = createServer( serverPort, @@ -304,8 +304,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `Revocation status chceck fails when the CRL distribution point is not set and soft fail is disabled`() { + @Test(timeout=300_000) + fun `Revocation status chceck fails when the CRL distribution point is not set and soft fail is disabled`() { val crlCheckSoftFail = false val (amqpServer, _) = createServer( serverPort, @@ -330,8 +330,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `Revocation status chceck succeds when the CRL distribution point is not set and soft fail is enabled`() { + @Test(timeout=300_000) + fun `Revocation status chceck succeds when the CRL distribution point is not set and soft fail is enabled`() { val crlCheckSoftFail = true val (amqpServer, _) = createServer( serverPort, @@ -570,8 +570,8 @@ class CertificateRevocationListNodeTests { } } - @Test - fun `verify CRL algorithms`() { + @Test(timeout=300_000) + fun `verify CRL algorithms`() { val ECDSA_ALGORITHM = "SHA256withECDSA" val EC_ALGORITHM = "EC" val EMPTY_CRL = "empty.crl" @@ -599,8 +599,8 @@ class CertificateRevocationListNodeTests { }.withMessage("Unknown signature type requested: EC") } - @Test - fun `AMPQ Client to Server connection succeeds when CRL retrieval is forbidden and soft fail is enabled`() { + @Test(timeout=300_000) + fun `AMPQ Client to Server connection succeeds when CRL retrieval is forbidden and soft fail is enabled`() { val crlCheckSoftFail = true val forbiddenUrl = "http://${server.hostAndPort}/crl/$FORBIDDEN_CRL" val (amqpServer, _) = createServer( diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt index 4e30ebe606..0f08714025 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt @@ -56,8 +56,8 @@ class ProtonWrapperTests { private abstract class AbstractNodeConfiguration : NodeConfiguration - @Test - fun `Simple AMPQ Client to Server`() { + @Test(timeout=300_000) + fun `Simple AMPQ Client to Server`() { val amqpServer = createServer(serverPort) amqpServer.use { amqpServer.start() @@ -89,8 +89,8 @@ class ProtonWrapperTests { } } - @Test - fun `AMPQ Client fails to connect when crl soft fail check is disabled`() { + @Test(timeout=300_000) + fun `AMPQ Client fails to connect when crl soft fail check is disabled`() { val amqpServer = createServer(serverPort, maxMessageSize = MAX_MESSAGE_SIZE, crlCheckSoftFail = false) amqpServer.use { amqpServer.start() @@ -104,8 +104,8 @@ class ProtonWrapperTests { } } - @Test - fun `AMPQ Client refuses to connect to unexpected server`() { + @Test(timeout=300_000) + fun `AMPQ Client refuses to connect to unexpected server`() { val amqpServer = createServer(serverPort, CordaX500Name("Rogue 1", "London", "GB")) amqpServer.use { amqpServer.start() @@ -124,8 +124,8 @@ class ProtonWrapperTests { trustStore.get(true)[X509Utilities.CORDA_ROOT_CA] = rootCert } - @Test - fun `Test AMQP Client with invalid root certificate`() { + @Test(timeout=300_000) + fun `Test AMQP Client with invalid root certificate`() { val certificatesDirectory = temporaryFolder.root.toPath() val signingCertificateStore = CertificateStoreStubs.Signing.withCertificatesDirectory(certificatesDirectory, "serverstorepass") val sslConfig = CertificateStoreStubs.P2P.withCertificatesDirectory(certificatesDirectory, keyStorePassword = "serverstorepass") @@ -200,8 +200,8 @@ class ProtonWrapperTests { } - @Test - fun `Client Failover for multiple IP`() { + @Test(timeout=300_000) + fun `Client Failover for multiple IP`() { val amqpServer = createServer(serverPort) val amqpServer2 = createServer(serverPort2) val amqpClient = createClient() @@ -254,8 +254,8 @@ class ProtonWrapperTests { } } - @Test - fun `Send a message from AMQP to Artemis inbox`() { + @Test(timeout=300_000) + fun `Send a message from AMQP to Artemis inbox`() { val (server, artemisClient) = createArtemisServerAndClient() val amqpClient = createClient() val clientConnected = amqpClient.onConnection.toFuture() @@ -280,8 +280,8 @@ class ProtonWrapperTests { server.stop() } - @Test - fun `Send a message larger then maxMessageSize from AMQP to Artemis inbox`() { + @Test(timeout=300_000) + fun `Send a message larger then maxMessageSize from AMQP to Artemis inbox`() { val maxMessageSize = 100_000 val (server, artemisClient) = createArtemisServerAndClient(maxMessageSize) val amqpClient = createClient(maxMessageSize) @@ -326,8 +326,8 @@ class ProtonWrapperTests { server.stop() } - @Test - fun `shared AMQPClient threadpool tests`() { + @Test(timeout=300_000) + fun `shared AMQPClient threadpool tests`() { val amqpServer = createServer(serverPort) amqpServer.use { val connectionEvents = amqpServer.onConnection.toBlocking().iterator @@ -376,8 +376,8 @@ class ProtonWrapperTests { } } - @Test - fun `Message sent from AMQP to non-existent Artemis inbox is rejected and client disconnects`() { + @Test(timeout=300_000) + fun `Message sent from AMQP to non-existent Artemis inbox is rejected and client disconnects`() { val (server, artemisClient) = createArtemisServerAndClient() val amqpClient = createClient() var connected = false diff --git a/node/src/integration-test/kotlin/net/corda/node/flows/FlowOverrideTests.kt b/node/src/integration-test/kotlin/net/corda/node/flows/FlowOverrideTests.kt index fab3bf4f1a..1f9129b13a 100644 --- a/node/src/integration-test/kotlin/net/corda/node/flows/FlowOverrideTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/flows/FlowOverrideTests.kt @@ -65,8 +65,8 @@ class FlowOverrideTests { private val nodeAClasses = setOf(Ping::class.java, Pong::class.java, Pongiest::class.java) private val nodeBClasses = setOf(Ping::class.java, Pong::class.java) - @Test - fun `should use the most specific implementation of a responding flow`() { + @Test(timeout=300_000) + fun `should use the most specific implementation of a responding flow`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptySet())) { val nodeA = startNode(NodeParameters( providedName = ALICE_NAME, @@ -80,8 +80,8 @@ class FlowOverrideTests { } } - @Test - fun `should use the overriden implementation of a responding flow`() { + @Test(timeout=300_000) + fun `should use the overriden implementation of a responding flow`() { val flowOverrides = mapOf(Ping::class.java to Pong::class.java) driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptySet())) { val nodeA = startNode(NodeParameters( diff --git a/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt b/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt index cd76fe9e46..bfd95eb498 100644 --- a/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/flows/FlowRetryTest.kt @@ -60,8 +60,8 @@ class FlowRetryTest { StaffedFlowHospital.DatabaseEndocrinologist.customConditions.clear() } - @Test - fun `flows continue despite errors`() { + @Test(timeout=300_000) + fun `flows continue despite errors`() { val numSessions = 2 val numIterations = 10 val user = User("mark", "dadada", setOf(Permissions.startFlow())) @@ -81,8 +81,8 @@ class FlowRetryTest { assertEquals("$numSessions:$numIterations", result) } - @Test - fun `async operation deduplication id is stable accross retries`() { + @Test(timeout=300_000) + fun `async operation deduplication id is stable accross retries`() { val user = User("mark", "dadada", setOf(Permissions.startFlow())) driver(DriverParameters( startNodesInProcess = isQuasarAgentSpecified(), @@ -96,8 +96,8 @@ class FlowRetryTest { } } - @Test - fun `flow gives up after number of exceptions, even if this is the first line of the flow`() { + @Test(timeout=300_000) + fun `flow gives up after number of exceptions, even if this is the first line of the flow`() { val user = User("mark", "dadada", setOf(Permissions.startFlow())) assertThatExceptionOfType(CordaRuntimeException::class.java).isThrownBy { driver(DriverParameters( @@ -114,8 +114,8 @@ class FlowRetryTest { } } - @Test - fun `flow that throws in constructor throw for the RPC client that attempted to start them`() { + @Test(timeout=300_000) + fun `flow that throws in constructor throw for the RPC client that attempted to start them`() { val user = User("mark", "dadada", setOf(Permissions.startFlow())) assertThatExceptionOfType(CordaRuntimeException::class.java).isThrownBy { driver(DriverParameters( @@ -132,8 +132,8 @@ class FlowRetryTest { } } - @Test - fun `SQLTransientConnectionExceptions thrown by hikari are retried 3 times and then kept in the checkpoints table`() { + @Test(timeout=300_000) + fun `SQLTransientConnectionExceptions thrown by hikari are retried 3 times and then kept in the checkpoints table`() { val user = User("mark", "dadada", setOf(Permissions.all())) driver(DriverParameters(isDebug = true, startNodesInProcess = isQuasarAgentSpecified())) { @@ -151,8 +151,8 @@ class FlowRetryTest { } } - @Test - fun `Specific exception still detected even if it is nested inside another exception`() { + @Test(timeout=300_000) + fun `Specific exception still detected even if it is nested inside another exception`() { val user = User("mark", "dadada", setOf(Permissions.all())) driver(DriverParameters(isDebug = true, startNodesInProcess = isQuasarAgentSpecified())) { @@ -170,8 +170,8 @@ class FlowRetryTest { } } - @Test - fun `General external exceptions are not retried and propagate`() { + @Test(timeout=300_000) + fun `General external exceptions are not retried and propagate`() { val user = User("mark", "dadada", setOf(Permissions.all())) driver(DriverParameters(isDebug = true, startNodesInProcess = isQuasarAgentSpecified())) { @@ -189,8 +189,8 @@ class FlowRetryTest { } } - @Test - fun `Permission exceptions are not retried and propagate`() { + @Test(timeout=300_000) + fun `Permission exceptions are not retried and propagate`() { val user = User("mark", "dadada", setOf()) driver(DriverParameters(isDebug = true, startNodesInProcess = isQuasarAgentSpecified())) { diff --git a/node/src/integration-test/kotlin/net/corda/node/logging/ErrorCodeLoggingTests.kt b/node/src/integration-test/kotlin/net/corda/node/logging/ErrorCodeLoggingTests.kt index e0532911f0..c28dbabb5e 100644 --- a/node/src/integration-test/kotlin/net/corda/node/logging/ErrorCodeLoggingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/logging/ErrorCodeLoggingTests.kt @@ -16,8 +16,8 @@ import org.junit.Test import java.io.File class ErrorCodeLoggingTests { - @Test - fun `log entries with a throwable and ERROR or WARN get an error code appended`() { + @Test(timeout=300_000) + fun `log entries with a throwable and ERROR or WARN get an error code appended`() { driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(startInSameProcess = false).getOrThrow() node.rpc.startFlow(::MyFlow).waitForCompletion() @@ -31,8 +31,8 @@ class ErrorCodeLoggingTests { // This is used to detect broken logging which can be caused by loggers being initialized // before the initLogging() call is made - @Test - fun `When logging is set to error level, there are no other levels logged after node startup`() { + @Test(timeout=300_000) + fun `When logging is set to error level, there are no other levels logged after node startup`() { driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(startInSameProcess = false, logLevelOverride = "ERROR").getOrThrow() node.rpc.startFlow(::MyFlow).waitForCompletion() diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt index 4c92186001..e059522f89 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt @@ -49,8 +49,8 @@ class FlowsDrainingModeContentionTest { executor!!.shutdown() } - @Test - fun `draining mode does not deadlock with acks between 2 nodes`() { + @Test(timeout=300_000) + fun `draining mode does not deadlock with acks between 2 nodes`() { val message = "Ground control to Major Tom" driver(DriverParameters( startNodesInProcess = true, diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt index 0330024f4f..ce70423592 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt @@ -50,8 +50,8 @@ class P2PFlowsDrainingModeTest { executor!!.shutdown() } - @Test - fun `flows draining mode suspends consumption of initial session messages`() { + @Test(timeout=300_000) + fun `flows draining mode suspends consumption of initial session messages`() { driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation, notarySpecs = emptyList())) { val initiatedNode = startNode(providedName = ALICE_NAME).getOrThrow() val initiating = startNode(providedName = BOB_NAME, rpcUsers = users).getOrThrow().rpc @@ -80,8 +80,8 @@ class P2PFlowsDrainingModeTest { } } - @Test - fun `terminate node waiting for pending flows`() { + @Test(timeout=300_000) + fun `terminate node waiting for pending flows`() { driver(DriverParameters(portAllocation = portAllocation, notarySpecs = emptyList())) { @@ -104,8 +104,8 @@ class P2PFlowsDrainingModeTest { } } - @Test - fun `terminate resets persistent draining mode property when waiting for pending flows`() { + @Test(timeout=300_000) + fun `terminate resets persistent draining mode property when waiting for pending flows`() { driver(DriverParameters(portAllocation = portAllocation, notarySpecs = emptyList())) { @@ -128,8 +128,8 @@ class P2PFlowsDrainingModeTest { } } - @Test - fun `disabling draining mode cancels draining shutdown`() { + @Test(timeout=300_000) + fun `disabling draining mode cancels draining shutdown`() { driver(DriverParameters(portAllocation = portAllocation, notarySpecs = emptyList())) { diff --git a/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt b/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt index f5ae9b9ea4..aa08b68d4e 100644 --- a/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/modes/draining/RpcFlowsDrainingModeTest.kt @@ -21,8 +21,8 @@ class RpcFlowsDrainingModeTest { private val user = User("mark", "dadada", setOf(Permissions.all())) private val users = listOf(user) - @Test - fun `flows draining mode rejects start flows commands through rpc`() { + @Test(timeout=300_000) + fun `flows draining mode rejects start flows commands through rpc`() { driver(DriverParameters(startNodesInProcess = false, portAllocation = portAllocation, notarySpecs = emptyList())) { startNode(rpcUsers = users).getOrThrow().rpc.apply { setFlowsDrainingModeEnabled(true) diff --git a/node/src/integration-test/kotlin/net/corda/node/persistence/DbSchemaInitialisationTest.kt b/node/src/integration-test/kotlin/net/corda/node/persistence/DbSchemaInitialisationTest.kt index 10186324b6..3451d2d485 100644 --- a/node/src/integration-test/kotlin/net/corda/node/persistence/DbSchemaInitialisationTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/persistence/DbSchemaInitialisationTest.kt @@ -12,8 +12,8 @@ import kotlin.test.assertNotNull class DbSchemaInitialisationTest { - @Test - fun `database is initialised`() { + @Test(timeout=300_000) + fun `database is initialised`() { driver(DriverParameters(startNodesInProcess = isQuasarAgentSpecified(), cordappsForAllNodes = emptyList())) { val nodeHandle = { startNode(NodeParameters(customOverrides = mapOf("database.initialiseSchema" to "true"))).getOrThrow() @@ -22,8 +22,8 @@ class DbSchemaInitialisationTest { } } - @Test - fun `database is not initialised`() { + @Test(timeout=300_000) + fun `database is not initialised`() { driver(DriverParameters(startNodesInProcess = isQuasarAgentSpecified(), cordappsForAllNodes = emptyList())) { assertFailsWith(DatabaseIncompatibleException::class) { startNode(NodeParameters(customOverrides = mapOf("database.initialiseSchema" to "false"))).getOrThrow() diff --git a/node/src/integration-test/kotlin/net/corda/node/persistence/H2SecurityTests.kt b/node/src/integration-test/kotlin/net/corda/node/persistence/H2SecurityTests.kt index 07c79378cc..89b8b13a3e 100644 --- a/node/src/integration-test/kotlin/net/corda/node/persistence/H2SecurityTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/persistence/H2SecurityTests.kt @@ -30,8 +30,8 @@ class H2SecurityTests { private const val dbPasswordKey = "dataSourceProperties.dataSource.password" } - @Test - fun `h2 server starts when h2Settings are set`() { + @Test(timeout=300_000) + fun `h2 server starts when h2Settings are set`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), @@ -46,8 +46,8 @@ class H2SecurityTests { } } - @Test - fun `h2 server on the host name requires non-default database password`() { + @Test(timeout=300_000) + fun `h2 server on the host name requires non-default database password`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), @@ -60,8 +60,8 @@ class H2SecurityTests { } } - @Test - fun `h2 server on the external host IP requires non-default database password`() { + @Test(timeout=300_000) + fun `h2 server on the external host IP requires non-default database password`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), @@ -74,8 +74,8 @@ class H2SecurityTests { } } - @Test - fun `h2 server on host name requires non-blank database password`() { + @Test(timeout=300_000) + fun `h2 server on host name requires non-blank database password`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), @@ -89,8 +89,8 @@ class H2SecurityTests { } } - @Test - fun `h2 server on external host IP requires non-blank database password`() { + @Test(timeout=300_000) + fun `h2 server on external host IP requires non-blank database password`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), @@ -104,8 +104,8 @@ class H2SecurityTests { } } - @Test - fun `h2 server on localhost runs with the default database password`() { + @Test(timeout=300_000) + fun `h2 server on localhost runs with the default database password`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = false, @@ -116,8 +116,8 @@ class H2SecurityTests { } } - @Test - fun `h2 server to loopback IP runs with the default database password`() { + @Test(timeout=300_000) + fun `h2 server to loopback IP runs with the default database password`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = isQuasarAgentSpecified(), @@ -128,8 +128,8 @@ class H2SecurityTests { } } - @Test - fun `remote code execution via h2 server is disabled`() { + @Test(timeout=300_000) + fun `remote code execution via h2 server is disabled`() { driver(DriverParameters( inMemoryDB = false, startNodesInProcess = false, @@ -148,8 +148,8 @@ class H2SecurityTests { } } - @Test - fun `malicious flow tries to enable remote code execution via h2 server`() { + @Test(timeout=300_000) + fun `malicious flow tries to enable remote code execution via h2 server`() { val user = User("mark", "dadada", setOf(Permissions.startFlow())) driver(DriverParameters( inMemoryDB = false, diff --git a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt index 372b45587f..7dda30ca06 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt @@ -44,8 +44,8 @@ class AttachmentLoadingTests { fun loadFromIsolated(className: String): Class<*> = Class.forName(className, false, isolatedClassLoader) } - @Test - fun `contracts downloaded from the network are not executed without the DJVM`() { + @Test(timeout=300_000) + fun `contracts downloaded from the network are not executed without the DJVM`() { driver(DriverParameters( startNodesInProcess = false, notarySpecs = listOf(NotarySpec(DUMMY_NOTARY_NAME, validating = false)), @@ -67,8 +67,8 @@ class AttachmentLoadingTests { } } - @Test - fun `contract is executed if installed locally`() { + @Test(timeout=300_000) + fun `contract is executed if installed locally`() { driver(DriverParameters( startNodesInProcess = false, notarySpecs = listOf(NotarySpec(DUMMY_NOTARY_NAME, validating = false)), diff --git a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceFlowTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceFlowTests.kt index c1ad221991..d5e299dcb3 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceFlowTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceFlowTests.kt @@ -16,8 +16,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.Test class CordaServiceFlowTests { - @Test - fun `corda service can start a flow and wait for it`() { + @Test(timeout=300_000) + fun `corda service can start a flow and wait for it`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode().getOrThrow() val text = "191ejodaimadc8i" diff --git a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceIssueOnceAtStartupTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceIssueOnceAtStartupTests.kt index 6917786c41..2e27e36f05 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceIssueOnceAtStartupTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceIssueOnceAtStartupTests.kt @@ -45,8 +45,8 @@ class CordaServiceIssueOnceAtStartupTests { private const val sentFlowMarker = "SentFlow" } - @Test - fun test() { + @Test(timeout=300_000) + fun test() { driver(DriverParameters(startNodesInProcess = false, cordappsForAllNodes = FINANCE_CORDAPPS + enclosedCordapp(), inMemoryDB = false, systemProperties = mapOf(armedPropName to "true", tempFilePropertyName to tmpFile.absolutePath))) { var node = startNode(providedName = ALICE_NAME).getOrThrow() diff --git a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleFatalTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleFatalTests.kt index daa2dba42b..a8b19e7d91 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleFatalTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleFatalTests.kt @@ -61,7 +61,7 @@ class CordaServiceLifecycleFatalTests { } } - @Test + @Test(timeout=300_000) fun `JVM terminates on critical failure`() { // Scenario terminates JVM - node should be running out of process driver(DriverParameters(startNodesInProcess = false, cordappsForAllNodes = listOf(enclosedCordapp()), diff --git a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleTests.kt index 71df448458..9530cb0af2 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/CordaServiceLifecycleTests.kt @@ -25,8 +25,8 @@ class CordaServiceLifecycleTests { private val eventsCaptured: MutableList = mutableListOf() } - @Test - fun `corda service receives events`() { + @Test(timeout=300_000) + fun `corda service receives events`() { eventsCaptured.clear() val result = driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()), notarySpecs = emptyList())) { diff --git a/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractCryptoTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractCryptoTest.kt index 3126381293..275693f4d7 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractCryptoTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractCryptoTest.kt @@ -50,8 +50,8 @@ class DeterministicContractCryptoTest { } } - @Test - fun `test DJVM can verify using crypto`() { + @Test(timeout=300_000) + fun `test DJVM can verify using crypto`() { val keyPair = KeyPairGenerator.getInstance(DEFAULT_SIGNATURE_SCHEME.algorithmName).genKeyPair() val importantData = OpaqueBytes(MESSAGE.toByteArray()) val signature = OpaqueBytes(Crypto.doSign(DEFAULT_SIGNATURE_SCHEME, keyPair.`private`, importantData.bytes)) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithCustomSerializerTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithCustomSerializerTest.kt index a7a7c54886..3630fbcf3c 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithCustomSerializerTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithCustomSerializerTest.kt @@ -59,8 +59,8 @@ class DeterministicContractWithCustomSerializerTest { } } - @Test - fun `test DJVM can verify using custom serializer`() { + @Test(timeout=300_000) + fun `test DJVM can verify using custom serializer`() { driver(parametersFor(djvmSources, flowCordapp, contractCordapp)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val txId = assertDoesNotThrow { @@ -71,8 +71,8 @@ class DeterministicContractWithCustomSerializerTest { } } - @Test - fun `test DJVM can fail verify using custom serializer`() { + @Test(timeout=300_000) + fun `test DJVM can fail verify using custom serializer`() { driver(parametersFor(djvmSources, flowCordapp, contractCordapp)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val currantsy = Currantsy(BAD_CURRANTS) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithSerializationWhitelistTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithSerializationWhitelistTest.kt index 0f854ca51c..97ecbf014a 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithSerializationWhitelistTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/DeterministicContractWithSerializationWhitelistTest.kt @@ -59,8 +59,8 @@ class DeterministicContractWithSerializationWhitelistTest { } } - @Test - fun `test DJVM can verify using whitelist`() { + @Test(timeout=300_000) + fun `test DJVM can verify using whitelist`() { driver(parametersFor(djvmSources, flowCordapp, contractCordapp)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val txId = assertDoesNotThrow { @@ -71,8 +71,8 @@ class DeterministicContractWithSerializationWhitelistTest { } } - @Test - fun `test DJVM can fail verify using whitelist`() { + @Test(timeout=300_000) + fun `test DJVM can fail verify using whitelist`() { driver(parametersFor(djvmSources, flowCordapp, contractCordapp)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val badData = WhitelistData(BAD_VALUE) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/JavaCordaServiceLifecycleTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/JavaCordaServiceLifecycleTests.kt index 0c01f0d058..6aab5a08af 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/JavaCordaServiceLifecycleTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/JavaCordaServiceLifecycleTests.kt @@ -17,8 +17,8 @@ class JavaCordaServiceLifecycleTests { const val TEST_PHRASE = "javaTestPhrase" } - @Test - fun `corda service receives events`() { + @Test(timeout=300_000) + fun `corda service receives events`() { eventsCaptured.clear() val result = driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { val node = startNode(providedName = ALICE_NAME).getOrThrow() diff --git a/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt index 613e656065..9c17f78e5d 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt @@ -53,8 +53,8 @@ class NonDeterministicContractVerifyTest { } } - @Test - fun `test DJVM rejects contract that uses Instant now`() { + @Test(timeout=300_000) + fun `test DJVM rejects contract that uses Instant now`() { driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val ex = assertThrows { @@ -66,8 +66,8 @@ class NonDeterministicContractVerifyTest { } } - @Test - fun `test DJVM rejects contract that uses System currentTimeMillis`() { + @Test(timeout=300_000) + fun `test DJVM rejects contract that uses System currentTimeMillis`() { driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val ex = assertThrows { @@ -79,8 +79,8 @@ class NonDeterministicContractVerifyTest { } } - @Test - fun `test DJVM rejects contract that uses System nanoTime`() { + @Test(timeout=300_000) + fun `test DJVM rejects contract that uses System nanoTime`() { driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val ex = assertThrows { @@ -92,8 +92,8 @@ class NonDeterministicContractVerifyTest { } } - @Test - fun `test DJVM rejects contract that uses UUID randomUUID`() { + @Test(timeout=300_000) + fun `test DJVM rejects contract that uses UUID randomUUID`() { driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val ex = assertThrows { @@ -105,8 +105,8 @@ class NonDeterministicContractVerifyTest { } } - @Test - fun `test DJVM rejects contract that uses reflection`() { + @Test(timeout=300_000) + fun `test DJVM rejects contract that uses reflection`() { driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val ex = assertThrows { @@ -119,8 +119,8 @@ class NonDeterministicContractVerifyTest { } } - @Test - fun `test DJVM can succeed`() { + @Test(timeout=300_000) + fun `test DJVM can succeed`() { driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() val txId = assertDoesNotThrow { diff --git a/node/src/integration-test/kotlin/net/corda/node/services/SandboxAttachmentsTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/SandboxAttachmentsTest.kt index 409139a5ff..85dac332a9 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/SandboxAttachmentsTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/SandboxAttachmentsTest.kt @@ -50,8 +50,8 @@ class SandboxAttachmentsTest { } } - @Test - fun `test attachment accessible within sandbox`() { + @Test(timeout=300_000) + fun `test attachment accessible within sandbox`() { val extractFile = ExtractFile(SandboxAttachmentContract::class.java.name.asResourcePath + ".class") driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() @@ -63,8 +63,8 @@ class SandboxAttachmentsTest { } } - @Test - fun `test attachment file not found within sandbox`() { + @Test(timeout=300_000) + fun `test attachment file not found within sandbox`() { val extractFile = ExtractFile("does/not/Exist.class") driver(parametersFor(djvmSources)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() diff --git a/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt index e8bfd69dcd..8f2bc0af24 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt @@ -96,8 +96,8 @@ class ScheduledFlowIntegrationTests { } } - @Test - fun `test that when states are being spent at the same time that schedules trigger everything is processed`() { + @Test(timeout=300_000) + fun `test that when states are being spent at the same time that schedules trigger everything is processed`() { driver(DriverParameters( startNodesInProcess = true, cordappsForAllNodes = listOf(DUMMY_CONTRACTS_CORDAPP, cordappWithPackages("net.corda.testMessage"), enclosedCordapp()) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt index 6808d45c53..900432d3d1 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt @@ -101,16 +101,16 @@ class ArtemisMessagingTest { LogHelper.reset(PersistentUniquenessProvider::class) } - @Test - fun `server starting with the port already bound should throw`() { + @Test(timeout=300_000) + fun `server starting with the port already bound should throw`() { ServerSocket(serverPort).use { val messagingServer = createMessagingServer() assertThatThrownBy { messagingServer.start() } } } - @Test - fun `client should connect to remote server`() { + @Test(timeout=300_000) + fun `client should connect to remote server`() { val remoteServerAddress = portAllocation.nextHostAndPort() createMessagingServer(remoteServerAddress.port).start() @@ -118,8 +118,8 @@ class ArtemisMessagingTest { startNodeMessagingClient() } - @Test - fun `client should throw if remote server not found`() { + @Test(timeout=300_000) + fun `client should throw if remote server not found`() { val serverAddress = portAllocation.nextHostAndPort() val invalidServerAddress = portAllocation.nextHostAndPort() @@ -130,15 +130,15 @@ class ArtemisMessagingTest { messagingClient = null } - @Test - fun `client should connect to local server`() { + @Test(timeout=300_000) + fun `client should connect to local server`() { createMessagingServer().start() createMessagingClient() startNodeMessagingClient() } - @Test - fun `client should be able to send message to itself`() { + @Test(timeout=300_000) + fun `client should be able to send message to itself`() { val (messagingClient, receivedMessages) = createAndStartClientAndServer() val message = messagingClient.createMessage(TOPIC, data = "first msg".toByteArray()) messagingClient.send(message, messagingClient.myAddress) @@ -148,8 +148,8 @@ class ArtemisMessagingTest { assertNull(receivedMessages.poll(200, MILLISECONDS)) } - @Test - fun `client should fail if message exceed maxMessageSize limit`() { + @Test(timeout=300_000) + fun `client should fail if message exceed maxMessageSize limit`() { val (messagingClient, receivedMessages) = createAndStartClientAndServer() val message = messagingClient.createMessage(TOPIC, data = ByteArray(MAX_MESSAGE_SIZE)) messagingClient.send(message, messagingClient.myAddress) @@ -167,8 +167,8 @@ class ArtemisMessagingTest { assertNull(receivedMessages.poll(200, MILLISECONDS)) } - @Test - fun `server should not process if incoming message exceed maxMessageSize limit`() { + @Test(timeout=300_000) + fun `server should not process if incoming message exceed maxMessageSize limit`() { val (messagingClient, receivedMessages) = createAndStartClientAndServer(clientMaxMessageSize = 100_000, serverMaxMessageSize = 50_000) val message = messagingClient.createMessage(TOPIC, data = ByteArray(50_000)) messagingClient.send(message, messagingClient.myAddress) @@ -184,8 +184,8 @@ class ArtemisMessagingTest { assertNull(receivedMessages.poll(200, MILLISECONDS)) } - @Test - fun `platform version is included in the message`() { + @Test(timeout=300_000) + fun `platform version is included in the message`() { val (messagingClient, receivedMessages) = createAndStartClientAndServer(platformVersion = 3) val message = messagingClient.createMessage(TOPIC, data = "first msg".toByteArray()) messagingClient.send(message, messagingClient.myAddress) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt index 287fb40183..feacf2c228 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt @@ -87,8 +87,8 @@ class NetworkMapTest(var initFunc: (URL, NetworkMapServer) -> CompatibilityZoneP networkMapServer.close() } - @Test - fun `parameters update test`() { + @Test(timeout=300_000) + fun `parameters update test`() { internalDriver( portAllocation = portAllocation, compatibilityZone = compatibilityZone, @@ -141,8 +141,8 @@ class NetworkMapTest(var initFunc: (URL, NetworkMapServer) -> CompatibilityZoneP } } - @Test - fun `nodes process additions and removals from the network map correctly (and also download the network parameters)`() { + @Test(timeout=300_000) + fun `nodes process additions and removals from the network map correctly (and also download the network parameters)`() { internalDriver( portAllocation = portAllocation, compatibilityZone = compatibilityZone, @@ -169,8 +169,8 @@ class NetworkMapTest(var initFunc: (URL, NetworkMapServer) -> CompatibilityZoneP } } - @Test - fun `test node heartbeat`() { + @Test(timeout=300_000) + fun `test node heartbeat`() { internalDriver( portAllocation = portAllocation, compatibilityZone = compatibilityZone, diff --git a/node/src/integration-test/kotlin/net/corda/node/services/network/PersistentNetworkMapCacheTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/network/PersistentNetworkMapCacheTest.kt index 2d9c063fb9..f9675a94c1 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/network/PersistentNetworkMapCacheTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/network/PersistentNetworkMapCacheTest.kt @@ -47,8 +47,8 @@ class PersistentNetworkMapCacheTest { database.close() } - @Test - fun addNode() { + @Test(timeout=300_000) + fun addNode() { val alice = createNodeInfo(listOf(ALICE)) charlieNetMapCache.addNode(alice) val fromDb = database.transaction { @@ -60,8 +60,8 @@ class PersistentNetworkMapCacheTest { assertThat(fromDb).containsOnly(alice) } - @Test - fun `unknown legal name`() { + @Test(timeout=300_000) + fun `unknown legal name`() { charlieNetMapCache.addNode(createNodeInfo(listOf(ALICE))) assertThat(charlieNetMapCache.getNodesByLegalName(DUMMY_NOTARY_NAME)).isEmpty() assertThat(charlieNetMapCache.getNodeByLegalName(DUMMY_NOTARY_NAME)).isNull() @@ -69,8 +69,8 @@ class PersistentNetworkMapCacheTest { assertThat(charlieNetMapCache.getPeerCertificateByLegalName(DUMMY_NOTARY_NAME)).isNull() } - @Test - fun `nodes in distributed service`() { + @Test(timeout=300_000) + fun `nodes in distributed service`() { charlieNetMapCache.addNode(createNodeInfo(listOf(ALICE))) val distributedIdentity = TestIdentity(DUMMY_NOTARY_NAME) @@ -87,23 +87,23 @@ class PersistentNetworkMapCacheTest { .withMessageContaining(DUMMY_NOTARY_NAME.toString()) } - @Test - fun `get nodes by owning key and by name`() { + @Test(timeout=300_000) + fun `get nodes by owning key and by name`() { val alice = createNodeInfo(listOf(ALICE)) charlieNetMapCache.addNode(alice) assertThat(charlieNetMapCache.getNodesByLegalIdentityKey(ALICE.publicKey)).containsOnly(alice) assertThat(charlieNetMapCache.getNodeByLegalName(ALICE.name)).isEqualTo(alice) } - @Test - fun `get nodes by address`() { + @Test(timeout=300_000) + fun `get nodes by address`() { val alice = createNodeInfo(listOf(ALICE)) charlieNetMapCache.addNode(alice) assertThat(charlieNetMapCache.getNodeByAddress(alice.addresses[0])).isEqualTo(alice) } - @Test - fun `insert two node infos with the same host and port`() { + @Test(timeout=300_000) + fun `insert two node infos with the same host and port`() { val alice = createNodeInfo(listOf(ALICE)) charlieNetMapCache.addNode(alice) val bob = createNodeInfo(listOf(BOB), address = alice.addresses[0]) @@ -112,14 +112,14 @@ class PersistentNetworkMapCacheTest { assertThat(nodeInfos).hasSize(2) } - @Test - fun `negative test - attempt to insert invalid node info`() { + @Test(timeout=300_000) + fun `negative test - attempt to insert invalid node info`() { charlieNetMapCache.addNode(createNodeInfo(listOf(LONG_PLC))) assertThat(charlieNetMapCache.allNodes).hasSize(0) } - @Test - fun `negative test - attempt to update existing node with invalid node info`() { + @Test(timeout=300_000) + fun `negative test - attempt to update existing node with invalid node info`() { charlieNetMapCache.addNode(createNodeInfo(listOf(ALICE))) val aliceUpdate = TestIdentity(LONG_X500_NAME, ALICE.keyPair) charlieNetMapCache.addNode(createNodeInfo(listOf(aliceUpdate))) @@ -128,8 +128,8 @@ class PersistentNetworkMapCacheTest { assertThat(charlieNetMapCache.getNodeByLegalName(LONG_X500_NAME)).isNull() } - @Test - fun `negative test - insert two valid node infos and one invalid one`() { + @Test(timeout=300_000) + fun `negative test - insert two valid node infos and one invalid one`() { charlieNetMapCache.addNodes(listOf(createNodeInfo(listOf(ALICE)), createNodeInfo(listOf(BOB)), createNodeInfo(listOf(LONG_PLC)))) @@ -137,8 +137,8 @@ class PersistentNetworkMapCacheTest { assertThat(charlieNetMapCache.allNodes.flatMap { it.legalIdentities }).isEqualTo(listOf(ALICE.party, BOB.party)) } - @Test - fun `negative test - insert three valid node infos and two invalid ones`() { + @Test(timeout=300_000) + fun `negative test - insert three valid node infos and two invalid ones`() { charlieNetMapCache.addNodes(listOf(createNodeInfo(listOf(LONG_PLC)), createNodeInfo(listOf(ALICE)), createNodeInfo(listOf(BOB)), @@ -148,8 +148,8 @@ class PersistentNetworkMapCacheTest { assertThat(charlieNetMapCache.allNodes.flatMap { it.legalIdentities }).isEqualTo(listOf(ALICE.party, BOB.party, CHARLIE.party)) } - @Test - fun `negative test - insert one valid node info then attempt to add one invalid node info and update the existing valid nodeinfo`() { + @Test(timeout=300_000) + fun `negative test - insert one valid node info then attempt to add one invalid node info and update the existing valid nodeinfo`() { charlieNetMapCache.addNode(createNodeInfo(listOf(ALICE))) val aliceUpdate = TestIdentity(LONG_X500_NAME, ALICE.keyPair) charlieNetMapCache.addNodes(listOf(createNodeInfo(listOf(aliceUpdate)), diff --git a/node/src/integration-test/kotlin/net/corda/node/services/persistence/CordaPersistenceServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/persistence/CordaPersistenceServiceTests.kt index 298fc59c21..7d6aa1edf8 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/persistence/CordaPersistenceServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/persistence/CordaPersistenceServiceTests.kt @@ -19,8 +19,8 @@ import kotlin.test.assertEquals import kotlin.test.assertTrue class CordaPersistenceServiceTests { - @Test - fun `corda service can save many transactions from different threads`() { + @Test(timeout=300_000) + fun `corda service can save many transactions from different threads`() { driver(DriverParameters(inMemoryDB = false, startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val port = incrementalPortAllocation().nextPort() diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/ArtemisRpcTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/ArtemisRpcTests.kt index 99d8816d38..7ce43ba6f5 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/ArtemisRpcTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/ArtemisRpcTests.kt @@ -52,8 +52,8 @@ class ArtemisRpcTests { val testName = X500Principal("CN=Test,O=R3 Ltd,L=London,C=GB") - @Test - fun rpc_with_ssl_enabled() { + @Test(timeout=300_000) + fun rpc_with_ssl_enabled() { val (rpcKeyPair, selfSignCert) = createKeyPairAndSelfSignedTLSCertificate(testName) val keyStorePath = saveToKeyStore(tempFile("rpcKeystore.jks"), rpcKeyPair, selfSignCert) val brokerSslOptions = BrokerRpcSslOptions(keyStorePath, "password") @@ -62,13 +62,13 @@ class ArtemisRpcTests { testSslCommunication(p2pSslOptions(tempFolder.root.toPath()), brokerSslOptions, true, clientSslOptions) } - @Test - fun rpc_with_ssl_disabled() { + @Test(timeout=300_000) + fun rpc_with_ssl_disabled() { testSslCommunication(p2pSslOptions(tempFolder.root.toPath()), null, false, null) } - @Test - fun rpc_with_no_ssl_on_client_side_and_ssl_on_server_side() { + @Test(timeout=300_000) + fun rpc_with_no_ssl_on_client_side_and_ssl_on_server_side() { val (rpcKeyPair, selfSignCert) = createKeyPairAndSelfSignedTLSCertificate(testName) val keyStorePath = saveToKeyStore(tempFile("rpcKeystore.jks"), rpcKeyPair, selfSignCert) val brokerSslOptions = BrokerRpcSslOptions(keyStorePath, "password") @@ -78,8 +78,8 @@ class ArtemisRpcTests { }.isInstanceOf(ActiveMQConnectionTimedOutException::class.java) } - @Test - fun rpc_client_certificate_untrusted_to_server() { + @Test(timeout=300_000) + fun rpc_client_certificate_untrusted_to_server() { val (rpcKeyPair, selfSignCert) = createKeyPairAndSelfSignedTLSCertificate(testName) val keyStorePath = saveToKeyStore(tempFile("rpcKeystore.jks"), rpcKeyPair, selfSignCert) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/DumpCheckpointsTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/DumpCheckpointsTest.kt index 103d75dfda..2e9e36e4cf 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/DumpCheckpointsTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/DumpCheckpointsTest.kt @@ -36,8 +36,8 @@ class DumpCheckpointsTest { private val flowProceedLatch = CountUpDownLatch(1) } - @Test - fun `verify checkpoint dump via RPC`() { + @Test(timeout=300_000) + fun `verify checkpoint dump via RPC`() { val user = User("mark", "dadada", setOf(Permissions.all())) driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/NodeHandleTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/NodeHandleTests.kt index ac78e697ef..5c5abbc378 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/NodeHandleTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/NodeHandleTests.kt @@ -7,8 +7,8 @@ import org.assertj.core.api.Assertions.assertThatCode import org.junit.Test class NodeHandleTests { - @Test - fun object_defined_functions_are_static_for_node_rpc_ops() { + @Test(timeout=300_000) + fun object_defined_functions_are_static_for_node_rpc_ops() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = emptyList())) { val rpcClient = startNode().getOrThrow().rpc diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcExceptionHandlingTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcExceptionHandlingTest.kt index 88c35fa793..3a1bfc58ed 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcExceptionHandlingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcExceptionHandlingTest.kt @@ -25,8 +25,8 @@ class RpcExceptionHandlingTest { private val user = User("mark", "dadada", setOf(Permissions.all())) private val users = listOf(user) - @Test - fun `rpc client receives relevant exceptions`() { + @Test(timeout=300_000) + fun `rpc client receives relevant exceptions`() { val params = NodeParameters(rpcUsers = users) val clientRelevantMessage = "This is for the players!" @@ -43,8 +43,8 @@ class RpcExceptionHandlingTest { } } - @Test - fun `rpc client receives client-relevant message`() { + @Test(timeout=300_000) + fun `rpc client receives client-relevant message`() { val params = NodeParameters(rpcUsers = users) val clientRelevantMessage = "This is for the players!" @@ -67,8 +67,8 @@ class RpcExceptionHandlingTest { } } - @Test - fun `FlowException is received by the RPC client`() { + @Test(timeout=300_000) + fun `FlowException is received by the RPC client`() { val params = NodeParameters(rpcUsers = users) val expectedMessage = "Flow error!" val expectedErrorId = 123L @@ -97,8 +97,8 @@ class RpcExceptionHandlingTest { } } - @Test - fun `rpc client handles exceptions thrown on counter-party side`() { + @Test(timeout=300_000) + fun `rpc client handles exceptions thrown on counter-party side`() { val params = NodeParameters(rpcUsers = users) fun DriverDSL.scenario(nameA: CordaX500Name, nameB: CordaX500Name, devMode: Boolean) { diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt index 1ee908e307..ceb715533b 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt @@ -32,8 +32,8 @@ class RpcSslTest { private val testName = X500Principal("CN=Test,O=R3 Ltd,L=London,C=GB") - @Test - fun `RPC client using ssl is able to run a command`() { + @Test(timeout=300_000) + fun `RPC client using ssl is able to run a command`() { val user = User("mark", "dadada", setOf(all())) var successfulLogin = false var failedLogin = false @@ -70,8 +70,8 @@ class RpcSslTest { assertThat(failedLogin).isFalse() } - @Test - fun `RPC client using ssl will fail if connecting to a node that cannot present a matching certificate`() { + @Test(timeout=300_000) + fun `RPC client using ssl will fail if connecting to a node that cannot present a matching certificate`() { val user = User("mark", "dadada", setOf(all())) var successful = false @@ -99,8 +99,8 @@ class RpcSslTest { assertThat(successful).isFalse() } - @Test - fun `RPC client not using ssl can run commands`() { + @Test(timeout=300_000) + fun `RPC client not using ssl can run commands`() { val user = User("mark", "dadada", setOf(all())) var successful = false driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { @@ -115,8 +115,8 @@ class RpcSslTest { assertThat(successful).isTrue() } - @Test - fun `The system RPC user can not connect to the rpc broker without the node's key`() { + @Test(timeout=300_000) + fun `The system RPC user can not connect to the rpc broker without the node's key`() { val (keyPair, cert) = createKeyPairAndSelfSignedTLSCertificate(testName) val keyStorePath = saveToKeyStore(tempFolder.root.toPath() / "keystore.jks", keyPair, cert) val brokerSslOptions = BrokerRpcSslOptions(keyStorePath, "password") diff --git a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowHospitalTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowHospitalTest.kt index 4e7dd89b4a..739e684623 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowHospitalTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowHospitalTest.kt @@ -46,8 +46,8 @@ class FlowHospitalTest { private val rpcUser = User("user1", "test", permissions = setOf(Permissions.all())) - @Test - fun `when double spend occurs, the flow is successfully deleted on the counterparty`() { + @Test(timeout=300_000) + fun `when double spend occurs, the flow is successfully deleted on the counterparty`() { driver(DriverParameters(cordappsForAllNodes = listOf(enclosedCordapp(), findCordapp("net.corda.testing.contracts")))) { val charlie = startNode(providedName = CHARLIE_NAME, rpcUsers = listOf(rpcUser)).getOrThrow() val alice = startNode(providedName = ALICE_NAME, rpcUsers = listOf(rpcUser)).getOrThrow() @@ -95,8 +95,8 @@ class FlowHospitalTest { } } - @Test - fun `HospitalizeFlowException thrown`() { + @Test(timeout=300_000) + fun `HospitalizeFlowException thrown`() { var observationCounter: Int = 0 StaffedFlowHospital.onFlowKeptForOvernightObservation.add { _, _ -> ++observationCounter @@ -117,8 +117,8 @@ class FlowHospitalTest { } } - @Test - fun `Custom exception wrapping HospitalizeFlowException thrown`() { + @Test(timeout=300_000) + fun `Custom exception wrapping HospitalizeFlowException thrown`() { var observationCounter: Int = 0 StaffedFlowHospital.onFlowKeptForOvernightObservation.add { _, _ -> ++observationCounter @@ -139,8 +139,8 @@ class FlowHospitalTest { } } - @Test - fun `Custom exception extending HospitalizeFlowException thrown`() { + @Test(timeout=300_000) + fun `Custom exception extending HospitalizeFlowException thrown`() { var observationCounter: Int = 0 StaffedFlowHospital.onFlowKeptForOvernightObservation.add { _, _ -> ++observationCounter @@ -162,8 +162,8 @@ class FlowHospitalTest { } } - @Test - fun `HospitalizeFlowException cloaking an important exception thrown`() { + @Test(timeout=300_000) + fun `HospitalizeFlowException cloaking an important exception thrown`() { var dischargedCounter = 0 var observationCounter: Int = 0 StaffedFlowHospital.onFlowDischarged.add { _, _ -> diff --git a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowVersioningTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowVersioningTest.kt index 1248d75b4f..e2fc51282b 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowVersioningTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/FlowVersioningTest.kt @@ -17,8 +17,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.Test class FlowVersioningTest : NodeBasedTest() { - @Test - fun `getFlowContext returns the platform version for core flows`() { + @Test(timeout=300_000) + fun `getFlowContext returns the platform version for core flows`() { val bobFlowManager = NodeFlowManager() val alice = startNode(ALICE_NAME, platformVersion = 2) val bob = startNode(BOB_NAME, platformVersion = 3, flowManager = bobFlowManager) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt index dfd74a66ec..5b1f99b130 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/HardRestartTest.kt @@ -60,8 +60,8 @@ class HardRestartTest { } } - @Test - fun restartShortPingPongFlowRandomly() { + @Test(timeout=300_000) + fun restartShortPingPongFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) driver(DriverParameters( portAllocation = incrementalPortAllocation(), @@ -99,8 +99,8 @@ class HardRestartTest { } } - @Test - fun restartLongPingPongFlowRandomly() { + @Test(timeout=300_000) + fun restartLongPingPongFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) driver(DriverParameters( portAllocation = incrementalPortAllocation(), @@ -138,8 +138,8 @@ class HardRestartTest { } } - @Test - fun softRestartLongPingPongFlowRandomly() { + @Test(timeout=300_000) + fun softRestartLongPingPongFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) driver(DriverParameters( portAllocation = incrementalPortAllocation(), @@ -221,8 +221,8 @@ class HardRestartTest { } } - @Test - fun restartRecursiveFlowRandomly() { + @Test(timeout=300_000) + fun restartRecursiveFlowRandomly() { val demoUser = User("demo", "demo", setOf(Permissions.startFlow(), Permissions.all())) driver(DriverParameters( portAllocation = incrementalPortAllocation(), diff --git a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt index 532b6ca141..6d23503efb 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt @@ -70,8 +70,8 @@ class LargeTransactionsTest { } } - @Test - fun checkCanSendLargeTransactions() { + @Test(timeout=300_000) + fun checkCanSendLargeTransactions() { // These 4 attachments yield a transaction that's got >10mb attached, so it'd push us over the Artemis // max message size. val bigFile1 = InputStreamAndHash.createInMemoryTestZip(3.MB.toInt(), 0, "a") diff --git a/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt index f3557bf0ba..ac7bc8383e 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt @@ -55,7 +55,7 @@ class VaultObserverExceptionTest { * Causing an SqlException via a syntax error in a vault observer causes the flow to hit the * DatabsaseEndocrinologist in the FlowHospital and being kept for overnight observation */ - @Test + @Test(timeout=300_000) fun unhandledSqlExceptionFromVaultObserverGetsHospitalised() { val testControlFuture = openFuture().toCompletableFuture() @@ -89,7 +89,7 @@ class VaultObserverExceptionTest { * because the recording of transaction states failed. The flow will be hospitalized. * The exception will bring the rx.Observer down. */ - @Test + @Test(timeout=300_000) fun exceptionFromVaultObserverCannotBeSuppressedInFlow() { var observation = 0 val waitUntilHospitalised = Semaphore(0) @@ -117,7 +117,7 @@ class VaultObserverExceptionTest { * because the recording of transaction states failed. The flow will be hospitalized. * The exception will bring the rx.Observer down. */ - @Test + @Test(timeout=300_000) fun runtimeExceptionFromVaultObserverCannotBeSuppressedInFlow() { var observation = 0 val waitUntilHospitalised = Semaphore(0) @@ -127,13 +127,13 @@ class VaultObserverExceptionTest { } driver(DriverParameters( - startNodesInProcess = true, - cordappsForAllNodes = testCordapps())) { + startNodesInProcess = true, + cordappsForAllNodes = testCordapps())) { val aliceUser = User("user", "foo", setOf(Permissions.all())) val aliceNode = startNode(providedName = ALICE_NAME, rpcUsers = listOf(aliceUser)).getOrThrow() aliceNode.rpc.startFlow(::Initiator, "InvalidParameterException", CreateStateFlow.errorTargetsToNum( - CreateStateFlow.ErrorTarget.ServiceThrowInvalidParameter, - CreateStateFlow.ErrorTarget.FlowSwallowErrors)) + CreateStateFlow.ErrorTarget.ServiceThrowInvalidParameter, + CreateStateFlow.ErrorTarget.FlowSwallowErrors)) waitUntilHospitalised.acquire() // wait here until flow gets hospitalised } @@ -144,7 +144,7 @@ class VaultObserverExceptionTest { * If we have a state causing a persistence exception during record transactions (in NodeVaultService#processAndNotify), * the flow will be kept in for observation. */ - @Test + @Test(timeout=300_000) fun persistenceExceptionDuringRecordTransactionsGetsKeptForObservation() { var counter = 0 StaffedFlowHospital.DatabaseEndocrinologist.customConditions.add { @@ -181,7 +181,7 @@ class VaultObserverExceptionTest { * trying to catch and suppress that exception inside the flow does protect the flow, but the new * interceptor will fail the flow anyway. The flow will be kept in for observation. */ - @Test + @Test(timeout=300_000) fun persistenceExceptionDuringRecordTransactionsCannotBeSuppressedInFlow() { var counter = 0 StaffedFlowHospital.DatabaseEndocrinologist.customConditions.add { @@ -215,7 +215,7 @@ class VaultObserverExceptionTest { * therefore handling it in flow code is no good, and the error will be passed to the flow hospital via the * interceptor. */ - @Test + @Test(timeout=300_000) fun syntaxErrorInUserCodeInServiceCannotBeSuppressedInFlow() { val testControlFuture = openFuture() StaffedFlowHospital.onFlowKeptForOvernightObservation.add { _, _ -> @@ -244,7 +244,7 @@ class VaultObserverExceptionTest { * User code throwing a syntax error and catching suppressing that within the observer code is fine * and should not have any impact on the rest of the flow */ - @Test + @Test(timeout=300_000) fun syntaxErrorInUserCodeInServiceCanBeSuppressedInService() { driver(DriverParameters( startNodesInProcess = true, @@ -265,7 +265,7 @@ class VaultObserverExceptionTest { * In case of a SQLException or PersistenceException, this was already "breaking" the database transaction * and therefore, the next checkpoint was failing. */ - @Test + @Test(timeout=300_000) fun `attempt to checkpoint, following an error thrown in vault observer which gets supressed in flow, will fail`() { var counterBeforeFirstCheckpoint = 0 var counterAfterFirstCheckpoint = 0 @@ -281,20 +281,20 @@ class VaultObserverExceptionTest { } driver(DriverParameters( - inMemoryDB = false, - startNodesInProcess = true, - isDebug = true, - cordappsForAllNodes = listOf(findCordapp("com.r3.dbfailure.contracts"), - findCordapp("com.r3.dbfailure.workflows"), - findCordapp("com.r3.transactionfailure.workflows"), - findCordapp("com.r3.dbfailure.schemas")))) { + inMemoryDB = false, + startNodesInProcess = true, + isDebug = true, + cordappsForAllNodes = listOf(findCordapp("com.r3.dbfailure.contracts"), + findCordapp("com.r3.dbfailure.workflows"), + findCordapp("com.r3.transactionfailure.workflows"), + findCordapp("com.r3.dbfailure.schemas")))) { val aliceUser = User("user", "foo", setOf(Permissions.all())) val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(aliceUser)).getOrThrow() node.rpc.startFlow(::CheckpointAfterErrorFlow, CreateStateFlow.errorTargetsToNum( CreateStateFlow.ErrorTarget.ServiceThrowMotherOfAllExceptions, // throw not persistence exception CreateStateFlow.ErrorTarget.FlowSwallowErrors - ) + ) ) waitUntilHospitalised.acquire() @@ -310,7 +310,7 @@ class VaultObserverExceptionTest { } } - @Test + @Test(timeout=300_000) fun `vault observer failing with OnErrorFailedException gets hospitalised`() { DbListenerService.onError = { log.info("Error in rx.Observer#OnError! - Observer will fail with OnErrorFailedException") @@ -325,20 +325,20 @@ class VaultObserverExceptionTest { } driver(DriverParameters( - startNodesInProcess = true, - cordappsForAllNodes = testCordapps())) { + startNodesInProcess = true, + cordappsForAllNodes = testCordapps())) { val aliceUser = User("user", "foo", setOf(Permissions.all())) val aliceNode = startNode(providedName = ALICE_NAME, rpcUsers = listOf(aliceUser)).getOrThrow() aliceNode.rpc.startFlow(::Initiator, "Exception", CreateStateFlow.errorTargetsToNum( - CreateStateFlow.ErrorTarget.ServiceThrowInvalidParameter, - CreateStateFlow.ErrorTarget.FlowSwallowErrors)) + CreateStateFlow.ErrorTarget.ServiceThrowInvalidParameter, + CreateStateFlow.ErrorTarget.FlowSwallowErrors)) waitUntilHospitalised.acquire() // wait here until flow gets hospitalised } Assert.assertEquals(1, observation) } - @Test + @Test(timeout=300_000) fun `out of memory error halts JVM, on node restart flow retries, and succeeds`() { driver(DriverParameters(inMemoryDB = false, cordappsForAllNodes = testCordapps())) { val aliceUser = User("user", "foo", setOf(Permissions.all())) diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/AdditionP2PAddressModeTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/AdditionP2PAddressModeTest.kt index 53a699b97b..05109c0b00 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/AdditionP2PAddressModeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/AdditionP2PAddressModeTest.kt @@ -26,8 +26,8 @@ import java.util.* class AdditionP2PAddressModeTest { private val portAllocation = incrementalPortAllocation() - @Test - fun `runs nodes with one configured to use additionalP2PAddresses`() { + @Test(timeout=300_000) + fun `runs nodes with one configured to use additionalP2PAddresses`() { val testUser = User("test", "test", setOf(all())) driver(DriverParameters(startNodesInProcess = true, inMemoryDB = true, cordappsForAllNodes = FINANCE_CORDAPPS)) { val mainAddress = portAllocation.nextHostAndPort().toString() diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt index df860ef06a..6f95a7964c 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt @@ -37,53 +37,53 @@ class MQSecurityAsNodeTest : P2PMQSecurityTest() { attacker.start(PEER_USER, PEER_USER) // Login as a peer } - @Test - fun `send message to RPC requests address`() { + @Test(timeout=300_000) + fun `send message to RPC requests address`() { assertSendAttackFails(RPCApi.RPC_SERVER_QUEUE_NAME) } - @Test - fun `only the node running the broker can login using the special P2P node user`() { + @Test(timeout=300_000) + fun `only the node running the broker can login using the special P2P node user`() { val attacker = clientTo(alice.node.configuration.p2pAddress) assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy { attacker.start(NODE_P2P_USER, NODE_P2P_USER) } } - @Test - fun `login as the default cluster user`() { + @Test(timeout=300_000) + fun `login as the default cluster user`() { val attacker = clientTo(alice.node.configuration.p2pAddress) assertThatExceptionOfType(ActiveMQClusterSecurityException::class.java).isThrownBy { attacker.start(ActiveMQDefaultConfiguration.getDefaultClusterUser(), ActiveMQDefaultConfiguration.getDefaultClusterPassword()) } } - @Test - fun `login without a username and password`() { + @Test(timeout=300_000) + fun `login without a username and password`() { val attacker = clientTo(alice.node.configuration.p2pAddress) assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy { attacker.start() } } - @Test - fun `login to a non ssl port as a node user`() { + @Test(timeout=300_000) + fun `login to a non ssl port as a node user`() { val attacker = clientTo(alice.node.configuration.rpcOptions.address, sslConfiguration = null) assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy { attacker.start(NODE_P2P_USER, NODE_P2P_USER, enableSSL = false) } } - @Test - fun `login to a non ssl port as a peer user`() { + @Test(timeout=300_000) + fun `login to a non ssl port as a peer user`() { val attacker = clientTo(alice.node.configuration.rpcOptions.address, sslConfiguration = null) assertThatExceptionOfType(ActiveMQSecurityException::class.java).isThrownBy { attacker.start(PEER_USER, PEER_USER, enableSSL = false) // Login as a peer } } - @Test - fun `login with invalid certificate chain`() { + @Test(timeout=300_000) + fun `login with invalid certificate chain`() { val certsDir = Files.createTempDirectory("certs") certsDir.createDirectories() val signingCertStore = CertificateStoreStubs.Signing.withCertificatesDirectory(certsDir) diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsRPCTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsRPCTest.kt index 2d534bddf9..89425882f1 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsRPCTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsRPCTest.kt @@ -11,8 +11,8 @@ class MQSecurityAsRPCTest : RPCMQSecurityTest() { return clientTo(alice.node.configuration.rpcOptions.address) } - @Test - fun `send message on logged in user's RPC address`() { + @Test(timeout=300_000) + fun `send message on logged in user's RPC address`() { val user1Queue = loginToRPCAndGetClientQueue() assertSendAttackFails(user1Queue) } diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt index e98357f75e..92e8c72287 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityTest.kt @@ -66,31 +66,31 @@ abstract class MQSecurityTest : NodeBasedTest() { clients.forEach { it.stop() } } - @Test - fun `create queue for valid RPC user`() { + @Test(timeout=300_000) + fun `create queue for valid RPC user`() { val user1Queue = "${RPCApi.RPC_CLIENT_QUEUE_NAME_PREFIX}.${rpcUser.username}.${random63BitValue()}" assertTempQueueCreationAttackFails(user1Queue) } - @Test - fun `create queue for invalid RPC user`() { + @Test(timeout=300_000) + fun `create queue for invalid RPC user`() { val invalidRPCQueue = "${RPCApi.RPC_CLIENT_QUEUE_NAME_PREFIX}.${random63BitValue()}.${random63BitValue()}" assertTempQueueCreationAttackFails(invalidRPCQueue) } - @Test - fun `send message to notifications address`() { + @Test(timeout=300_000) + fun `send message to notifications address`() { assertSendAttackFails(NOTIFICATIONS_ADDRESS) } - @Test - fun `create random internal queue`() { + @Test(timeout=300_000) + fun `create random internal queue`() { val randomQueue = "$INTERNAL_PREFIX${random63BitValue()}" assertAllQueueCreationAttacksFail(randomQueue) } - @Test - fun `create random queue`() { + @Test(timeout=300_000) + fun `create random queue`() { val randomQueue = random63BitValue().toString() assertAllQueueCreationAttacksFail(randomQueue) } diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMQSecurityTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMQSecurityTest.kt index 223324938b..240ad1007d 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMQSecurityTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMQSecurityTest.kt @@ -14,42 +14,42 @@ import org.junit.Test * the attacker to [alice]. */ abstract class P2PMQSecurityTest : MQSecurityTest() { - @Test - fun `consume message from P2P queue`() { + @Test(timeout=300_000) + fun `consume message from P2P queue`() { assertConsumeAttackFails("$P2P_PREFIX${alice.info.singleIdentity().owningKey.toStringShort()}") } - @Test - fun `consume message from peer queue`() { + @Test(timeout=300_000) + fun `consume message from peer queue`() { val bobParty = startBobAndCommunicateWithAlice() assertConsumeAttackFails("$PEERS_PREFIX${bobParty.owningKey.toStringShort()}") } - @Test - fun `send message to address of peer which has been communicated with`() { + @Test(timeout=300_000) + fun `send message to address of peer which has been communicated with`() { val bobParty = startBobAndCommunicateWithAlice() assertSendAttackFails("$PEERS_PREFIX${bobParty.owningKey.toStringShort()}") } - @Test - fun `create queue for peer which has not been communicated with`() { + @Test(timeout=300_000) + fun `create queue for peer which has not been communicated with`() { val bob = startNode(BOB_NAME) assertAllQueueCreationAttacksFail("$PEERS_PREFIX${bob.info.singleIdentity().owningKey.toStringShort()}") } - @Test - fun `create queue for unknown peer`() { + @Test(timeout=300_000) + fun `create queue for unknown peer`() { val invalidPeerQueue = "$PEERS_PREFIX${generateKeyPair().public.toStringShort()}" assertAllQueueCreationAttacksFail(invalidPeerQueue) } - @Test - fun `consume message from RPC requests queue`() { + @Test(timeout=300_000) + fun `consume message from RPC requests queue`() { assertConsumeAttackFailsNonexistent(RPCApi.RPC_SERVER_QUEUE_NAME) } - @Test - fun `consume message from logged in user's RPC queue`() { + @Test(timeout=300_000) + fun `consume message from logged in user's RPC queue`() { val user1Queue = loginToRPCAndGetClientQueue() assertConsumeAttackFailsNonexistent(user1Queue) } diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt index b6c7e8bcd2..89fd1ca616 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt @@ -31,8 +31,8 @@ class P2PMessagingTest { val DISTRIBUTED_SERVICE_NAME = CordaX500Name("DistributedService", "London", "GB") } - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `communicating with a distributed service which we're part of`() { startDriverWithDistributedService { distributedService -> assertAllNodesAreUsed(distributedService, DISTRIBUTED_SERVICE_NAME, distributedService[0]) diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/RPCMQSecurityTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/RPCMQSecurityTest.kt index 9e0e7bbf09..75dc239a33 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/RPCMQSecurityTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/RPCMQSecurityTest.kt @@ -15,42 +15,42 @@ import org.junit.Test * the attacker to [alice]. */ abstract class RPCMQSecurityTest : MQSecurityTest() { - @Test - fun `consume message from P2P queue`() { + @Test(timeout=300_000) + fun `consume message from P2P queue`() { assertConsumeAttackFailsNonexistent("$P2P_PREFIX${alice.info.singleIdentity().owningKey.toStringShort()}") } - @Test - fun `consume message from peer queue`() { + @Test(timeout=300_000) + fun `consume message from peer queue`() { val bobParty = startBobAndCommunicateWithAlice() assertConsumeAttackFailsNonexistent("$PEERS_PREFIX${bobParty.owningKey.toBase58String()}") } - @Test - fun `send message to address of peer which has been communicated with`() { + @Test(timeout=300_000) + fun `send message to address of peer which has been communicated with`() { val bobParty = startBobAndCommunicateWithAlice() assertConsumeAttackFailsNonexistent("$PEERS_PREFIX${bobParty.owningKey.toBase58String()}") } - @Test - fun `create queue for peer which has not been communicated with`() { + @Test(timeout=300_000) + fun `create queue for peer which has not been communicated with`() { val bob = startNode(BOB_NAME) assertConsumeAttackFailsNonexistent("$PEERS_PREFIX${bob.info.singleIdentity().owningKey.toBase58String()}") } - @Test - fun `create queue for unknown peer`() { + @Test(timeout=300_000) + fun `create queue for unknown peer`() { val invalidPeerQueue = "$PEERS_PREFIX${generateKeyPair().public.toBase58String()}" assertConsumeAttackFailsNonexistent(invalidPeerQueue) } - @Test - fun `consume message from RPC requests queue`() { + @Test(timeout=300_000) + fun `consume message from RPC requests queue`() { assertConsumeAttackFails(RPCApi.RPC_SERVER_QUEUE_NAME) } - @Test - fun `consume message from logged in user's RPC queue`() { + @Test(timeout=300_000) + fun `consume message from logged in user's RPC queue`() { val user1Queue = loginToRPCAndGetClientQueue() assertConsumeAttackFails(user1Queue) } diff --git a/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt b/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt index 13f335374c..69f71f780e 100644 --- a/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt @@ -114,8 +114,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `cash issue accepted`() { + @Test(timeout=300_000) + fun `cash issue accepted`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions( invokeRpc("vaultTrackBy"), invokeRpc("vaultQueryBy"), @@ -170,9 +171,10 @@ class CordaRPCOpsImplTest { } } - @Test + @Test(timeout=300_000) + @Suppress("DEPRECATION") fun `issue and move`() { - @Suppress("DEPRECATION") + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions( invokeRpc(CordaRPCOps::stateMachinesFeed), invokeRpc(CordaRPCOps::internalVerifiedTransactionsFeed), @@ -264,8 +266,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `cash command by user not permissioned for cash`() { + @Test(timeout=300_000) + fun `cash command by user not permissioned for cash`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withoutAnyPermissions { assertThatExceptionOfType(PermissionException::class.java).isThrownBy { rpc.startFlow(::CashIssueFlow, 100.DOLLARS, OpaqueBytes.of(1), notary) @@ -273,8 +276,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `can upload an attachment`() { + @Test(timeout=300_000) + fun `can upload an attachment`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachment), invokeRpc(CordaRPCOps::attachmentExists)) { val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) val secureHash = rpc.uploadAttachment(inputJar) @@ -282,8 +286,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `cannot upload the same attachment`() { + @Test(timeout=300_000) + fun `cannot upload the same attachment`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachment), invokeRpc(CordaRPCOps::attachmentExists)) { val inputJar1 = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) val inputJar2 = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) @@ -294,8 +299,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `can download an uploaded attachment`() { + @Test(timeout=300_000) + fun `can download an uploaded attachment`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachment), invokeRpc(CordaRPCOps::openAttachment)) { val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) val secureHash = rpc.uploadAttachment(inputJar) @@ -309,8 +315,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `can upload attachment with metadata`() { + @Test(timeout=300_000) + fun `can upload attachment with metadata`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachmentWithMetadata), invokeRpc(CordaRPCOps::attachmentExists)) { val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) val secureHash = rpc.uploadAttachmentWithMetadata(inputJar, "Iron Fist", "Season 2") @@ -318,8 +325,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `attachment uploaded with metadata has specified filename`() { + @Test(timeout=300_000) + fun `attachment uploaded with metadata has specified filename`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachmentWithMetadata), invokeRpc(CordaRPCOps::queryAttachments)) { val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) rpc.uploadAttachmentWithMetadata(inputJar, "The Punisher", "Season 1") @@ -336,8 +344,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `attachment uploaded with metadata can be from a privileged user`() { + @Test(timeout=300_000) + fun `attachment uploaded with metadata can be from a privileged user`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachmentWithMetadata), invokeRpc(CordaRPCOps::attachmentExists)) { val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) val secureHash = rpc.uploadAttachmentWithMetadata(inputJar, RPC_UPLOADER, "Season 1") @@ -345,8 +354,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `attachment uploaded with metadata has specified uploader`() { + @Test(timeout=300_000) + fun `attachment uploaded with metadata has specified uploader`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::uploadAttachmentWithMetadata), invokeRpc(CordaRPCOps::queryAttachments)) { val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar) rpc.uploadAttachmentWithMetadata(inputJar, "Daredevil", "Season 3") @@ -363,8 +373,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `attempt to start non-RPC flow`() { + @Test(timeout=300_000) + fun `attempt to start non-RPC flow`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(startFlow()) { assertThatExceptionOfType(NonRpcFlowException::class.java).isThrownBy { rpc.startFlow(::NonRPCFlow) @@ -372,8 +383,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `kill a stuck flow through RPC`() { + @Test(timeout=300_000) + fun `kill a stuck flow through RPC`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions( startFlow(), invokeRpc(CordaRPCOps::killFlow), @@ -387,8 +399,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `kill a waiting flow through RPC`() { + @Test(timeout=300_000) + fun `kill a waiting flow through RPC`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions( startFlow(), invokeRpc(CordaRPCOps::killFlow), @@ -402,8 +415,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `killing a flow releases soft lock`() { + @Test(timeout=300_000) + fun `killing a flow releases soft lock`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(all()) { val issuerRef = OpaqueBytes("BankOfMars".toByteArray()) val cash = rpc.startFlow(::CashIssueFlow, 10.DOLLARS, issuerRef, notary).returnValue.getOrThrow().stx.tx.outRefsOfType().single() @@ -435,8 +449,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `kill a nonexistent flow through RPC`() { + @Test(timeout=300_000) + fun `kill a nonexistent flow through RPC`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) withPermissions(invokeRpc(CordaRPCOps::killFlow)) { val nonexistentFlowId = StateMachineRunId.createRandom() val killed = rpc.killFlow(nonexistentFlowId) @@ -444,8 +459,9 @@ class CordaRPCOpsImplTest { } } - @Test - fun `non-ContractState class for the contractStateType param in vault queries`() { + @Test(timeout=300_000) + fun `non-ContractState class for the contractStateType param in vault queries`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) val nonContractStateClass: Class = uncheckedCast(Cash::class.java) withPermissions(invokeRpc("vaultTrack"), invokeRpc("vaultQuery")) { assertThatThrownBy { rpc.vaultQuery(nonContractStateClass) }.hasMessageContaining(Cash::class.java.name) @@ -453,6 +469,16 @@ class CordaRPCOpsImplTest { } } + @Test(timeout=300_000) + fun `attempt to start RPC flow with void return`() { + CURRENT_RPC_CONTEXT.set(RpcAuthContext(InvocationContext.rpc(testActor()), buildSubject("TEST_USER", emptySet()))) + withPermissions(startFlow()) { + val result = rpc.startFlow(::VoidRPCFlow) + mockNet.runNetwork() + assertNull(result.returnValue.getOrThrow()) + } + } + @StartableByRPC class NewJoinerFlow : FlowLogic() { @Suspendable @@ -477,14 +503,7 @@ class CordaRPCOpsImplTest { override fun call() = Unit } - @Test - fun `attempt to start RPC flow with void return`() { - withPermissions(startFlow()) { - val result = rpc.startFlow(::VoidRPCFlow) - mockNet.runNetwork() - assertNull(result.returnValue.getOrThrow()) - } - } + @StartableByRPC class VoidRPCFlow : FlowLogic() { diff --git a/node/src/test/kotlin/net/corda/node/SerialFilterTests.kt b/node/src/test/kotlin/net/corda/node/SerialFilterTests.kt index 590929715a..939f4a9828 100644 --- a/node/src/test/kotlin/net/corda/node/SerialFilterTests.kt +++ b/node/src/test/kotlin/net/corda/node/SerialFilterTests.kt @@ -8,16 +8,16 @@ import kotlin.test.assertTrue import kotlin.test.fail class SerialFilterTests { - @Test - fun `null and primitives are accepted and arrays are unwrapped`() { + @Test(timeout=300_000) + fun `null and primitives are accepted and arrays are unwrapped`() { val acceptClass = { _: Class<*> -> fail("Should not be invoked.") } listOf(null, Byte::class.javaPrimitiveType, IntArray::class.java, Array::class.java).forEach { assertTrue(SerialFilter.applyPredicate(acceptClass, it)) } } - @Test - fun `the predicate is applied to the componentType`() { + @Test(timeout=300_000) + fun `the predicate is applied to the componentType`() { val classes = mutableListOf>() val acceptClass = { clazz: Class<*> -> classes.add(clazz) diff --git a/node/src/test/kotlin/net/corda/node/internal/AbstractNodeTests.kt b/node/src/test/kotlin/net/corda/node/internal/AbstractNodeTests.kt index d4e6a24186..e6655efd90 100644 --- a/node/src/test/kotlin/net/corda/node/internal/AbstractNodeTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/AbstractNodeTests.kt @@ -29,8 +29,8 @@ class AbstractNodeTests { return "jdbc:h2:file:$baseDir/persistence;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;WRITE_DELAY=100;AUTO_SERVER_PORT=0" } - @Test - fun `logVendorString does not leak connection`() { + @Test(timeout=300_000) + fun `logVendorString does not leak connection`() { // Note this test also covers a transaction that CordaPersistence does while it's instantiating: val database = configureDatabase(hikariProperties(freshURL()), DatabaseConfig(), { null }, { null }) val log = mock() // Don't care what happens here. @@ -40,8 +40,8 @@ class AbstractNodeTests { } } - @Test - fun `H2 fix is applied`() { + @Test(timeout=300_000) + fun `H2 fix is applied`() { val pool = Executors.newFixedThreadPool(5) val runs = if (relaxedThoroughness) 1 else 100 (0 until runs).map { diff --git a/node/src/test/kotlin/net/corda/node/internal/CordaServiceTest.kt b/node/src/test/kotlin/net/corda/node/internal/CordaServiceTest.kt index 3a4387f155..8e76c1ef5c 100644 --- a/node/src/test/kotlin/net/corda/node/internal/CordaServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/CordaServiceTest.kt @@ -44,8 +44,8 @@ class CordaServiceTest { mockNet.stopNodes() } - @Test - fun `Can find distinct services on node`() { + @Test(timeout=300_000) + fun `Can find distinct services on node`() { val service = nodeA.services.cordaService(TestCordaService::class.java) val service2 = nodeA.services.cordaService(TestCordaService2::class.java) val legacyService = nodeA.services.cordaService(LegacyCordaService::class.java) @@ -55,27 +55,27 @@ class CordaServiceTest { assertEquals(LegacyCordaService::class.java, legacyService.javaClass) } - @Test - fun `Can start StartableByService flows`() { + @Test(timeout=300_000) + fun `Can start StartableByService flows`() { val service = nodeA.services.cordaService(TestCordaService::class.java) service.startServiceFlow() } - @Test - fun `Can't start StartableByRPC flows`() { + @Test(timeout=300_000) + fun `Can't start StartableByRPC flows`() { val service = nodeA.services.cordaService(TestCordaService2::class.java) assertFailsWith { service.startInvalidRPCFlow() } } - @Test - fun `Test flow with progress tracking`() { + @Test(timeout=300_000) + fun `Test flow with progress tracking`() { val service = nodeA.services.cordaService(TestCordaService::class.java) service.startServiceFlowAndTrack() } - @Test - fun `Corda service can access a non-null thread context classloader`() { + @Test(timeout=300_000) + fun `Corda service can access a non-null thread context classloader`() { val service = nodeA.services.cordaService(CordaServiceThatRequiresThreadContextClassLoader::class.java) service.thatWeCanAccessClassLoader() } @@ -85,18 +85,18 @@ class CordaServiceTest { * Querying the vault from a services constructor failed because the criteriaBuilder * had not been initialized. */ - @Test - fun `Can query vault service in constructor`() { + @Test(timeout=300_000) + fun `Can query vault service in constructor`() { nodeA.services.cordaService(VaultQueryService::class.java) } - @Test - fun `Can query using jdbc session in constructor`() { + @Test(timeout=300_000) + fun `Can query using jdbc session in constructor`() { nodeA.services.cordaService(JdbcSessionQueryService::class.java) } - @Test - fun `Can use entity manager in constructor`() { + @Test(timeout=300_000) + fun `Can use entity manager in constructor`() { nodeA.services.cordaService(EntityManagerService::class.java) } diff --git a/node/src/test/kotlin/net/corda/node/internal/FlowRegistrationTest.kt b/node/src/test/kotlin/net/corda/node/internal/FlowRegistrationTest.kt index 0bbb43147e..29ec2b4a9b 100644 --- a/node/src/test/kotlin/net/corda/node/internal/FlowRegistrationTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/FlowRegistrationTest.kt @@ -38,15 +38,15 @@ class FlowRegistrationTest { mockNetwork.stopNodes() } - @Test - fun `succeeds when a subclass of a flow initiated by the same flow is registered`() { + @Test(timeout=300_000) + fun `succeeds when a subclass of a flow initiated by the same flow is registered`() { // register the same flow twice to invoke the error without causing errors in other tests responder.registerInitiatedFlow(Responder1::class.java) responder.registerInitiatedFlow(Responder1Subclassed::class.java) } - @Test - fun `a single initiated flow can be registered without error`() { + @Test(timeout=300_000) + fun `a single initiated flow can be registered without error`() { responder.registerInitiatedFlow(Responder1::class.java) val result = initiator.startFlow(Initiator(responder.info.singleIdentity())) mockNetwork.runNetwork() diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeFlowManagerTest.kt b/node/src/test/kotlin/net/corda/node/internal/NodeFlowManagerTest.kt index 25722ef295..ffab3c8e01 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeFlowManagerTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeFlowManagerTest.kt @@ -94,8 +94,8 @@ class NodeFlowManagerTest { Assert.assertThat(flow, `is`(instanceOf(RespSubSub::class.java))) } - @Test - fun `should allow an override to be specified`() { + @Test(timeout=300_000) + fun `should allow an override to be specified`() { val nodeFlowManager = NodeFlowManager(FlowOverrideConfig(listOf(FlowOverride(Init::class.qualifiedName!!, Resp::class.qualifiedName!!)))) nodeFlowManager.registerInitiatedFlow(Init::class.java, Resp::class.java) nodeFlowManager.registerInitiatedFlow(Init::class.java, Resp2::class.java) diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeRestartTests.kt b/node/src/test/kotlin/net/corda/node/internal/NodeRestartTests.kt index 51f1e69bc7..2da7661dd8 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeRestartTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeRestartTests.kt @@ -26,8 +26,8 @@ class NodeRestartTests { mockNet.close() } - @Test - fun `restart with no network map cache update`() { + @Test(timeout=300_000) + fun `restart with no network map cache update`() { val alice = mockNet.createNode(InternalMockNodeParameters(legalName = ALICE_NAME)) val bob = mockNet.createNode(InternalMockNodeParameters(legalName = BOB_NAME)) bob.registerInitiatedFlow(Responder::class.java) diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeStartupCliTest.kt b/node/src/test/kotlin/net/corda/node/internal/NodeStartupCliTest.kt index 3bb81f9ab4..8fc0154f37 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeStartupCliTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeStartupCliTest.kt @@ -24,8 +24,8 @@ class NodeStartupCliTest { } } - @Test - fun `no command line arguments`() { + @Test(timeout=300_000) + fun `no command line arguments`() { CommandLine.populateCommand(startup) Assertions.assertThat(startup.cmdLineOptions.baseDirectory).isEqualTo(workingDirectory) Assertions.assertThat(startup.cmdLineOptions.configFile).isEqualTo(workingDirectory / "node.conf") @@ -42,8 +42,8 @@ class NodeStartupCliTest { Assertions.assertThat(startup.cmdLineOptions.networkRootTrustStorePathParameter).isEqualTo(null) } - @Test - fun `--base-directory`() { + @Test(timeout=300_000) + fun `--base-directory`() { CommandLine.populateCommand(startup, CommonCliConstants.BASE_DIR, (workingDirectory / "another-base-dir").toString()) Assertions.assertThat(startup.cmdLineOptions.baseDirectory).isEqualTo(workingDirectory / "another-base-dir") Assertions.assertThat(startup.cmdLineOptions.configFile).isEqualTo(workingDirectory / "another-base-dir" / "node.conf") diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeStartupTest.kt b/node/src/test/kotlin/net/corda/node/internal/NodeStartupTest.kt index c713eb58b1..ccaa925268 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeStartupTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeStartupTest.kt @@ -9,8 +9,8 @@ import kotlin.concurrent.thread import kotlin.test.assertFailsWith class NodeStartupTest { - @Test - fun `test that you cant start two nodes in the same directory`() { + @Test(timeout=300_000) + fun `test that you cant start two nodes in the same directory`() { val dir = Files.createTempDir().toPath() val latch = CountDownLatch(1) diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt b/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt index 1238021e9c..36c24b700b 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt @@ -62,8 +62,8 @@ class NodeTest { } } - @Test - fun `generateAndSaveNodeInfo works`() { + @Test(timeout=300_000) + fun `generateAndSaveNodeInfo works`() { val configuration = createConfig(ALICE_NAME) val info = VersionInfo(789, "3.0", "SNAPSHOT", "R3") configureDatabase(configuration.dataSourceProperties, configuration.database, { null }, { null }).use { @@ -72,8 +72,8 @@ class NodeTest { } } - @Test - fun `clear network map cache works`() { + @Test(timeout=300_000) + fun `clear network map cache works`() { val configuration = createConfig(ALICE_NAME) val (nodeInfo, _) = createNodeInfoAndSigned(ALICE_NAME) configureDatabase(configuration.dataSourceProperties, configuration.database, { null }, { null }).use { @@ -99,8 +99,8 @@ class NodeTest { } } - @Test - fun `Node can start with multiple keypairs for its identity`() { + @Test(timeout=300_000) + fun `Node can start with multiple keypairs for its identity`() { val configuration = createConfig(ALICE_NAME) val (nodeInfo1, _) = createNodeInfoAndSigned(ALICE_NAME) val (nodeInfo2, _) = createNodeInfoAndSigned(ALICE_NAME) @@ -148,15 +148,15 @@ class NodeTest { } // JDK 11 check - @Test - fun `test getJavaRuntimeVersion`() { + @Test(timeout=300_000) + fun `test getJavaRuntimeVersion`() { assertTrue(SystemUtils.IS_JAVA_1_8 || SystemUtils.IS_JAVA_11) } // JDK11: revisit (JDK 9+ uses different numbering scheme: see https://docs.oracle.com/javase/9/docs/api/java/lang/Runtime.Version.html) @Ignore - @Test - fun `test getJavaUpdateVersion`() { + @Test(timeout=300_000) + fun `test getJavaUpdateVersion`() { assertThat(getJavaUpdateVersion("1.8.0_202-ea")).isEqualTo(202) assertThat(getJavaUpdateVersion("1.8.0_202")).isEqualTo(202) assertFailsWith { getJavaUpdateVersion("1.8.0_202wrong-format") } diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeUnloadHandlerTests.kt b/node/src/test/kotlin/net/corda/node/internal/NodeUnloadHandlerTests.kt index 336fcf4f67..9c0dacf56c 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeUnloadHandlerTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeUnloadHandlerTests.kt @@ -25,8 +25,8 @@ class NodeUnloadHandlerTests { mockNet.stopNodes() } - @Test - fun `should be able to register run on stop lambda`() { + @Test(timeout=300_000) + fun `should be able to register run on stop lambda`() { val node = mockNet.createNode() registerLatch.await() // Make sure the handler is registered on node start up node.dispose() diff --git a/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappConfigFileProviderTests.kt b/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappConfigFileProviderTests.kt index 73829d5a8c..b9633d3c0b 100644 --- a/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappConfigFileProviderTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappConfigFileProviderTests.kt @@ -23,21 +23,21 @@ class CordappConfigFileProviderTests { private val provider = CordappConfigFileProvider(listOf(cordappDir)) - @Test - fun `test that config can be loaded`() { + @Test(timeout=300_000) + fun `test that config can be loaded`() { writeConfig(validConfig) assertThat(provider.getConfigByName(cordappName)).isEqualTo(validConfig) } - @Test - fun `config is idempotent if the underlying file is not changed`() { + @Test(timeout=300_000) + fun `config is idempotent if the underlying file is not changed`() { writeConfig(validConfig) assertThat(provider.getConfigByName(cordappName)).isEqualTo(validConfig) assertThat(provider.getConfigByName(cordappName)).isEqualTo(validConfig) } - @Test - fun `config is not idempotent if the underlying file is changed`() { + @Test(timeout=300_000) + fun `config is not idempotent if the underlying file is changed`() { writeConfig(validConfig) assertThat(provider.getConfigByName(cordappName)).isEqualTo(validConfig) diff --git a/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt b/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt index d1594b5ecb..ed38ebd7af 100644 --- a/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt @@ -63,8 +63,8 @@ class CordappProviderImplTests { attachmentStore = MockAttachmentStorage() } - @Test - fun `isolated jar is loaded into the attachment store`() { + @Test(timeout=300_000) + fun `isolated jar is loaded into the attachment store`() { val provider = newCordappProvider(isolatedJAR) val maybeAttachmentId = provider.getCordappAttachmentId(provider.cordapps.first()) @@ -72,14 +72,14 @@ class CordappProviderImplTests { assertNotNull(attachmentStore.openAttachment(maybeAttachmentId!!)) } - @Test - fun `empty jar is not loaded into the attachment store`() { + @Test(timeout=300_000) + fun `empty jar is not loaded into the attachment store`() { val provider = newCordappProvider(emptyJAR) assertNull(provider.getCordappAttachmentId(provider.cordapps.first())) } - @Test - fun `test that we find a cordapp class that is loaded into the store`() { + @Test(timeout=300_000) + fun `test that we find a cordapp class that is loaded into the store`() { val provider = newCordappProvider(isolatedJAR) val className = "net.corda.isolated.contracts.AnotherDummyContract" @@ -90,8 +90,8 @@ class CordappProviderImplTests { assertEquals(expected, actual) } - @Test - fun `test that we find an attachment for a cordapp contract class`() { + @Test(timeout=300_000) + fun `test that we find an attachment for a cordapp contract class`() { val provider = newCordappProvider(isolatedJAR) val className = "net.corda.isolated.contracts.AnotherDummyContract" val expected = provider.getAppContext(provider.cordapps.first()).attachmentId @@ -101,8 +101,8 @@ class CordappProviderImplTests { assertEquals(actual!!, expected) } - @Test - fun `test cordapp configuration`() { + @Test(timeout=300_000) + fun `test cordapp configuration`() { val configProvider = MockCordappConfigProvider() configProvider.cordappConfigs[isolatedCordappName] = validConfig val loader = JarScanningCordappLoader.fromJarUrls(listOf(isolatedJAR), VersionInfo.UNKNOWN) @@ -113,8 +113,8 @@ class CordappProviderImplTests { assertThat(expected.getString("key")).isEqualTo("value") } - @Test - fun `test fixup rule that adds attachment`() { + @Test(timeout=300_000) + fun `test fixup rule that adds attachment`() { val fixupJar = File.createTempFile("fixup", ".jar") .writeFixupRules("$ID1 => $ID2, $ID3") val fixedIDs = with(newCordappProvider(fixupJar.toURI().toURL())) { @@ -124,8 +124,8 @@ class CordappProviderImplTests { assertThat(fixedIDs).containsExactly(ID2, ID3) } - @Test - fun `test fixup rule that deletes attachment`() { + @Test(timeout=300_000) + fun `test fixup rule that deletes attachment`() { val fixupJar = File.createTempFile("fixup", ".jar") .writeFixupRules("$ID1 =>") val fixedIDs = with(newCordappProvider(fixupJar.toURI().toURL())) { @@ -135,8 +135,8 @@ class CordappProviderImplTests { assertThat(fixedIDs).isEmpty() } - @Test - fun `test fixup rule with blank LHS`() { + @Test(timeout=300_000) + fun `test fixup rule with blank LHS`() { val fixupJar = File.createTempFile("fixup", ".jar") .writeFixupRules(" => $ID2") val ex = assertFailsWith { @@ -147,8 +147,8 @@ class CordappProviderImplTests { ) } - @Test - fun `test fixup rule without arrows`() { + @Test(timeout=300_000) + fun `test fixup rule without arrows`() { val rule = " $ID1 " val fixupJar = File.createTempFile("fixup", ".jar") .writeFixupRules(rule) @@ -160,8 +160,8 @@ class CordappProviderImplTests { ) } - @Test - fun `test fixup rule with too many arrows`() { + @Test(timeout=300_000) + fun `test fixup rule with too many arrows`() { val rule = " $ID1 => $ID2 => $ID3 " val fixupJar = File.createTempFile("fixup", ".jar") .writeFixupRules(rule) @@ -173,8 +173,8 @@ class CordappProviderImplTests { ) } - @Test - fun `test fixup file containing multiple rules and comments`() { + @Test(timeout=300_000) + fun `test fixup file containing multiple rules and comments`() { val fixupJar = File.createTempFile("fixup", ".jar").writeFixupRules( "# Whole line comment", "\t$ID1,$ID2 => $ID2,, $ID3 # EOl comment", diff --git a/node/src/test/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoaderTest.kt b/node/src/test/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoaderTest.kt index b2f5d9acdd..fa98ff7e59 100644 --- a/node/src/test/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoaderTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoaderTest.kt @@ -40,15 +40,15 @@ class JarScanningCordappLoaderTest { const val isolatedFlowName = "net.corda.isolated.workflows.IsolatedIssuanceFlow" } - @Test - fun `classes that aren't in cordapps aren't loaded`() { + @Test(timeout=300_000) + fun `classes that aren't in cordapps aren't loaded`() { // Basedir will not be a corda node directory so the dummy flow shouldn't be recognised as a part of a cordapp val loader = JarScanningCordappLoader.fromDirectories(listOf(Paths.get("."))) assertThat(loader.cordapps).isEmpty() } - @Test - fun `isolated JAR contains a CorDapp with a contract and plugin`() { + @Test(timeout=300_000) + fun `isolated JAR contains a CorDapp with a contract and plugin`() { val isolatedJAR = JarScanningCordappLoaderTest::class.java.getResource("/isolated.jar") val loader = JarScanningCordappLoader.fromJarUrls(listOf(isolatedJAR)) @@ -65,8 +65,8 @@ class JarScanningCordappLoaderTest { assertThat(actualCordapp.jarPath).isEqualTo(isolatedJAR) } - @Test - fun `constructed CordappImpl contains the right cordapp classes`() { + @Test(timeout=300_000) + fun `constructed CordappImpl contains the right cordapp classes`() { val isolatedJAR = JarScanningCordappLoaderTest::class.java.getResource("/isolated.jar") val loader = JarScanningCordappLoader.fromJarUrls(listOf(isolatedJAR)) @@ -77,8 +77,8 @@ class JarScanningCordappLoaderTest { assertThat(cordappClasses).containsAll(serializationWhitelistedClasses) } - @Test - fun `flows are loaded by loader`() { + @Test(timeout=300_000) + fun `flows are loaded by loader`() { val jarFile = cordappWithPackages(javaClass.packageName_).jarFile val loader = JarScanningCordappLoader.fromJarUrls(listOf(jarFile.toUri().toURL())) @@ -93,8 +93,8 @@ class JarScanningCordappLoaderTest { // This test exists because the appClassLoader is used by serialisation and we need to ensure it is the classloader // being used internally. Later iterations will use a classloader per cordapp and this test can be retired. - @Test - fun `cordapp classloader can load cordapp classes`() { + @Test(timeout=300_000) + fun `cordapp classloader can load cordapp classes`() { val isolatedJAR = JarScanningCordappLoaderTest::class.java.getResource("/isolated.jar") val loader = JarScanningCordappLoader.fromJarUrls(listOf(isolatedJAR), VersionInfo.UNKNOWN) @@ -102,8 +102,8 @@ class JarScanningCordappLoaderTest { loader.appClassLoader.loadClass(isolatedFlowName) } - @Test - fun `cordapp classloader sets target and min version to 1 if not specified`() { + @Test(timeout=300_000) + fun `cordapp classloader sets target and min version to 1 if not specified`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("versions/no-min-or-target-version.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), VersionInfo.UNKNOWN) loader.cordapps.forEach { @@ -112,8 +112,8 @@ class JarScanningCordappLoaderTest { } } - @Test - fun `cordapp classloader returns correct values for minPlatformVersion and targetVersion`() { + @Test(timeout=300_000) + fun `cordapp classloader returns correct values for minPlatformVersion and targetVersion`() { // load jar with min and target version in manifest // make sure classloader extracts correct values val jar = JarScanningCordappLoaderTest::class.java.getResource("versions/min-2-target-3.jar")!! @@ -123,8 +123,8 @@ class JarScanningCordappLoaderTest { assertThat(cordapp.minimumPlatformVersion).isEqualTo(2) } - @Test - fun `cordapp classloader sets target version to min version if target version is not specified`() { + @Test(timeout=300_000) + fun `cordapp classloader sets target version to min version if target version is not specified`() { // load jar with minVersion but not targetVersion in manifest val jar = JarScanningCordappLoaderTest::class.java.getResource("versions/min-2-no-target.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), VersionInfo.UNKNOWN) @@ -134,43 +134,43 @@ class JarScanningCordappLoaderTest { assertThat(cordapp.minimumPlatformVersion).isEqualTo(2) } - @Test - fun `cordapp classloader does not load apps when their min platform version is greater than the node platform version`() { + @Test(timeout=300_000) + fun `cordapp classloader does not load apps when their min platform version is greater than the node platform version`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("versions/min-2-no-target.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), VersionInfo.UNKNOWN.copy(platformVersion = 1)) assertThat(loader.cordapps).hasSize(0) } - @Test - fun `cordapp classloader does load apps when their min platform version is less than the platform version`() { + @Test(timeout=300_000) + fun `cordapp classloader does load apps when their min platform version is less than the platform version`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("versions/min-2-target-3.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), VersionInfo.UNKNOWN.copy(platformVersion = 1000)) assertThat(loader.cordapps).hasSize(1) } - @Test - fun `cordapp classloader does load apps when their min platform version is equal to the platform version`() { + @Test(timeout=300_000) + fun `cordapp classloader does load apps when their min platform version is equal to the platform version`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("versions/min-2-target-3.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), VersionInfo.UNKNOWN.copy(platformVersion = 2)) assertThat(loader.cordapps).hasSize(1) } - @Test - fun `cordapp classloader loads app signed by allowed certificate`() { + @Test(timeout=300_000) + fun `cordapp classloader loads app signed by allowed certificate`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("signed/signed-by-dev-key.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), cordappsSignerKeyFingerprintBlacklist = emptyList()) assertThat(loader.cordapps).hasSize(1) } - @Test - fun `cordapp classloader does not load app signed by blacklisted certificate`() { + @Test(timeout=300_000) + fun `cordapp classloader does not load app signed by blacklisted certificate`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("signed/signed-by-dev-key.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), cordappsSignerKeyFingerprintBlacklist = DEV_PUB_KEY_HASHES) assertThat(loader.cordapps).hasSize(0) } - @Test - fun `cordapp classloader loads app signed by both allowed and non-blacklisted certificate`() { + @Test(timeout=300_000) + fun `cordapp classloader loads app signed by both allowed and non-blacklisted certificate`() { val jar = JarScanningCordappLoaderTest::class.java.getResource("signed/signed-by-two-keys.jar")!! val loader = JarScanningCordappLoader.fromJarUrls(listOf(jar), cordappsSignerKeyFingerprintBlacklist = DEV_PUB_KEY_HASHES) assertThat(loader.cordapps).hasSize(1) diff --git a/node/src/test/kotlin/net/corda/node/internal/cordapp/TypesafeCordappConfigTests.kt b/node/src/test/kotlin/net/corda/node/internal/cordapp/TypesafeCordappConfigTests.kt index 6a966ea4b0..a69d29abbe 100644 --- a/node/src/test/kotlin/net/corda/node/internal/cordapp/TypesafeCordappConfigTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/cordapp/TypesafeCordappConfigTests.kt @@ -6,8 +6,8 @@ import org.junit.Test import org.assertj.core.api.Assertions.assertThat class TypesafeCordappConfigTests { - @Test - fun `test that all value types can be retrieved`() { + @Test(timeout=300_000) + fun `test that all value types can be retrieved`() { val config = ConfigFactory.parseString("string=string\nint=1\nfloat=1.0\ndouble=1.0\nnumber=2\ndouble=1.01\nbool=false") val cordappConf = TypesafeCordappConfig(config) @@ -20,16 +20,16 @@ class TypesafeCordappConfigTests { assertThat(cordappConf.getBoolean("bool")).isEqualTo(false) } - @Test - fun `test a nested path`() { + @Test(timeout=300_000) + fun `test a nested path`() { val config = ConfigFactory.parseString("outer: { inner: string }") val cordappConf = TypesafeCordappConfig(config) assertThat(cordappConf.getString("outer.inner")).isEqualTo("string") } - @Test - fun `test exists determines existence and lack of existence correctly`() { + @Test(timeout=300_000) + fun `test exists determines existence and lack of existence correctly`() { val config = ConfigFactory.parseString("exists=exists") val cordappConf = TypesafeCordappConfig(config) diff --git a/node/src/test/kotlin/net/corda/node/internal/rpc/proxies/ThreadContextAdjustingRpcOpsProxyTest.kt b/node/src/test/kotlin/net/corda/node/internal/rpc/proxies/ThreadContextAdjustingRpcOpsProxyTest.kt index 1bf962e169..bf23068664 100644 --- a/node/src/test/kotlin/net/corda/node/internal/rpc/proxies/ThreadContextAdjustingRpcOpsProxyTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/rpc/proxies/ThreadContextAdjustingRpcOpsProxyTest.kt @@ -18,8 +18,8 @@ class ThreadContextAdjustingRpcOpsProxyTest { fun getThreadContextClassLoader(): ClassLoader = Thread.currentThread().contextClassLoader } - @Test - fun verifyThreadContextIsAdjustedTemporarily() { + @Test(timeout=300_000) + fun verifyThreadContextIsAdjustedTemporarily() { `when`(coreOps.killFlow(any())).thenAnswer { assertThat(Thread.currentThread().contextClassLoader).isEqualTo(mockClassloader) true diff --git a/node/src/test/kotlin/net/corda/node/internal/security/PasswordTest.kt b/node/src/test/kotlin/net/corda/node/internal/security/PasswordTest.kt index ccdf750343..12ca72e2ca 100644 --- a/node/src/test/kotlin/net/corda/node/internal/security/PasswordTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/security/PasswordTest.kt @@ -8,8 +8,8 @@ import org.junit.Test internal class PasswordTest { - @Test - fun immutability() { + @Test(timeout=300_000) + fun immutability() { val charArray = "dadada".toCharArray() val password = Password(charArray) @@ -23,8 +23,8 @@ internal class PasswordTest { assertThat(password.value, not(equalTo(value))) } - @Test - fun constructor_and_getters() { + @Test(timeout=300_000) + fun constructor_and_getters() { val value = "dadada" @@ -35,8 +35,8 @@ internal class PasswordTest { assertThat(Password(value).valueAsString, equalTo(value)) } - @Test - fun equals() { + @Test(timeout=300_000) + fun equals() { val passwordValue1 = Password("value1") val passwordValue2 = Password("value2") @@ -51,8 +51,8 @@ internal class PasswordTest { assertThat(passwordValue12, equalTo(passwordValue1)) } - @Test - fun hashcode() { + @Test(timeout=300_000) + fun hashcode() { val passwordValue1 = Password("value1") val passwordValue2 = Password("value2") @@ -68,8 +68,8 @@ internal class PasswordTest { assertThat(passwordValue12.hashCode(), equalTo(passwordValue1.hashCode())) } - @Test - fun close() { + @Test(timeout=300_000) + fun close() { val value = "ipjd1@pijmps112112" val password = Password(value) @@ -83,8 +83,8 @@ internal class PasswordTest { assertThat(readValue, not(equalTo(value))) } - @Test - fun toString_is_masked() { + @Test(timeout=300_000) + fun toString_is_masked() { val value = "ipjd1@pijmps112112" val password = Password(value) diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt b/node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt index 2ef73e042f..af1739b3c1 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt @@ -56,8 +56,8 @@ class RoundTripObservableSerializerTests { return Caffeine.newBuilder().weakValues().removalListener(onObservableRemove).executor(SameThreadExecutor.getExecutor()).build() } - @Test - fun roundTripTest1() { + @Test(timeout=300_000) + fun roundTripTest1() { val serializationScheme = AMQPRoundTripRPCSerializationScheme( serializationContext, emptySet(), emptySet(), AccessOrderLinkedHashMap(128).toSynchronised()) diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt b/node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt index 30e764e3ce..dad905cae4 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt @@ -32,8 +32,8 @@ class RpcServerObservableSerializerTests { return subMap } - @Test - fun canSerializerBeRegistered() { + @Test(timeout=300_000) + fun canSerializerBeRegistered() { val sf = SerializerFactoryBuilder.build(AllWhitelist, javaClass.classLoader) try { @@ -43,8 +43,8 @@ class RpcServerObservableSerializerTests { } } - @Test - fun canAssociateWithContext() { + @Test(timeout=300_000) + fun canAssociateWithContext() { val observable = TestObservableContext( subscriptionMap(), clientAddressToObservables = ConcurrentHashMap(), @@ -58,8 +58,8 @@ class RpcServerObservableSerializerTests { assertEquals(observable, newContext.properties[RpcServerObservableSerializer.RpcObservableContextKey]) } - @Test - fun serialiseFakeObservable() { + @Test(timeout=300_000) + fun serialiseFakeObservable() { val testClientAddress = "clientAddres" val observable = TestObservableContext( subscriptionMap(), diff --git a/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt b/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt index a11e44c844..e25308e5ec 100644 --- a/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt +++ b/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt @@ -92,8 +92,8 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { LogHelper.reset("platform.trade", "core.contract.TransactionGroup", "recordingmap") } - @Test - fun `trade cash for commercial paper`() { + @Test(timeout=300_000) + fun `trade cash for commercial paper`() { // We run this in parallel threads to help catch any race conditions that may exist. The other tests // we run in the unit test thread exclusively to speed things up, ensure deterministic results and // allow interruption half way through. @@ -201,8 +201,8 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { } } - @Test - fun `shutdown and restore`() { + @Test(timeout=300_000) + fun `shutdown and restore`() { mockNet = InternalMockNetwork(cordappsForAllNodes = listOf(FINANCE_CONTRACTS_CORDAPP)) val notaryNode = mockNet.defaultNotaryNode val notary = mockNet.defaultNotaryIdentity @@ -310,8 +310,8 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { }) } - @Test - fun `check dependencies of sale asset are resolved`() { + @Test(timeout=300_000) + fun `check dependencies of sale asset are resolved`() { mockNet = InternalMockNetwork(cordappsForAllNodes = listOf(FINANCE_CONTRACTS_CORDAPP)) val notaryNode = mockNet.defaultNotaryNode val aliceNode = makeNodeWithTracking(ALICE_NAME) @@ -413,8 +413,8 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { } } - @Test - fun `track works`() { + @Test(timeout=300_000) + fun `track works`() { mockNet = InternalMockNetwork(cordappsForAllNodes = listOf(FINANCE_CONTRACTS_CORDAPP)) val notaryNode = mockNet.defaultNotaryNode val aliceNode = makeNodeWithTracking(ALICE_NAME) @@ -490,16 +490,16 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { } } - @Test - fun `dependency with error on buyer side`() { + @Test(timeout=300_000) + fun `dependency with error on buyer side`() { mockNet = InternalMockNetwork(cordappsForAllNodes = listOf(FINANCE_CONTRACTS_CORDAPP)) mockNet.defaultNotaryNode.services.ledger(mockNet.defaultNotaryIdentity) { runWithError(true, false, "at least one cash input") } } - @Test - fun `dependency with error on seller side`() { + @Test(timeout=300_000) + fun `dependency with error on seller side`() { mockNet = InternalMockNetwork(cordappsForAllNodes = listOf(FINANCE_CONTRACTS_CORDAPP)) mockNet.defaultNotaryNode.services.ledger(mockNet.defaultNotaryIdentity) { runWithError(false, true, "Issuances have a time-window") diff --git a/node/src/test/kotlin/net/corda/node/migration/IdentityServiceToStringShortMigrationTest.kt b/node/src/test/kotlin/net/corda/node/migration/IdentityServiceToStringShortMigrationTest.kt index 97d66b9a60..c539a83a07 100644 --- a/node/src/test/kotlin/net/corda/node/migration/IdentityServiceToStringShortMigrationTest.kt +++ b/node/src/test/kotlin/net/corda/node/migration/IdentityServiceToStringShortMigrationTest.kt @@ -76,8 +76,8 @@ class IdentityServiceToStringShortMigrationTest { } } - @Test - fun `it should be possible to migrate all existing identities to new hash function`() { + @Test(timeout=300_000) + fun `it should be possible to migrate all existing identities to new hash function`() { val identities = listOf(BOB_IDENTITY, ALICE_IDENTITY, BOC_IDENTITY, dummyNotary.identity, BOB2_IDENTITY) val groupedByNameIdentities = identities.groupBy { it.name } saveAllIdentitiesWithOldHashString(identities) diff --git a/node/src/test/kotlin/net/corda/node/migration/PersistentIdentityMigrationNewTableTest.kt b/node/src/test/kotlin/net/corda/node/migration/PersistentIdentityMigrationNewTableTest.kt index 3f127cd752..2aaf1e9cca 100644 --- a/node/src/test/kotlin/net/corda/node/migration/PersistentIdentityMigrationNewTableTest.kt +++ b/node/src/test/kotlin/net/corda/node/migration/PersistentIdentityMigrationNewTableTest.kt @@ -84,8 +84,8 @@ class PersistentIdentityMigrationNewTableTest{ cordaDB.close() } - @Test - fun `migrate identities to new table`() { + @Test(timeout=300_000) + fun `migrate identities to new table`() { val pkHash = addTestMapping(cordaDB.dataSource.connection, alice) PersistentIdentityMigrationNewTable() verifyTestMigration(cordaDB.dataSource.connection, pkHash, alice.name.toString()) diff --git a/node/src/test/kotlin/net/corda/node/migration/VaultStateMigrationTest.kt b/node/src/test/kotlin/net/corda/node/migration/VaultStateMigrationTest.kt index bb99743785..71c86eb113 100644 --- a/node/src/test/kotlin/net/corda/node/migration/VaultStateMigrationTest.kt +++ b/node/src/test/kotlin/net/corda/node/migration/VaultStateMigrationTest.kt @@ -354,8 +354,8 @@ class VaultStateMigrationTest { } } - @Test - fun `Check a simple migration works`() { + @Test(timeout=300_000) + fun `Check a simple migration works`() { addCashStates(10, BOB) addCashStates(10, ALICE) assertEquals(20, getVaultStateCount()) @@ -367,8 +367,8 @@ class VaultStateMigrationTest { assertEquals(10, getVaultStateCount(Vault.RelevancyStatus.RELEVANT)) } - @Test - fun `Check state paging works`() { + @Test(timeout=300_000) + fun `Check state paging works`() { addCashStates(1010, BOB) assertEquals(0, getStatePartyCount()) @@ -379,8 +379,8 @@ class VaultStateMigrationTest { assertEquals(0, getVaultStateCount(Vault.RelevancyStatus.NOT_RELEVANT)) } - @Test - fun `Check state fields are correct`() { + @Test(timeout=300_000) + fun `Check state fields are correct`() { val tx = createCashTransaction(Cash(), 100.DOLLARS, ALICE) storeTransaction(tx) createVaultStatesFromTransaction(tx) @@ -409,8 +409,8 @@ class VaultStateMigrationTest { assertEquals(expectedPersistentParty.compositeKey, persistentStateParty.compositeKey) } - @Test - fun `Check the connection is open post migration`() { + @Test(timeout=300_000) + fun `Check the connection is open post migration`() { // Liquibase automatically closes the database connection when doing an actual migration. This test ensures the custom migration // leaves it open. addCashStates(12, ALICE) @@ -420,8 +420,8 @@ class VaultStateMigrationTest { assertFalse(cordaDB.dataSource.connection.isClosed) } - @Test - fun `All parties added to state party table`() { + @Test(timeout=300_000) + fun `All parties added to state party table`() { val stx = createLinearStateTransaction("test", parties = listOf(ALICE, BOB, CHARLIE)) storeTransaction(stx) createVaultStatesFromTransaction(stx) @@ -433,8 +433,8 @@ class VaultStateMigrationTest { assertEquals(0, getVaultStateCount(Vault.RelevancyStatus.NOT_RELEVANT)) } - @Test - fun `State with corresponding transaction missing fails migration`() { + @Test(timeout=300_000) + fun `State with corresponding transaction missing fails migration`() { val cash = Cash() val unknownTx = createCashTransaction(cash, 100.DOLLARS, BOB) createVaultStatesFromTransaction(unknownTx) @@ -450,8 +450,8 @@ class VaultStateMigrationTest { assertEquals(11, getStatePartyCount()) } - @Test - fun `State with unknown ID is handled correctly`() { + @Test(timeout=300_000) + fun `State with unknown ID is handled correctly`() { addCashStates(1, CHARLIE) addCashStates(10, BOB) val migration = VaultStateMigration() @@ -468,8 +468,8 @@ class VaultStateMigrationTest { migration.execute(null) } - @Test - fun `State with non-owning key for our name marked as relevant`() { + @Test(timeout=300_000) + fun `State with non-owning key for our name marked as relevant`() { val tx = createCashTransaction(Cash(), 100.DOLLARS, BOB2) storeTransaction(tx) createVaultStatesFromTransaction(tx) @@ -490,8 +490,8 @@ class VaultStateMigrationTest { checkStatesEqual(expectedPersistentState, persistentState) } - @Test - fun `State already in state party table is excluded`() { + @Test(timeout=300_000) + fun `State already in state party table is excluded`() { val tx = createCashTransaction(Cash(), 100.DOLLARS, BOB) storeTransaction(tx) createVaultStatesFromTransaction(tx) @@ -503,8 +503,8 @@ class VaultStateMigrationTest { assertEquals(6, getStatePartyCount()) } - @Test - fun `Consumed states are not migrated`() { + @Test(timeout=300_000) + fun `Consumed states are not migrated`() { addCashStates(1010, BOB, Vault.StateStatus.CONSUMED) assertEquals(0, getStatePartyCount()) val migration = VaultStateMigration() @@ -512,8 +512,8 @@ class VaultStateMigrationTest { assertEquals(0, getStatePartyCount()) } - @Test - fun `State created with notary change transaction can be migrated`() { + @Test(timeout=300_000) + fun `State created with notary change transaction can be migrated`() { // This test is a little bit of a hack - it checks that these states are migrated correctly by looking at params in the database, // but these will not be there for V3 nodes. Handling for this must be tested manually. val cashTx = createCashTransaction(Cash(), 5.DOLLARS, BOB) @@ -531,8 +531,8 @@ class VaultStateMigrationTest { } // Used to test migration performance - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `Migrate large database`() { val statesAtOnce = 500L val stateMultiplier = 300L @@ -556,8 +556,8 @@ class VaultStateMigrationTest { } // Used to generate a persistent database for further testing. - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `Create persistent DB`() { val cashStatesToAdd = 1000 val linearStatesToAdd = 0 @@ -583,8 +583,8 @@ class VaultStateMigrationTest { cordaDB.close() } - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `Run on persistent DB`() { cordaDB = configureDatabase(makePersistentDataSourceProperties(), DatabaseConfig(), notaryServices.identityService::wellKnownPartyFromX500Name, notaryServices.identityService::wellKnownPartyFromAnonymous) val connection = (liquibaseDB.connection as JdbcConnection) diff --git a/node/src/test/kotlin/net/corda/node/modes/draining/ScheduledFlowsDrainingModeTest.kt b/node/src/test/kotlin/net/corda/node/modes/draining/ScheduledFlowsDrainingModeTest.kt index 5c0fe3f861..c856384243 100644 --- a/node/src/test/kotlin/net/corda/node/modes/draining/ScheduledFlowsDrainingModeTest.kt +++ b/node/src/test/kotlin/net/corda/node/modes/draining/ScheduledFlowsDrainingModeTest.kt @@ -58,8 +58,8 @@ class ScheduledFlowsDrainingModeTest { executor!!.shutdown() } - @Test - fun `flows draining mode ignores scheduled flows until unset`() { + @Test(timeout=300_000) + fun `flows draining mode ignores scheduled flows until unset`() { val latch = CountDownLatch(1) var shouldFail = true diff --git a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt b/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt index b853da3d99..67f7762129 100644 --- a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt +++ b/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt @@ -24,8 +24,8 @@ class KryoStreamsTest { } } - @Test - fun `substitute output works`() { + @Test(timeout=300_000) + fun `substitute output works`() { assertArrayEquals(byteArrayOf(100, -101), kryoOutput { write(100) substitute(KryoStreamsTest::NegOutputStream) @@ -33,8 +33,8 @@ class KryoStreamsTest { }) } - @Test - fun `substitute input works`() { + @Test(timeout=300_000) + fun `substitute input works`() { kryoInput(byteArrayOf(100, 101).inputStream()) { assertEquals(100, read()) substitute(KryoStreamsTest::NegInputStream) @@ -43,8 +43,8 @@ class KryoStreamsTest { } } - @Test - fun `zip round-trip`() { + @Test(timeout=300_000) + fun `zip round-trip`() { val data = ByteArray(12345).also { Random(0).nextBytes(it) } val encoded = kryoOutput { write(data) @@ -63,8 +63,8 @@ class KryoStreamsTest { } } - @Test - fun `ByteBufferOutputStream works`() { + @Test(timeout=300_000) + fun `ByteBufferOutputStream works`() { val stream = ByteBufferOutputStream(3) stream.write("abc".toByteArray()) val getBuf = stream.declaredField(ByteArrayOutputStream::class, "buf")::value @@ -85,8 +85,8 @@ class KryoStreamsTest { assertArrayEquals("abc0123456789def".toByteArray(), stream.toByteArray()) } - @Test - fun `ByteBufferOutputStream discards data after final position`() { + @Test(timeout=300_000) + fun `ByteBufferOutputStream discards data after final position`() { val stream = ByteBufferOutputStream(0) stream.alsoAsByteBuffer(10) { it.put("0123456789".toByteArray()) diff --git a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt b/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt index dc001d5498..02688df506 100644 --- a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt +++ b/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt @@ -67,23 +67,23 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { }) } - @Test - fun `simple data class`() { + @Test(timeout=300_000) + fun `simple data class`() { val birthday = Instant.parse("1984-04-17T00:30:00.00Z") val mike = Person("mike", birthday) val bits = mike.checkpointSerialize(context) assertThat(bits.checkpointDeserialize(context)).isEqualTo(Person("mike", birthday)) } - @Test - fun `null values`() { + @Test(timeout=300_000) + fun `null values`() { val bob = Person("bob", null) val bits = bob.checkpointSerialize(context) assertThat(bits.checkpointDeserialize(context)).isEqualTo(Person("bob", null)) } - @Test - fun `serialised form is stable when the same object instance is added to the deserialised object graph`() { + @Test(timeout=300_000) + fun `serialised form is stable when the same object instance is added to the deserialised object graph`() { val noReferencesContext = context.withoutReferences() val obj : ByteSequence = Ints.toByteArray(0x01234567).sequence() val originalList : ArrayList = ArrayList().apply { this += obj } @@ -93,8 +93,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertThat(deserialisedList.checkpointSerialize(noReferencesContext)).isEqualTo(originalList.checkpointSerialize(noReferencesContext)) } - @Test - fun `serialised form is stable when the same object instance occurs more than once, and using java serialisation`() { + @Test(timeout=300_000) + fun `serialised form is stable when the same object instance occurs more than once, and using java serialisation`() { val noReferencesContext = context.withoutReferences() val instant = Instant.ofEpochMilli(123) val instantCopy = Instant.ofEpochMilli(123) @@ -110,15 +110,15 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertThat(listWithSameInstances.checkpointSerialize(noReferencesContext)).isEqualTo(listWithCopies.checkpointSerialize(noReferencesContext)) } - @Test - fun `cyclic object graph`() { + @Test(timeout=300_000) + fun `cyclic object graph`() { val cyclic = Cyclic(3) val bits = cyclic.checkpointSerialize(context) assertThat(bits.checkpointDeserialize(context)).isEqualTo(cyclic) } - @Test - fun `deserialised key pair functions the same as serialised one`() { + @Test(timeout=300_000) + fun `deserialised key pair functions the same as serialised one`() { val keyPair = generateKeyPair() val bitsToSign: ByteArray = Ints.toByteArray(0x01234567) val wrongBits: ByteArray = Ints.toByteArray(0x76543210) @@ -132,36 +132,36 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertThatThrownBy { deserialisedSignature.verify(wrongBits) } } - @Test - fun `write and read Kotlin object singleton`() { + @Test(timeout=300_000) + fun `write and read Kotlin object singleton`() { val serialised = TestSingleton.checkpointSerialize(context) val deserialised = serialised.checkpointDeserialize(context) assertThat(deserialised).isSameAs(TestSingleton) } - @Test - fun `check Kotlin EmptyList can be serialised`() { + @Test(timeout=300_000) + fun `check Kotlin EmptyList can be serialised`() { val deserialisedList: List = emptyList().checkpointSerialize(context).checkpointDeserialize(context) assertEquals(0, deserialisedList.size) assertEquals(Collections.emptyList().javaClass, deserialisedList.javaClass) } - @Test - fun `check Kotlin EmptySet can be serialised`() { + @Test(timeout=300_000) + fun `check Kotlin EmptySet can be serialised`() { val deserialisedSet: Set = emptySet().checkpointSerialize(context).checkpointDeserialize(context) assertEquals(0, deserialisedSet.size) assertEquals(Collections.emptySet().javaClass, deserialisedSet.javaClass) } - @Test - fun `check Kotlin EmptyMap can be serialised`() { + @Test(timeout=300_000) + fun `check Kotlin EmptyMap can be serialised`() { val deserialisedMap: Map = emptyMap().checkpointSerialize(context).checkpointDeserialize(context) assertEquals(0, deserialisedMap.size) assertEquals(Collections.emptyMap().javaClass, deserialisedMap.javaClass) } - @Test - fun `InputStream serialisation`() { + @Test(timeout=300_000) + fun `InputStream serialisation`() { val rubbish = ByteArray(12345) { (it * it * 0.12345).toByte() } val readRubbishStream: InputStream = rubbish.inputStream().checkpointSerialize(context).checkpointDeserialize(context) for (i in 0..12344) { @@ -170,16 +170,16 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertEquals(-1, readRubbishStream.read()) } - @Test - fun `InputStream serialisation does not write trailing garbage`() { + @Test(timeout=300_000) + fun `InputStream serialisation does not write trailing garbage`() { val byteArrays = listOf("123", "456").map { it.toByteArray() } val streams = byteArrays.map { it.inputStream() }.checkpointSerialize(context).checkpointDeserialize(context).iterator() byteArrays.forEach { assertArrayEquals(it, streams.next().readBytes()) } assertFalse(streams.hasNext()) } - @Test - fun `serialize - deserialize SignableData`() { + @Test(timeout=300_000) + fun `serialize - deserialize SignableData`() { val testString = "Hello World" val testBytes = testString.toByteArray() @@ -189,8 +189,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertEquals(meta2, meta) } - @Test - fun `serialize - deserialize Logger`() { + @Test(timeout=300_000) + fun `serialize - deserialize Logger`() { val storageContext: CheckpointSerializationContext = context val logger = LoggerFactory.getLogger("aName") val logger2 = logger.checkpointSerialize(storageContext).checkpointDeserialize(storageContext) @@ -198,8 +198,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertTrue(logger === logger2) } - @Test - fun `HashCheckingStream (de)serialize`() { + @Test(timeout=300_000) + fun `HashCheckingStream (de)serialize`() { val rubbish = ByteArray(12345) { (it * it * 0.12345).toByte() } val readRubbishStream: InputStream = NodeAttachmentService.HashCheckingStream( SecureHash.sha256(rubbish), @@ -224,8 +224,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { override fun toString(): String = "Cyclic($value)" } - @Test - fun `serialize - deserialize PrivacySalt`() { + @Test(timeout=300_000) + fun `serialize - deserialize PrivacySalt`() { val expected = PrivacySalt(byteArrayOf( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, @@ -257,8 +257,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { fun tracker() = ProgressTracker(AYY, BEE, SEA) } - @Test - fun rxSubscriptionsAreNotSerialized() { + @Test(timeout=300_000) + fun rxSubscriptionsAreNotSerialized() { val pt: ProgressTracker = SimpleSteps.tracker() val pt2: ProgressTracker = ChildSteps.tracker() @@ -289,8 +289,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { pt.checkpointSerialize(context) } - @Test - fun `serialize - deserialize Exception with suppressed`() { + @Test(timeout=300_000) + fun `serialize - deserialize Exception with suppressed`() { val exception = IllegalArgumentException("fooBar") val toBeSuppressedOnSenderSide = IllegalStateException("bazz1") exception.addSuppressed(toBeSuppressedOnSenderSide) @@ -306,8 +306,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertEquals(2, exception2.suppressed.size) } - @Test - fun `serialize - deserialize Exception no suppressed`() { + @Test(timeout=300_000) + fun `serialize - deserialize Exception no suppressed`() { val exception = IllegalArgumentException("fooBar") val exception2 = exception.checkpointSerialize(context).checkpointDeserialize(context) assertEquals(exception.message, exception2.message) @@ -319,16 +319,16 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertTrue { exception2.suppressed.contains(toBeSuppressedOnReceiverSide) } } - @Test - fun `serialize - deserialize HashNotFound`() { + @Test(timeout=300_000) + fun `serialize - deserialize HashNotFound`() { val randomHash = SecureHash.randomSHA256() val exception = FetchDataFlow.HashNotFound(randomHash) val exception2 = exception.checkpointSerialize(context).checkpointDeserialize(context) assertEquals(randomHash, exception2.requested) } - @Test - fun `compression has the desired effect`() { + @Test(timeout=300_000) + fun `compression has the desired effect`() { compression ?: return val data = ByteArray(12345).also { Random(0).nextBytes(it) }.let { it + it } val compressed = data.checkpointSerialize(context) @@ -336,8 +336,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { assertArrayEquals(data, compressed.checkpointDeserialize(context)) } - @Test - fun `a particular encoding can be banned for deserialization`() { + @Test(timeout=300_000) + fun `a particular encoding can be banned for deserialization`() { compression ?: return doReturn(false).whenever(context.encodingWhitelist).acceptEncoding(compression) val compressed = "whatever".checkpointSerialize(context) @@ -347,8 +347,8 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { } } - @Test - fun `compression reduces number of bytes significantly`() { + @Test(timeout=300_000) + fun `compression reduces number of bytes significantly`() { class Holder(val holder: ByteArray) val obj = Holder(ByteArray(20000)) diff --git a/node/src/test/kotlin/net/corda/node/services/FinalityHandlerTest.kt b/node/src/test/kotlin/net/corda/node/services/FinalityHandlerTest.kt index 820e60cdff..d67b9c588b 100644 --- a/node/src/test/kotlin/net/corda/node/services/FinalityHandlerTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/FinalityHandlerTest.kt @@ -31,8 +31,8 @@ class FinalityHandlerTest { mockNet.stopNodes() } - @Test - fun `sent to flow hospital on error and attempted retry on node restart`() { + @Test(timeout=300_000) + fun `sent to flow hospital on error and attempted retry on node restart`() { // Setup a network where only Alice has the finance CorDapp and it sends a cash tx to Bob who doesn't have the // CorDapp. Bob's FinalityHandler will error when validating the tx. val alice = mockNet.createNode(InternalMockNodeParameters(legalName = ALICE_NAME, additionalCordapps = FINANCE_CORDAPPS)) diff --git a/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt b/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt index 6dbd003217..883b389072 100644 --- a/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/NotaryChangeTests.kt @@ -62,16 +62,16 @@ class NotaryChangeTests { mockNet.stopNodes() } - @Test - fun `should change notary for a state with single participant`() { + @Test(timeout=300_000) + fun `should change notary for a state with single participant`() { val state = issueState(clientNodeA.services, clientA, oldNotaryParty) assertEquals(state.state.notary, oldNotaryParty) val newState = changeNotary(state, clientNodeA, newNotaryParty) assertEquals(newState.state.notary, newNotaryParty) } - @Test - fun `should change notary for a state with multiple participants`() { + @Test(timeout=300_000) + fun `should change notary for a state with multiple participants`() { val state = issueMultiPartyState(clientNodeA, clientNodeB, oldNotaryNode, oldNotaryParty) val newNotary = newNotaryParty val flow = NotaryChangeFlow(state, newNotary) @@ -87,8 +87,8 @@ class NotaryChangeTests { } // TODO: Re-enable the test when parameter currentness checks are in place, ENT-2666. - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `should throw when a participant refuses to change Notary`() { val state = issueMultiPartyState(clientNodeA, clientNodeB, oldNotaryNode, oldNotaryParty) @@ -102,8 +102,8 @@ class NotaryChangeTests { } } - @Test - fun `should not break encumbrance links`() { + @Test(timeout=300_000) + fun `should not break encumbrance links`() { val issueTx = issueEncumberedState(clientNodeA.services, clientA, oldNotaryParty) val state = StateAndRef(issueTx.outputs.first(), StateRef(issueTx.id, 0)) @@ -131,8 +131,8 @@ class NotaryChangeTests { assertTrue { originalLinkedStates.size == notaryChangeLinkedStates.size && originalLinkedStates.containsAll(notaryChangeLinkedStates) } } - @Test - fun `notary change and regular transactions are properly handled during resolution in longer chains`() { + @Test(timeout=300_000) + fun `notary change and regular transactions are properly handled during resolution in longer chains`() { val issued = issueState(clientNodeA.services, clientA, oldNotaryParty) val moved = moveState(issued, clientNodeA, clientNodeB) diff --git a/node/src/test/kotlin/net/corda/node/services/RPCSecurityManagerTest.kt b/node/src/test/kotlin/net/corda/node/services/RPCSecurityManagerTest.kt index 972272370a..a5278791fb 100644 --- a/node/src/test/kotlin/net/corda/node/services/RPCSecurityManagerTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/RPCSecurityManagerTest.kt @@ -22,15 +22,15 @@ import kotlin.test.assertNull class RPCSecurityManagerTest { - @Test - fun `Artemis special characters not permitted in RPC usernames`() { + @Test(timeout=300_000) + fun `Artemis special characters not permitted in RPC usernames`() { assertThatThrownBy { configWithRPCUsername("user.1") }.hasMessageContaining(".") assertThatThrownBy { configWithRPCUsername("user*1") }.hasMessageContaining("*") assertThatThrownBy { configWithRPCUsername("user#1") }.hasMessageContaining("#") } - @Test - fun `Generic RPC call authorization`() { + @Test(timeout=300_000) + fun `Generic RPC call authorization`() { checkUserActions( permitted = setOf(listOf("nodeInfo"), listOf("notaryIdentities")), permissions = setOf( @@ -38,8 +38,8 @@ class RPCSecurityManagerTest { invokeRpc(CordaRPCOps::notaryIdentities))) } - @Test - fun `Flow invocation authorization`() { + @Test(timeout=300_000) + fun `Flow invocation authorization`() { checkUserActions( permissions = setOf(startFlow()), permitted = setOf( @@ -47,37 +47,37 @@ class RPCSecurityManagerTest { listOf("startFlowDynamic", DummyFlow::class.java.name))) } - @Test - fun `Check startFlow RPC permission implies startFlowDynamic`() { + @Test(timeout=300_000) + fun `Check startFlow RPC permission implies startFlowDynamic`() { checkUserActions( permissions = setOf(invokeRpc("startFlow")), permitted = setOf(listOf("startFlow"), listOf("startFlowDynamic"))) } - @Test - fun `Check startTrackedFlow RPC permission implies startTrackedFlowDynamic`() { + @Test(timeout=300_000) + fun `Check startTrackedFlow RPC permission implies startTrackedFlowDynamic`() { checkUserActions( permitted = setOf(listOf("startTrackedFlow"), listOf("startTrackedFlowDynamic")), permissions = setOf(invokeRpc("startTrackedFlow"))) } - @Test - fun `check killFlow RPC permission accepted`() { + @Test(timeout=300_000) + fun `check killFlow RPC permission accepted`() { checkUserActions( permitted = setOf(listOf("killFlow")), permissions = setOf(invokeRpc(CordaRPCOps::killFlow)) ) } - @Test - fun `Admin authorization`() { + @Test(timeout=300_000) + fun `Admin authorization`() { checkUserActions( permissions = setOf("all"), permitted = allActions.map { listOf(it) }.toSet()) } - @Test - fun `flows draining mode permissions`() { + @Test(timeout=300_000) + fun `flows draining mode permissions`() { checkUserActions( permitted = setOf(listOf("setFlowsDrainingModeEnabled")), permissions = setOf(invokeRpc(CordaRPCOps::setFlowsDrainingModeEnabled)) @@ -88,8 +88,8 @@ class RPCSecurityManagerTest { ) } - @Test - fun `Malformed permission strings`() { + @Test(timeout=300_000) + fun `Malformed permission strings`() { assertMalformedPermission("bar") assertMalformedPermission("InvokeRpc.nodeInfo.XXX") assertMalformedPermission("") @@ -99,8 +99,8 @@ class RPCSecurityManagerTest { assertMalformedPermission("startFlow.") } - @Test - fun `Login with unknown user`() { + @Test(timeout=300_000) + fun `Login with unknown user`() { val userRealm = RPCSecurityManagerImpl.fromUserList( users = listOf(User("user", "xxxx", emptySet())), id = AuthServiceId("TEST")) @@ -112,8 +112,8 @@ class RPCSecurityManagerTest { "Login with wrong password should fail") } - @Test - fun `Login with wrong credentials`() { + @Test(timeout=300_000) + fun `Login with wrong credentials`() { val userRealm = RPCSecurityManagerImpl.fromUserList( users = listOf(User("user", "password", emptySet())), id = AuthServiceId("TEST")) @@ -125,8 +125,8 @@ class RPCSecurityManagerTest { "Login with wrong password should fail") } - @Test - fun `Build invalid subject`() { + @Test(timeout=300_000) + fun `Build invalid subject`() { val userRealm = RPCSecurityManagerImpl.fromUserList( users = listOf(User("user", "password", emptySet())), id = AuthServiceId("TEST")) diff --git a/node/src/test/kotlin/net/corda/node/services/ServiceHubConcurrentUsageTest.kt b/node/src/test/kotlin/net/corda/node/services/ServiceHubConcurrentUsageTest.kt index 030e289a53..ecba9d248d 100644 --- a/node/src/test/kotlin/net/corda/node/services/ServiceHubConcurrentUsageTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/ServiceHubConcurrentUsageTest.kt @@ -30,8 +30,8 @@ class ServiceHubConcurrentUsageTest { mockNet.stopNodes() } - @Test - fun `operations requiring a transaction work from another thread`() { + @Test(timeout=300_000) + fun `operations requiring a transaction work from another thread`() { val latch = CountDownLatch(1) var successful = false val initiatingFlow = TestFlow(mockNet.defaultNotaryIdentity) diff --git a/node/src/test/kotlin/net/corda/node/services/TimedFlowTests.kt b/node/src/test/kotlin/net/corda/node/services/TimedFlowTests.kt index 41e89031ed..7c2cb7bb36 100644 --- a/node/src/test/kotlin/net/corda/node/services/TimedFlowTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/TimedFlowTests.kt @@ -147,8 +147,8 @@ class TimedFlowTests { requestsReceived = AtomicInteger(0) } - @Test - fun `timed flows are restarted`() { + @Test(timeout=300_000) + fun `timed flows are restarted`() { node.run { val issueTx = signInitialTransaction(notary) { setTimeWindow(services.clock.instant(), 30.seconds) @@ -165,8 +165,8 @@ class TimedFlowTests { } } - @Test - fun `timed sub-flows are restarted`() { + @Test(timeout=300_000) + fun `timed sub-flows are restarted`() { node.run { val issueTx = signInitialTransaction(notary) { setTimeWindow(services.clock.instant(), 30.seconds) @@ -183,8 +183,8 @@ class TimedFlowTests { } } - @Test - fun `timed flow can update its ETA`() { + @Test(timeout=300_000) + fun `timed flow can update its ETA`() { try { waitETA = 10.minutes node.run { @@ -215,8 +215,8 @@ class TimedFlowTests { } } - @Test - fun `timed flow cannot update its ETA to less than default`() { + @Test(timeout=300_000) + fun `timed flow cannot update its ETA to less than default`() { try { waitETA = 1.seconds patientNode.run { diff --git a/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt b/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt index c356de9023..be6cddb7ac 100644 --- a/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt @@ -65,8 +65,8 @@ class AttachmentTrustCalculatorTest { database.close() } - @Test - fun `Jar uploaded by trusted uploader is trusted`() { + @Test(timeout=300_000) + fun `Jar uploaded by trusted uploader is trusted`() { tempFolder.root.toPath().let { path -> val (jar, _) = ContractJarTestUtils.makeTestSignedContractJar( path, @@ -85,8 +85,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar trusted if signed by same key and has same contract as existing jar uploaded by a trusted uploader`() { + @Test(timeout=300_000) + fun `jar trusted if signed by same key and has same contract as existing jar uploaded by a trusted uploader`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -110,8 +110,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar trusted if same key but different contract`() { + @Test(timeout=300_000) + fun `jar trusted if same key but different contract`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -135,8 +135,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar trusted if the signing keys are a subset of an existing trusted jar's signers`() { + @Test(timeout=300_000) + fun `jar trusted if the signing keys are a subset of an existing trusted jar's signers`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -163,8 +163,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar trusted if the signing keys are an intersection of an existing trusted jar's signers`() { + @Test(timeout=300_000) + fun `jar trusted if the signing keys are an intersection of an existing trusted jar's signers`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -194,8 +194,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar trusted if the signing keys are a superset of an existing trusted jar's signers`() { + @Test(timeout=300_000) + fun `jar trusted if the signing keys are a superset of an existing trusted jar's signers`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -222,8 +222,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar with inherited trust does not grant trust to other jars (no chain of trust)`() { + @Test(timeout=300_000) + fun `jar with inherited trust does not grant trust to other jars (no chain of trust)`() { tempFolder.root.toPath().let { path -> val aliasA = "Daredevil" val aliasB = "The Punisher" @@ -263,8 +263,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar not trusted if different key but same contract`() { + @Test(timeout=300_000) + fun `jar not trusted if different key but same contract`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -291,8 +291,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `neither jar trusted if same contract and signer but not uploaded by a trusted uploader`() { + @Test(timeout=300_000) + fun `neither jar trusted if same contract and signer but not uploaded by a trusted uploader`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -316,8 +316,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `non-contract jar trusted if trusted jar with same key present`() { + @Test(timeout=300_000) + fun `non-contract jar trusted if trusted jar with same key present`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -346,8 +346,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `non-contract jars not trusted if uploaded by non trusted uploaders`() { + @Test(timeout=300_000) + fun `non-contract jars not trusted if uploaded by non trusted uploaders`() { tempFolder.root.toPath().let { path -> val alias = "testAlias" val password = "testPassword" @@ -376,8 +376,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `non-contract jars not trusted if unsigned`() { + @Test(timeout=300_000) + fun `non-contract jars not trusted if unsigned`() { SelfCleaningDir().use { val (jarV1, _) = makeTestJar() val (jarV2, _) = makeTestJar(entries = listOf(Pair("foo", "bar"))) @@ -390,8 +390,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar not trusted if signed by a blacklisted key and not uploaded by trusted uploader`() { + @Test(timeout=300_000) + fun `jar not trusted if signed by a blacklisted key and not uploaded by trusted uploader`() { tempFolder.root.toPath().let { path -> val aliasA = "Antman" @@ -423,8 +423,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `jar uploaded by trusted uploader is still trusted even if it is signed by a blacklisted key`() { + @Test(timeout=300_000) + fun `jar uploaded by trusted uploader is still trusted even if it is signed by a blacklisted key`() { tempFolder.root.toPath().let { path -> val aliasA = "Thanos" @@ -446,8 +446,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `calculateAllTrustInfo returns all attachment trust roots`() { + @Test(timeout=300_000) + fun `calculateAllTrustInfo returns all attachment trust roots`() { tempFolder.root.toPath().let { path -> val aliasA = "dan" val aliasB = "james" @@ -514,8 +514,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `calculateAllTrustInfo only returns signed attachments or attachments manually installed on the node`() { + @Test(timeout=300_000) + fun `calculateAllTrustInfo only returns signed attachments or attachments manually installed on the node`() { tempFolder.root.toPath().let { path -> val aliasA = "dan" val aliasB = "james" @@ -566,8 +566,8 @@ class AttachmentTrustCalculatorTest { } } - @Test - fun `calculateAllTrustInfo attachments signed by blacklisted keys output without trust root fields filled in`() { + @Test(timeout=300_000) + fun `calculateAllTrustInfo attachments signed by blacklisted keys output without trust root fields filled in`() { tempFolder.root.toPath().let { path -> val aliasA = "batman" diff --git a/node/src/test/kotlin/net/corda/node/services/config/ConfigOperatorTests.kt b/node/src/test/kotlin/net/corda/node/services/config/ConfigOperatorTests.kt index 8178b88c48..4922f18ed3 100644 --- a/node/src/test/kotlin/net/corda/node/services/config/ConfigOperatorTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/config/ConfigOperatorTests.kt @@ -7,8 +7,8 @@ import kotlin.test.assertEquals class ConfigOperatorTests { - @Test - fun `config plus behaves the same as map plus`() { + @Test(timeout=300_000) + fun `config plus behaves the same as map plus`() { val config = arrayOf("x" to "y1", "a" to "b", "z" to "Z") val overrides = arrayOf("x" to "y2", "c" to "d", "z" to null) val old = ConfigFactory.parseMap(mapOf(*config) + mapOf(*overrides)) diff --git a/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt b/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt index 2604a74f9b..1624a60d3d 100644 --- a/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt @@ -34,8 +34,8 @@ class NodeConfigurationImplTest { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `can't have dev mode options if not in dev mode`() { + @Test(timeout=300_000) + fun `can't have dev mode options if not in dev mode`() { val debugOptions = DevModeOptions() configDebugOptions(true, debugOptions) configDebugOptions(true, null) @@ -43,32 +43,32 @@ class NodeConfigurationImplTest { configDebugOptions(false, null) } - @Test - fun `can't have tlsCertCrlDistPoint null when tlsCertCrlIssuer is given`() { + @Test(timeout=300_000) + fun `can't have tlsCertCrlDistPoint null when tlsCertCrlIssuer is given`() { val configValidationResult = configTlsCertCrlOptions(null, "C=US, L=New York, OU=Corda, O=R3 HoldCo LLC, CN=Corda Root CA").validate() assertTrue { configValidationResult.isNotEmpty() } assertThat(configValidationResult.first()).contains("tlsCertCrlDistPoint") assertThat(configValidationResult.first()).contains("tlsCertCrlIssuer") } - @Test - fun `can't have tlsCertCrlDistPoint null when crlCheckSoftFail is false`() { + @Test(timeout=300_000) + fun `can't have tlsCertCrlDistPoint null when crlCheckSoftFail is false`() { val configValidationResult = configTlsCertCrlOptions(null, null, false).validate() assertTrue { configValidationResult.isNotEmpty() } assertThat(configValidationResult.first()).contains("tlsCertCrlDistPoint") assertThat(configValidationResult.first()).contains("crlCheckSoftFail") } - @Test - fun `check devModeOptions flag helper`() { + @Test(timeout=300_000) + fun `check devModeOptions flag helper`() { assertTrue { configDebugOptions(true, null).shouldCheckCheckpoints() } assertTrue { configDebugOptions(true, DevModeOptions()).shouldCheckCheckpoints() } assertTrue { configDebugOptions(true, DevModeOptions(false)).shouldCheckCheckpoints() } assertFalse { configDebugOptions(true, DevModeOptions(true)).shouldCheckCheckpoints() } } - @Test - fun `check crashShell flags helper`() { + @Test(timeout=300_000) + fun `check crashShell flags helper`() { assertFalse { testConfiguration.copy(sshd = null).shouldStartSSHDaemon() } assertTrue { testConfiguration.copy(sshd = SSHDConfiguration(1234)).shouldStartSSHDaemon() } assertFalse { testConfiguration.copy(noLocalShell = true).shouldStartLocalShell() } @@ -79,8 +79,8 @@ class NodeConfigurationImplTest { assertFalse { testConfiguration.copy(noLocalShell = true, sshd = null).shouldInitCrashShell() } } - @Test - fun `Dev mode is autodetected correctly`() { + @Test(timeout=300_000) + fun `Dev mode is autodetected correctly`() { val os = System.getProperty("os.name") setSystemOs("Windows 98") @@ -102,21 +102,21 @@ class NodeConfigurationImplTest { System.setProperty("os.name", os) } - @Test - fun `Dev mode is read from the config over the autodetect logic`() { + @Test(timeout=300_000) + fun `Dev mode is read from the config over the autodetect logic`() { assertTrue(getConfig("test-config-DevMode.conf").getBooleanCaseInsensitive("devMode")) assertFalse(getConfig("test-config-noDevMode.conf").getBooleanCaseInsensitive("devMode")) } - @Test - fun `Dev mode is true if overriden`() { + @Test(timeout=300_000) + fun `Dev mode is true if overriden`() { assertTrue(getConfig("test-config-DevMode.conf", ConfigFactory.parseMap(mapOf("devMode" to true))).getBooleanCaseInsensitive("devMode")) assertTrue(getConfig("test-config-noDevMode.conf", ConfigFactory.parseMap(mapOf("devMode" to true))).getBooleanCaseInsensitive("devMode")) assertTrue(getConfig("test-config-empty.conf", ConfigFactory.parseMap(mapOf("devMode" to true))).getBooleanCaseInsensitive("devMode")) } - @Test - fun `Dev mode is false if overriden`() { + @Test(timeout=300_000) + fun `Dev mode is false if overriden`() { assertFalse(getConfig("test-config-DevMode.conf", ConfigFactory.parseMap(mapOf("devMode" to false))).getBooleanCaseInsensitive("devMode")) assertFalse(getConfig("test-config-noDevMode.conf", ConfigFactory.parseMap(mapOf("devMode" to false))).getBooleanCaseInsensitive("devMode")) assertFalse(getConfig("test-config-empty.conf", ConfigFactory.parseMap(mapOf("devMode" to false))).getBooleanCaseInsensitive("devMode")) @@ -131,8 +131,8 @@ class NodeConfigurationImplTest { ) } - @Test - fun `validation has error when compatibilityZoneURL is present and devMode is true`() { + @Test(timeout=300_000) + fun `validation has error when compatibilityZoneURL is present and devMode is true`() { val configuration = testConfiguration.copy( devMode = true, compatibilityZoneURL = URL("https://r3.com")) @@ -142,8 +142,8 @@ class NodeConfigurationImplTest { assertThat(errors).hasOnlyOneElementSatisfying { error -> error.contains("compatibilityZoneURL") && error.contains("devMode") } } - @Test - fun `validation succeeds when compatibilityZoneURL is present and devMode is true and allowCompatibilityZoneURL is set`() { + @Test(timeout=300_000) + fun `validation succeeds when compatibilityZoneURL is present and devMode is true and allowCompatibilityZoneURL is set`() { val configuration = testConfiguration.copy( devMode = true, compatibilityZoneURL = URL("https://r3.com"), @@ -153,8 +153,8 @@ class NodeConfigurationImplTest { assertThat(errors).isEmpty() } - @Test - fun `errors for nested config keys contain path`() { + @Test(timeout=300_000) + fun `errors for nested config keys contain path`() { var rawConfig = ConfigFactory.parseResources("working-config.conf", ConfigParseOptions.defaults().setAllowMissing(false)) val missingPropertyPath = "rpcSettings.address" rawConfig = rawConfig.withoutPath(missingPropertyPath) @@ -165,8 +165,8 @@ class NodeConfigurationImplTest { } } - @Test - fun `validation has error when compatibilityZone is present and devMode is true`() { + @Test(timeout=300_000) + fun `validation has error when compatibilityZone is present and devMode is true`() { val configuration = testConfiguration.copy(devMode = true, networkServices = NetworkServicesConfig( URL("https://r3.com.doorman"), URL("https://r3.com/nm"))) @@ -176,8 +176,8 @@ class NodeConfigurationImplTest { assertThat(errors).hasOnlyOneElementSatisfying { error -> error.contains("networkServices") && error.contains("devMode") } } - @Test - fun `validation has error when both compatibilityZoneURL and networkServices are configured`() { + @Test(timeout=300_000) + fun `validation has error when both compatibilityZoneURL and networkServices are configured`() { val configuration = testConfiguration.copy( devMode = false, compatibilityZoneURL = URL("https://r3.com"), @@ -192,8 +192,8 @@ class NodeConfigurationImplTest { } } - @Test - fun `rpcAddress and rpcSettings_address are equivalent`() { + @Test(timeout=300_000) + fun `rpcAddress and rpcSettings_address are equivalent`() { var rawConfig = ConfigFactory.parseResources("working-config.conf", ConfigParseOptions.defaults().setAllowMissing(false)) rawConfig = rawConfig.withoutPath("rpcSettings.address") rawConfig = rawConfig.withValue("rpcAddress", ConfigValueFactory.fromAnyRef("localhost:4444")) @@ -201,8 +201,8 @@ class NodeConfigurationImplTest { assertThat(rawConfig.parseAsNodeConfiguration().isValid).isTrue() } - @Test - fun `relative path correctly parsed`() { + @Test(timeout=300_000) + fun `relative path correctly parsed`() { val rawConfig = ConfigFactory.parseResources("working-config.conf", ConfigParseOptions.defaults().setAllowMissing(false)) // Override base directory to have predictable experience on diff OSes @@ -219,8 +219,8 @@ class NodeConfigurationImplTest { assertEquals(listOf(baseDirPath / "./myCorDapps1", baseDirPath / "./myCorDapps2"), nodeConfiguration.value().cordappDirectories) } - @Test - fun `missing rpcSettings_adminAddress cause a graceful failure`() { + @Test(timeout=300_000) + fun `missing rpcSettings_adminAddress cause a graceful failure`() { var rawConfig = ConfigFactory.parseResources("working-config.conf", ConfigParseOptions.defaults().setAllowMissing(false)) rawConfig = rawConfig.withoutPath("rpcSettings.adminAddress") @@ -229,8 +229,8 @@ class NodeConfigurationImplTest { assertThat(config.errors.asSequence().map(Configuration.Validation.Error::message).filter { it.contains("rpcSettings.adminAddress") }.toList()).isNotEmpty } - @Test - fun `compatibilityZoneURL populates NetworkServices`() { + @Test(timeout=300_000) + fun `compatibilityZoneURL populates NetworkServices`() { val compatibilityZoneURL = URI.create("https://r3.com").toURL() val configuration = testConfiguration.copy( devMode = false, @@ -241,31 +241,31 @@ class NodeConfigurationImplTest { assertEquals(compatibilityZoneURL, configuration.networkServices!!.networkMapURL) } - @Test - fun `jmxReporterType is null and defaults to Jokolia`() { + @Test(timeout=300_000) + fun `jmxReporterType is null and defaults to Jokolia`() { val rawConfig = getConfig("working-config.conf", ConfigFactory.parseMap(mapOf("devMode" to true))) val nodeConfig = rawConfig.parseAsNodeConfiguration().value() assertEquals(JmxReporterType.JOLOKIA.toString(), nodeConfig.jmxReporterType.toString()) } - @Test - fun `jmxReporterType is not null and is set to New Relic`() { + @Test(timeout=300_000) + fun `jmxReporterType is not null and is set to New Relic`() { var rawConfig = getConfig("working-config.conf", ConfigFactory.parseMap(mapOf("devMode" to true))) rawConfig = rawConfig.withValue("jmxReporterType", ConfigValueFactory.fromAnyRef("NEW_RELIC")) val nodeConfig = rawConfig.parseAsNodeConfiguration().value() assertEquals(JmxReporterType.NEW_RELIC.toString(), nodeConfig.jmxReporterType.toString()) } - @Test - fun `jmxReporterType is not null and set to Jokolia`() { + @Test(timeout=300_000) + fun `jmxReporterType is not null and set to Jokolia`() { var rawConfig = getConfig("working-config.conf", ConfigFactory.parseMap(mapOf("devMode" to true))) rawConfig = rawConfig.withValue("jmxReporterType", ConfigValueFactory.fromAnyRef("JOLOKIA")) val nodeConfig = rawConfig.parseAsNodeConfiguration().value() assertEquals(JmxReporterType.JOLOKIA.toString(), nodeConfig.jmxReporterType.toString()) } - @Test - fun `network services`() { + @Test(timeout=300_000) + fun `network services`() { val rawConfig = getConfig("test-config-with-networkservices.conf") val nodeConfig = rawConfig.parseAsNodeConfiguration().value() nodeConfig.networkServices!!.apply { diff --git a/node/src/test/kotlin/net/corda/node/services/diagnostics/NodeDiagnosticsServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/diagnostics/NodeDiagnosticsServiceTest.kt index e74eb69320..013fa7527b 100644 --- a/node/src/test/kotlin/net/corda/node/services/diagnostics/NodeDiagnosticsServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/diagnostics/NodeDiagnosticsServiceTest.kt @@ -16,8 +16,8 @@ class NodeDiagnosticsServiceTest { private val diagnosticsService = NodeDiagnosticsService() - @Test - fun `platform version info correctly returned from diagnostics service`() { + @Test(timeout=300_000) + fun `platform version info correctly returned from diagnostics service`() { val info = diagnosticsService.nodeVersionInfo() assertEquals(CordaVersion.releaseVersion, info.releaseVersion) assertEquals(CordaVersion.revision, info.revision) diff --git a/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt index e5209f72ec..415400d0b4 100644 --- a/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt @@ -169,26 +169,26 @@ class NodeSchedulerServiceTest : NodeSchedulerServiceTestBase() { } } - @Test - fun `test activity due now`() { + @Test(timeout=300_000) + fun `test activity due now`() { assertStarted(schedule(mark)) } - @Test - fun `test activity due in the past`() { + @Test(timeout=300_000) + fun `test activity due in the past`() { assertStarted(schedule(mark - 1.days)) } - @Test - fun `test activity due in the future`() { + @Test(timeout=300_000) + fun `test activity due in the future`() { val event = schedule(mark + 1.days) assertWaitingFor(event) testClock.advanceBy(1.days) assertStarted(event) } - @Test - fun `test activity due in the future and schedule another earlier`() { + @Test(timeout=300_000) + fun `test activity due in the future and schedule another earlier`() { val event2 = schedule(mark + 2.days) val event1 = schedule(mark + 1.days) assertWaitingFor(event1) @@ -199,8 +199,8 @@ class NodeSchedulerServiceTest : NodeSchedulerServiceTestBase() { assertStarted(event2) } - @Test - fun `test activity due in the future and schedule another later`() { + @Test(timeout=300_000) + fun `test activity due in the future and schedule another later`() { val event1 = schedule(mark + 1.days) val event2 = schedule(mark + 2.days) assertWaitingFor(event1) @@ -211,8 +211,8 @@ class NodeSchedulerServiceTest : NodeSchedulerServiceTestBase() { assertStarted(event2) } - @Test - fun `test activity due in the future and schedule another for same time`() { + @Test(timeout=300_000) + fun `test activity due in the future and schedule another for same time`() { val eventA = schedule(mark + 1.days) val eventB = schedule(mark + 1.days) testClock.advanceBy(1.days) @@ -220,8 +220,8 @@ class NodeSchedulerServiceTest : NodeSchedulerServiceTestBase() { assertStarted(eventB) } - @Test - fun `test activity due in the future and schedule another for same time then unschedule second`() { + @Test(timeout=300_000) + fun `test activity due in the future and schedule another for same time then unschedule second`() { val eventA = schedule(mark + 1.days) val eventB = schedule(mark + 1.days) database.transaction { @@ -232,8 +232,8 @@ class NodeSchedulerServiceTest : NodeSchedulerServiceTestBase() { assertStarted(eventA) } - @Test - fun `test activity due in the future and schedule another for same time then unschedule original`() { + @Test(timeout=300_000) + fun `test activity due in the future and schedule another for same time then unschedule original`() { val eventA = schedule(mark + 1.days) val eventB = schedule(mark + 1.days) database.transaction { @@ -244,8 +244,8 @@ class NodeSchedulerServiceTest : NodeSchedulerServiceTestBase() { assertStarted(eventB) } - @Test - fun `test activity due in the future then unschedule`() { + @Test(timeout=300_000) + fun `test activity due in the future then unschedule`() { database.transaction { scheduler.unscheduleStateActivity(schedule(mark + 1.days).stateRef) } @@ -276,8 +276,8 @@ class NodeSchedulerPersistenceTest : NodeSchedulerServiceTestBase() { } } - @Test - fun `test that correct item is returned`() { + @Test(timeout=300_000) + fun `test that correct item is returned`() { val dataSourceProps = MockServices.makeTestDataSourceProperties() val database = configureDatabase(dataSourceProps, databaseConfig, { null }, { null }) database.transaction { @@ -292,8 +292,8 @@ class NodeSchedulerPersistenceTest : NodeSchedulerServiceTestBase() { } } - @Test - fun `test that schedule is persisted`() { + @Test(timeout=300_000) + fun `test that schedule is persisted`() { val dataSourceProps = MockServices.makeTestDataSourceProperties() val timeInTheFuture = mark + 1.days val stateRef = StateRef(SecureHash.zeroHash, 0) @@ -331,8 +331,8 @@ class NodeSchedulerPersistenceTest : NodeSchedulerServiceTestBase() { } @Ignore("Temporarily") - @Test - fun `test that if schedule is updated then the flow is invoked on the correct schedule`() { + @Test(timeout=300_000) + fun `test that if schedule is updated then the flow is invoked on the correct schedule`() { val dataSourceProps = MockServices.makeTestDataSourceProperties() val timeInTheFuture = mark + 1.days val stateRef = StateRef(SecureHash.allOnesHash, 0) diff --git a/node/src/test/kotlin/net/corda/node/services/events/PersistentScheduledFlowRepositoryTest.kt b/node/src/test/kotlin/net/corda/node/services/events/PersistentScheduledFlowRepositoryTest.kt index d478dc473d..a0420982cd 100644 --- a/node/src/test/kotlin/net/corda/node/services/events/PersistentScheduledFlowRepositoryTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/events/PersistentScheduledFlowRepositoryTest.kt @@ -16,8 +16,8 @@ class PersistentScheduledFlowRepositoryTest { private val databaseConfig: DatabaseConfig = DatabaseConfig() private val mark = Instant.now() - @Test - fun `test that earliest item is returned`() { + @Test(timeout=300_000) + fun `test that earliest item is returned`() { val laterTime = mark + 1.days val dataSourceProps = MockServices.makeTestDataSourceProperties() val database = configureDatabase(dataSourceProps, databaseConfig, { null }, { null }) @@ -38,8 +38,8 @@ class PersistentScheduledFlowRepositoryTest { } } - @Test - fun `test that item is rescheduled`() { + @Test(timeout=300_000) + fun `test that item is rescheduled`() { val laterTime = mark + 1.days val dataSourceProps = MockServices.makeTestDataSourceProperties() val database = configureDatabase(dataSourceProps, databaseConfig, { null }, { null }) diff --git a/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt b/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt index 1dd496d93c..00efa7a0a5 100644 --- a/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/events/ScheduledFlowTests.kt @@ -125,8 +125,8 @@ class ScheduledFlowTests { mockNet.stopNodes() } - @Test - fun `create and run scheduled flow then wait for result`() { + @Test(timeout=300_000) + fun `create and run scheduled flow then wait for result`() { var countScheduledFlows = 0 aliceNode.smm.track().updates.subscribe { if (it is StateMachineManager.Change.Add) { @@ -148,8 +148,8 @@ class ScheduledFlowTests { assertTrue("Must be processed", stateFromB.state.data.processed) } - @Test - fun `run a whole batch of scheduled flows`() { + @Test(timeout=300_000) + fun `run a whole batch of scheduled flows`() { val N = 99 val futures = mutableListOf>() for (i in 0 until N) { diff --git a/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt index 3be34cccf8..c154620673 100644 --- a/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt @@ -39,8 +39,8 @@ class InMemoryIdentityServiceTests { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `get all identities`() { + @Test(timeout=300_000) + fun `get all identities`() { val service = createService() // Nothing registered, so empty set assertNull(service.getAllIdentities().firstOrNull()) @@ -57,8 +57,8 @@ class InMemoryIdentityServiceTests { assertEquals(expected, actual) } - @Test - fun `get identity by key`() { + @Test(timeout=300_000) + fun `get identity by key`() { val service = createService() assertNull(service.partyFromKey(ALICE_PUBKEY)) service.verifyAndRegisterIdentity(ALICE_IDENTITY) @@ -66,14 +66,14 @@ class InMemoryIdentityServiceTests { assertNull(service.partyFromKey(BOB_PUBKEY)) } - @Test - fun `get identity by name with no registered identities`() { + @Test(timeout=300_000) + fun `get identity by name with no registered identities`() { val service = createService() assertNull(service.wellKnownPartyFromX500Name(ALICE.name)) } - @Test - fun `get identity by substring match`() { + @Test(timeout=300_000) + fun `get identity by substring match`() { val service = createService() service.verifyAndRegisterIdentity(ALICE_IDENTITY) service.verifyAndRegisterIdentity(BOB_IDENTITY) @@ -84,8 +84,8 @@ class InMemoryIdentityServiceTests { assertEquals(setOf(BOB), service.partiesFromName("Bob Plc", true)) } - @Test - fun `get identity by name`() { + @Test(timeout=300_000) + fun `get identity by name`() { val service = createService() val identities = listOf("Org A", "Org B", "Org C") .map { getTestPartyAndCertificate(CordaX500Name(organisation = it, locality = "London", country = "GB"), generateKeyPair().public) } @@ -97,8 +97,8 @@ class InMemoryIdentityServiceTests { /** * Generate a certificate path from a root CA, down to a transaction key, store and verify the association. */ - @Test - fun `assert unknown anonymous key is unrecognised`() { + @Test(timeout=300_000) + fun `assert unknown anonymous key is unrecognised`() { val rootKey = Crypto.generateKeyPair(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME) val rootCert = X509Utilities.createSelfSignedCACertificate(ALICE.name.x500Principal, rootKey) val txKey = Crypto.generateKeyPair(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME) @@ -116,8 +116,8 @@ class InMemoryIdentityServiceTests { * Generate a pair of certificate paths from a root CA, down to a transaction key, store and verify the associations. * Also checks that incorrect associations are rejected. */ - @Test - fun `get anonymous identity by key`() { + @Test(timeout=300_000) + fun `get anonymous identity by key`() { val (alice, aliceTxIdentity) = createConfidentialIdentity(ALICE.name) val (_, bobTxIdentity) = createConfidentialIdentity(ALICE.name) @@ -138,8 +138,8 @@ class InMemoryIdentityServiceTests { * Generate a pair of certificate paths from a root CA, down to a transaction key, store and verify the associations. * Also checks that incorrect associations are rejected. */ - @Test - fun `assert ownership`() { + @Test(timeout=300_000) + fun `assert ownership`() { val (alice, anonymousAlice) = createConfidentialIdentity(ALICE.name) val (bob, anonymousBob) = createConfidentialIdentity(BOB.name) @@ -182,8 +182,8 @@ class InMemoryIdentityServiceTests { /** * Ensure if we feed in a full identity, we get the same identity back. */ - @Test - fun `deanonymising a well known identity should return the identity`() { + @Test(timeout=300_000) + fun `deanonymising a well known identity should return the identity`() { val service = createService() val expected = ALICE service.verifyAndRegisterIdentity(ALICE_IDENTITY) @@ -194,8 +194,8 @@ class InMemoryIdentityServiceTests { /** * Ensure we don't blindly trust what an anonymous identity claims to be. */ - @Test - fun `deanonymising a false well known identity should return null`() { + @Test(timeout=300_000) + fun `deanonymising a false well known identity should return null`() { val service = createService() val notAlice = Party(ALICE.name, generateKeyPair().public) service.verifyAndRegisterIdentity(ALICE_IDENTITY) diff --git a/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt index 989312d392..71b236aaa9 100644 --- a/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt @@ -70,8 +70,8 @@ class PersistentIdentityServiceTests { database.close() } - @Test - fun `get all identities`() { + @Test(timeout=300_000) + fun `get all identities`() { // Nothing registered, so empty set assertNull(identityService.getAllIdentities().firstOrNull()) @@ -88,40 +88,40 @@ class PersistentIdentityServiceTests { assertEquals(expected, actual) } - @Test - fun `get identity by key`() { + @Test(timeout=300_000) + fun `get identity by key`() { assertNull(identityService.partyFromKey(ALICE_PUBKEY)) identityService.verifyAndRegisterIdentity(ALICE_IDENTITY) assertEquals(ALICE, identityService.partyFromKey(ALICE_PUBKEY)) assertNull(identityService.partyFromKey(BOB_PUBKEY)) } - @Test - fun `get identity by name with no registered identities`() { + @Test(timeout=300_000) + fun `get identity by name with no registered identities`() { assertNull(identityService.wellKnownPartyFromX500Name(ALICE.name)) } - @Test - fun `stripping others when none registered strips`() { + @Test(timeout=300_000) + fun `stripping others when none registered strips`() { assertEquals(identityService.stripNotOurKeys(listOf(BOB_PUBKEY)).firstOrNull(), null) } - @Test - fun `stripping others when only us registered strips`() { + @Test(timeout=300_000) + fun `stripping others when only us registered strips`() { identityService.verifyAndRegisterIdentity(ALICE_IDENTITY) assertEquals(identityService.stripNotOurKeys(listOf(BOB_PUBKEY)).firstOrNull(), null) } - @Test - fun `stripping others when us and others registered does not strip us`() { + @Test(timeout=300_000) + fun `stripping others when us and others registered does not strip us`() { identityService.verifyAndRegisterIdentity(ALICE_IDENTITY) identityService.verifyAndRegisterIdentity(BOB_IDENTITY) val stripped = identityService.stripNotOurKeys(listOf(ALICE_PUBKEY, BOB_PUBKEY)) assertEquals(stripped.single(), ALICE_PUBKEY) } - @Test - fun `get identity by substring match`() { + @Test(timeout=300_000) + fun `get identity by substring match`() { identityService.verifyAndRegisterIdentity(ALICE_IDENTITY) identityService.verifyAndRegisterIdentity(BOB_IDENTITY) val alicente = getTestPartyAndCertificate(CordaX500Name(organisation = "Alicente Worldwide", locality = "London", country = "GB"), generateKeyPair().public) @@ -131,8 +131,8 @@ class PersistentIdentityServiceTests { assertEquals(setOf(BOB), identityService.partiesFromName("Bob Plc", true)) } - @Test - fun `get identity by name`() { + @Test(timeout=300_000) + fun `get identity by name`() { val identities = listOf("Organisation A", "Organisation B", "Organisation C") .map { getTestPartyAndCertificate(CordaX500Name(organisation = it, locality = "London", country = "GB"), generateKeyPair().public) } assertNull(identityService.wellKnownPartyFromX500Name(identities.first().name)) @@ -147,8 +147,8 @@ class PersistentIdentityServiceTests { /** * Generate a certificate path from a root CA, down to a transaction key, store and verify the association. */ - @Test - fun `assert unknown anonymous key is unrecognised`() { + @Test(timeout=300_000) + fun `assert unknown anonymous key is unrecognised`() { val rootKey = Crypto.generateKeyPair(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME) val rootCert = X509Utilities.createSelfSignedCACertificate(ALICE.name.x500Principal, rootKey) val txKey = Crypto.generateKeyPair(X509Utilities.DEFAULT_IDENTITY_SIGNATURE_SCHEME) @@ -164,8 +164,8 @@ class PersistentIdentityServiceTests { * Generate a pair of certificate paths from a root CA, down to a transaction key, store and verify the associations. * Also checks that incorrect associations are rejected. */ - @Test - fun `get anonymous identity by key`() { + @Test(timeout=300_000) + fun `get anonymous identity by key`() { val (alice, aliceTxIdentity) = createConfidentialIdentity(ALICE.name) val (_, bobTxIdentity) = createConfidentialIdentity(ALICE.name) @@ -186,8 +186,8 @@ class PersistentIdentityServiceTests { * Generate a pair of certificate paths from a root CA, down to a transaction key, store and verify the associations. * Also checks that incorrect associations are rejected. */ - @Test - fun `assert ownership`() { + @Test(timeout=300_000) + fun `assert ownership`() { val (alice, anonymousAlice) = createConfidentialIdentity(ALICE.name) val (bob, anonymousBob) = createConfidentialIdentity(BOB.name) @@ -212,8 +212,8 @@ class PersistentIdentityServiceTests { } } - @Test - fun `Test Persistence`() { + @Test(timeout=300_000) + fun `Test Persistence`() { val (alice, anonymousAlice) = createConfidentialIdentity(ALICE.name) val (bob, anonymousBob) = createConfidentialIdentity(BOB.name) @@ -241,16 +241,16 @@ class PersistentIdentityServiceTests { assertEquals(anonymousBob, bobReload!!) } - @Test - fun `ensure no exception when looking up an unregistered confidential identity`() { + @Test(timeout=300_000) + fun `ensure no exception when looking up an unregistered confidential identity`() { val (_, anonymousAlice) = createConfidentialIdentity(ALICE.name) // Ensure no exceptions are thrown if we attempt to look up an unregistered CI assertNull(identityService.wellKnownPartyFromAnonymous(AnonymousParty(anonymousAlice.owningKey))) } - @Test - fun `register duplicate confidential identities`(){ + @Test(timeout=300_000) + fun `register duplicate confidential identities`(){ val (alice, anonymousAlice) = createConfidentialIdentity(ALICE.name) identityService.registerKey(anonymousAlice.owningKey, alice.party) @@ -261,8 +261,8 @@ class PersistentIdentityServiceTests { } } - @Test - fun `resolve key to party for key without certificate`() { + @Test(timeout=300_000) + fun `resolve key to party for key without certificate`() { // Register Alice's PartyAndCert as if it was done so via the network map cache. identityService.verifyAndRegisterIdentity(alice.identity) // Use a key which is not tied to a cert. @@ -272,8 +272,8 @@ class PersistentIdentityServiceTests { assertEquals(alice.party, identityService.partyFromKey(publicKey)) } - @Test - fun `register incorrect party to public key `(){ + @Test(timeout=300_000) + fun `register incorrect party to public key `(){ database.transaction { identityService.verifyAndRegisterIdentity(ALICE_IDENTITY) } val (alice, anonymousAlice) = createConfidentialIdentity(ALICE.name) identityService.registerKey(anonymousAlice.owningKey, alice.party) @@ -282,8 +282,8 @@ class PersistentIdentityServiceTests { assertEquals(ALICE, identityService.wellKnownPartyFromAnonymous(AnonymousParty(anonymousAlice.owningKey))) } - @Test - fun `P&C size`() { + @Test(timeout=300_000) + fun `P&C size`() { val (_, anonymousAlice) = createConfidentialIdentity(ALICE.name) val serializedCert = anonymousAlice.serialize() println(serializedCert) @@ -306,8 +306,8 @@ class PersistentIdentityServiceTests { /** * Ensure if we feed in a full identity, we get the same identity back. */ - @Test - fun `deanonymising a well known identity should return the identity`() { + @Test(timeout=300_000) + fun `deanonymising a well known identity should return the identity`() { val service = makeTestIdentityService() val expected = ALICE service.verifyAndRegisterIdentity(ALICE_IDENTITY) @@ -318,8 +318,8 @@ class PersistentIdentityServiceTests { /** * Ensure we don't blindly trust what an anonymous identity claims to be. */ - @Test - fun `deanonymising a false well known identity should return null`() { + @Test(timeout=300_000) + fun `deanonymising a false well known identity should return null`() { val service = makeTestIdentityService() val notAlice = Party(ALICE.name, generateKeyPair().public) service.verifyAndRegisterIdentity(ALICE_IDENTITY) diff --git a/node/src/test/kotlin/net/corda/node/services/keys/FilterMyKeysTests.kt b/node/src/test/kotlin/net/corda/node/services/keys/FilterMyKeysTests.kt index cc5cc12f15..230049f0b7 100644 --- a/node/src/test/kotlin/net/corda/node/services/keys/FilterMyKeysTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/keys/FilterMyKeysTests.kt @@ -9,8 +9,8 @@ import org.junit.Test import kotlin.test.assertEquals class FilterMyKeysTests { - @Test - fun test() { + @Test(timeout=300_000) + fun test() { val name = CordaX500Name("Roger", "Office", "GB") val (_, services) = MockServices.makeTestDatabaseAndPersistentServices( cordappPackages = emptyList(), diff --git a/node/src/test/kotlin/net/corda/node/services/keys/KMSUtilsTests.kt b/node/src/test/kotlin/net/corda/node/services/keys/KMSUtilsTests.kt index d43a11c2e9..9d0a8bcbae 100644 --- a/node/src/test/kotlin/net/corda/node/services/keys/KMSUtilsTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/keys/KMSUtilsTests.kt @@ -14,8 +14,8 @@ import org.junit.Test import kotlin.test.assertEquals class KMSUtilsTests { - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `should generate certificates with the correct role`() { val aliceKey = generateKeyPair() val alice = getTestPartyAndCertificate(ALICE_NAME, aliceKey.public) diff --git a/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt b/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt index 00b2b9d991..4d8736133e 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt @@ -71,20 +71,20 @@ class DBNetworkParametersStorageTest { database.close() } - @Test - fun `set current parameters`() { + @Test(timeout=300_000) + fun `set current parameters`() { assertThat(networkParametersService.currentHash).isEqualTo(hash1) assertThat(networkParametersService.lookup(hash1)).isEqualTo(netParams1.verified()) } - @Test - fun `get default parameters`() { + @Test(timeout=300_000) + fun `get default parameters`() { // TODO After implementing default endpoint on network map check it is correct, for now we set it to current. assertThat(networkParametersService.defaultHash).isEqualTo(hash1) } - @Test - fun `download parameters from network map server`() { + @Test(timeout=300_000) + fun `download parameters from network map server`() { database.transaction { val netParams = networkParametersService.lookup(hash2) assertThat(networkParametersService.lookup(hash2)).isEqualTo(netParams) @@ -93,8 +93,8 @@ class DBNetworkParametersStorageTest { } } - @Test - fun `try save parameters with incorrect signature`() { + @Test(timeout=300_000) + fun `try save parameters with incorrect signature`() { database.transaction { // logs a warning (java.security.cert.CertPathValidatorException: Cert path failed to validate) assertNull(networkParametersService.lookup(hash3)) diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt index ca5ae8827c..0ba75cc799 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt @@ -25,8 +25,8 @@ class NetworkMapCacheTest { mockNet.stopNodes() } - @Test - fun `key collision`() { + @Test(timeout=300_000) + fun `key collision`() { val entropy = BigInteger.valueOf(24012017L) val aliceNode = mockNet.createNode(InternalMockNodeParameters(legalName = ALICE_NAME, entropyRoot = entropy)) val alice = aliceNode.info.singleIdentity() @@ -42,8 +42,8 @@ class NetworkMapCacheTest { assertEquals(aliceNode.services.networkMapCache.getNodesByLegalIdentityKey(alice.owningKey).singleOrNull(), bobNode.info) } - @Test - fun getNodeByLegalIdentity() { + @Test(timeout=300_000) + fun getNodeByLegalIdentity() { val aliceNode = mockNet.createPartyNode(ALICE_NAME) val alice = aliceNode.info.singleIdentity() val bobNode = mockNet.createPartyNode(BOB_NAME) @@ -56,8 +56,8 @@ class NetworkMapCacheTest { // TODO: Should have a test case with anonymous lookup } - @Test - fun getPeerByLegalName() { + @Test(timeout=300_000) + fun getPeerByLegalName() { val aliceNode = mockNet.createPartyNode(ALICE_NAME) val bobNode = mockNet.createPartyNode(BOB_NAME) val bobCache: NetworkMapCache = bobNode.services.networkMapCache @@ -67,8 +67,8 @@ class NetworkMapCacheTest { assertEquals(expected, actual) } - @Test - fun `caches get cleared on modification`() { + @Test(timeout=300_000) + fun `caches get cleared on modification`() { val aliceNode = mockNet.createPartyNode(ALICE_NAME) val bobNode = mockNet.createPartyNode(BOB_NAME) val bobCache: NetworkMapCache = bobNode.services.networkMapCache @@ -92,8 +92,8 @@ class NetworkMapCacheTest { assertEquals(aliceNode.info, bobCache.getNodesByLegalIdentityKey(aliceNode.info.singleIdentity().owningKey).single()) } - @Test - fun `remove node from cache`() { + @Test(timeout=300_000) + fun `remove node from cache`() { val aliceNode = mockNet.createPartyNode(ALICE_NAME) val bobNode = mockNet.createPartyNode(BOB_NAME) val bob = bobNode.info.singleIdentity() @@ -108,8 +108,8 @@ class NetworkMapCacheTest { } } - @Test - fun `add two nodes the same name different keys`() { + @Test(timeout=300_000) + fun `add two nodes the same name different keys`() { val aliceNode = mockNet.createPartyNode(ALICE_NAME) val aliceCache = aliceNode.services.networkMapCache val alicePartyAndCert2 = getTestPartyAndCertificate(ALICE_NAME, generateKeyPair().public) diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt index ad801ffc99..eb2f06c006 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt @@ -51,8 +51,8 @@ class NetworkMapClientTest { server.close() } - @Test - fun `registered node is added to the network map`() { + @Test(timeout=300_000) + fun `registered node is added to the network map`() { val (nodeInfo, signedNodeInfo) = createNodeInfoAndSigned(ALICE_NAME) networkMapClient.publish(signedNodeInfo) @@ -72,8 +72,8 @@ class NetworkMapClientTest { assertEquals(nodeInfo2, networkMapClient.getNodeInfo(nodeInfoHash2)) } - @Test - fun `negative test - registered invalid node is added to the network map`() { + @Test(timeout=300_000) + fun `negative test - registered invalid node is added to the network map`() { val invalidLongNodeName = CordaX500Name( commonName = "AB123456789012345678901234567890123456789012345678901234567890", organisationUnit = "AB123456789012345678901234567890123456789012345678901234567890", @@ -92,8 +92,8 @@ class NetworkMapClientTest { assertEquals(nodeInfo, networkMapClient.getNodeInfo(nodeInfoHash)) } - @Test - fun `errors return a meaningful error message`() { + @Test(timeout=300_000) + fun `errors return a meaningful error message`() { val nodeInfoBuilder = TestNodeInfoBuilder() val (_, aliceKey) = nodeInfoBuilder.addLegalIdentity(ALICE_NAME) nodeInfoBuilder.addLegalIdentity(BOB_NAME) @@ -105,21 +105,21 @@ class NetworkMapClientTest { .hasMessage("Response Code 403: Missing signatures. Found 1 expected 2") } - @Test - fun `download NetworkParameters correctly`() { + @Test(timeout=300_000) + fun `download NetworkParameters correctly`() { // The test server returns same network parameter for any hash. val parametersHash = server.networkParameters.serialize().hash val networkParameters = networkMapClient.getNetworkParameters(parametersHash).verified() assertEquals(server.networkParameters, networkParameters) } - @Test - fun `get hostname string from http response correctly`() { + @Test(timeout=300_000) + fun `get hostname string from http response correctly`() { assertEquals("test.host.name", networkMapClient.myPublicHostname()) } - @Test - fun `handle parameters update`() { + @Test(timeout=300_000) + fun `handle parameters update`() { val nextParameters = testNetworkParameters(epoch = 2) val originalNetworkParameterHash = server.networkParameters.serialize().hash val nextNetworkParameterHash = nextParameters.serialize().hash diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt index 3842c044bf..a418b89cc9 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt @@ -107,8 +107,8 @@ class NetworkMapUpdaterTest { NetworkParameterAcceptanceSettings(autoAcceptNetworkParameters, excludedAutoAcceptNetworkParameters)) } - @Test - fun `process add node updates from network map, with additional node infos from dir`() { + @Test(timeout=300_000) + fun `process add node updates from network map, with additional node infos from dir`() { setUpdater() val (_, signedNodeInfo1) = createNodeInfoAndSigned("Info 1") val (_, signedNodeInfo2) = createNodeInfoAndSigned("Info 2") @@ -149,8 +149,8 @@ class NetworkMapUpdaterTest { )) } - @Test - fun `process remove node updates from network map, with additional node infos from dir`() { + @Test(timeout=300_000) + fun `process remove node updates from network map, with additional node infos from dir`() { setUpdater() val (nodeInfo1, signedNodeInfo1) = createNodeInfoAndSigned("Info 1") val (nodeInfo2, signedNodeInfo2) = createNodeInfoAndSigned("Info 2") @@ -195,8 +195,8 @@ class NetworkMapUpdaterTest { assertThat(networkMapCache.allNodeHashes).containsOnly(fileNodeInfoAndSigned.nodeInfo.serialize().hash) } - @Test - fun `receive node infos from directory, without a network map`() { + @Test(timeout=300_000) + fun `receive node infos from directory, without a network map`() { setUpdater(netMapClient = null) val fileNodeInfoAndSigned = createNodeInfoAndSigned("Info from file") @@ -216,8 +216,8 @@ class NetworkMapUpdaterTest { assertThat(networkMapCache.allNodeHashes).containsOnly(fileNodeInfoAndSigned.nodeInfo.serialize().hash) } - @Test - fun `emit new parameters update info on parameters update from network map`() { + @Test(timeout=300_000) + fun `emit new parameters update info on parameters update from network map`() { setUpdater() val paramsFeed = updater!!.trackParametersUpdate() val snapshot = paramsFeed.snapshot @@ -239,8 +239,8 @@ class NetworkMapUpdaterTest { } } - @Test - fun `ack network parameters update`() { + @Test(timeout=300_000) + fun `ack network parameters update`() { setUpdater() val newParameters = testNetworkParameters(epoch = 314, maxMessageSize = 10485761) server.scheduleParametersUpdate(newParameters, "Test update", Instant.MIN) @@ -258,8 +258,8 @@ class NetworkMapUpdaterTest { assertEquals(newHash, server.latestParametersAccepted(ourKeyPair.public)) } - @Test - fun `network parameters auto-accepted when update only changes whitelist`() { + @Test(timeout=300_000) + fun `network parameters auto-accepted when update only changes whitelist`() { setUpdater() val newParameters = testNetworkParameters( epoch = 314, @@ -276,8 +276,8 @@ class NetworkMapUpdaterTest { assertEquals(newHash, server.latestParametersAccepted(ourKeyPair.public)) } - @Test - fun `network parameters not auto-accepted when update only changes whitelist but parameter included in exclusion`() { + @Test(timeout=300_000) + fun `network parameters not auto-accepted when update only changes whitelist but parameter included in exclusion`() { setUpdater() val newParameters = testNetworkParameters( epoch = 314, @@ -290,8 +290,8 @@ class NetworkMapUpdaterTest { assert(!updateFile.exists()) { "network parameters should not be auto accepted" } } - @Test - fun `network parameters not auto-accepted when update only changes whitelist but auto accept configured to be false`() { + @Test(timeout=300_000) + fun `network parameters not auto-accepted when update only changes whitelist but auto accept configured to be false`() { setUpdater() val newParameters = testNetworkParameters( epoch = 314, @@ -304,8 +304,8 @@ class NetworkMapUpdaterTest { assert(!updateFile.exists()) { "network parameters should not be auto accepted" } } - @Test - fun `fetch nodes from private network`() { + @Test(timeout=300_000) + fun `fetch nodes from private network`() { setUpdater(extraNetworkMapKeys = listOf(privateNetUUID)) server.addNodesToPrivateNetwork(privateNetUUID, listOf(ALICE_NAME)) assertThatThrownBy { networkMapClient.getNetworkMap(privateNetUUID).payload.nodeInfoHashes } @@ -321,8 +321,8 @@ class NetworkMapUpdaterTest { assertEquals(aliceInfo, networkMapClient.getNodeInfo(aliceHash)) } - @Test - fun `remove node from filesystem deletes it from network map cache`() { + @Test(timeout=300_000) + fun `remove node from filesystem deletes it from network map cache`() { setUpdater(netMapClient = null) val fileNodeInfoAndSigned1 = createNodeInfoAndSigned("Info from file 1") val fileNodeInfoAndSigned2 = createNodeInfoAndSigned("Info from file 2") @@ -344,8 +344,8 @@ class NetworkMapUpdaterTest { assertThat(networkMapCache.allNodeHashes).containsOnly(fileNodeInfoAndSigned2.signed.raw.hash) } - @Test - fun `remove node info file, but node in network map server`() { + @Test(timeout=300_000) + fun `remove node info file, but node in network map server`() { setUpdater() val nodeInfoBuilder = TestNodeInfoBuilder() val (_, key) = nodeInfoBuilder.addLegalIdentity(CordaX500Name("Info", "London", "GB")) @@ -378,8 +378,8 @@ class NetworkMapUpdaterTest { //Test fix for ENT-1882 //This scenario can happen when signing of network map server is performed much longer after the node joined the network. //Network map will advertise hashes without that node. - @Test - fun `not remove own node info when it is not in network map yet`() { + @Test(timeout=300_000) + fun `not remove own node info when it is not in network map yet`() { val (myInfo, signedMyInfo) = createNodeInfoAndSigned("My node info") val (_, signedOtherInfo) = createNodeInfoAndSigned("Other info") setUpdater() @@ -392,8 +392,8 @@ class NetworkMapUpdaterTest { assertThat(networkMapCache.allNodeHashes).containsExactlyInAnyOrder(signedMyInfo.raw.hash, signedOtherInfo.raw.hash) } - @Test - fun `network map updater removes the correct node info after node info changes`() { + @Test(timeout=300_000) + fun `network map updater removes the correct node info after node info changes`() { setUpdater() val builder = TestNodeInfoBuilder() @@ -421,8 +421,8 @@ class NetworkMapUpdaterTest { assert(networkMapCache.allNodeHashes.size == 1) } - @Test - fun `auto acceptance checks are correct`() { + @Test(timeout=300_000) + fun `auto acceptance checks are correct`() { val packageOwnership = mapOf( "com.example1" to generateKeyPair().public, "com.example2" to generateKeyPair().public diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt index 4378ddc314..6a856d3246 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt @@ -49,8 +49,8 @@ class NetworkParametersReaderTest { fs.close() } - @Test - fun `read correct set of parameters from file`() { + @Test(timeout=300_000) + fun `read correct set of parameters from file`() { val baseDirectory = fs.getPath("/node").createDirectories() val oldParameters = testNetworkParameters(epoch = 1) NetworkParametersCopier(oldParameters).install(baseDirectory) @@ -65,8 +65,8 @@ class NetworkParametersReaderTest { assertEquals(server.networkParameters, parametersFromFile) } - @Test - fun `read network parameters from file when network map server is down`() { + @Test(timeout=300_000) + fun `read network parameters from file when network map server is down`() { server.close() val baseDirectory = fs.getPath("/node").createDirectories() val fileParameters = testNetworkParameters(epoch = 1) @@ -75,8 +75,8 @@ class NetworkParametersReaderTest { assertThat(parameters).isEqualTo(fileParameters) } - @Test - fun `serialized parameters compatibility`() { + @Test(timeout=300_000) + fun `serialized parameters compatibility`() { // Network parameters file from before eventHorizon extension val inputStream = javaClass.classLoader.getResourceAsStream("network-compatibility/network-parameters") assertNotNull(inputStream) diff --git a/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt index dd387c5a5c..99f08b5a17 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt @@ -55,8 +55,8 @@ class NodeInfoWatcherTest { nodeInfoPath = tempFolder.root.toPath() / NODE_INFO_DIRECTORY } - @Test - fun `save a NodeInfo`() { + @Test(timeout=300_000) + fun `save a NodeInfo`() { assertEquals(0, tempFolder.root.list().filter { it.startsWith(NodeInfoFilesCopier.NODE_INFO_FILE_NAME_PREFIX) }.size) NodeInfoWatcher.saveToFile(tempFolder.root.toPath(), nodeInfoAndSigned) @@ -70,15 +70,15 @@ class NodeInfoWatcherTest { assertThat(file.size).isGreaterThan(0) } - @Test - fun `save a NodeInfo to JimFs`() { + @Test(timeout=300_000) + fun `save a NodeInfo to JimFs`() { val jimFs = Jimfs.newFileSystem(Configuration.unix()) val jimFolder = jimFs.getPath("/nodeInfo").createDirectories() NodeInfoWatcher.saveToFile(jimFolder, nodeInfoAndSigned) } - @Test - fun `load an empty Directory`() { + @Test(timeout=300_000) + fun `load an empty Directory`() { nodeInfoPath.createDirectories() val subscription = nodeInfoWatcher.nodeInfoUpdates().subscribe(testSubscriber) @@ -91,8 +91,8 @@ class NodeInfoWatcherTest { } } - @Test - fun `load a non empty Directory`() { + @Test(timeout=300_000) + fun `load a non empty Directory`() { createNodeInfoFileInPath() val subscription = nodeInfoWatcher.nodeInfoUpdates().subscribe(testSubscriber) @@ -107,8 +107,8 @@ class NodeInfoWatcherTest { } } - @Test - fun `polling folder`() { + @Test(timeout=300_000) + fun `polling folder`() { nodeInfoPath.createDirectories() // Start polling with an empty folder. diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapNonConcurrentTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapNonConcurrentTest.kt index a917ffd04a..ad4deb1c97 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapNonConcurrentTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapNonConcurrentTest.kt @@ -54,8 +54,8 @@ class AppendOnlyPersistentMapNonConcurrentTest { database.close() } - @Test - fun `map prevents duplicates, when key has been evicted from cache, but present in database`() { + @Test(timeout=300_000) + fun `map prevents duplicates, when key has been evicted from cache, but present in database`() { val map = createMap(1) database.transaction { @@ -86,8 +86,8 @@ class AppendOnlyPersistentMapNonConcurrentTest { return rowsUpdated != 0 } - @Test - fun `can update entry in map`() { + @Test(timeout=300_000) + fun `can update entry in map`() { val map = createMap(1) database.transaction { @@ -102,8 +102,8 @@ class AppendOnlyPersistentMapNonConcurrentTest { assertThat(result).isEqualTo("updated") } - @Test - fun `update succeeds if value not in cache but in database`() { + @Test(timeout=300_000) + fun `update succeeds if value not in cache but in database`() { val map = createMap(1) database.transaction { map[1] = "1" @@ -119,8 +119,8 @@ class AppendOnlyPersistentMapNonConcurrentTest { assertThat(result).isEqualTo("updated") } - @Test - fun `update succeeds if in same transaction as create`() { + @Test(timeout=300_000) + fun `update succeeds if in same transaction as create`() { val map = createMap(1) database.transaction { map[1] = "1" diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt index a054ae24a3..acfefd9c8e 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt @@ -64,8 +64,8 @@ class AppendOnlyPersistentMapTest(var scenario: Scenario) { database.close() } - @Test - fun `concurrent test no purge between A and B`() { + @Test(timeout=300_000) + fun `concurrent test no purge between A and B`() { prepopulateIfRequired() val map = createMap() val a = TestThread("A", map).apply { start() } @@ -93,8 +93,8 @@ class AppendOnlyPersistentMapTest(var scenario: Scenario) { assertTrue(map.pendingKeysIsEmpty()) } - @Test - fun `test no purge with only a single transaction`() { + @Test(timeout=300_000) + fun `test no purge with only a single transaction`() { prepopulateIfRequired() val map = createMap() val a = TestThread("A", map, true).apply { @@ -120,8 +120,8 @@ class AppendOnlyPersistentMapTest(var scenario: Scenario) { } - @Test - fun `concurrent test purge between A and B`() { + @Test(timeout=300_000) + fun `concurrent test purge between A and B`() { // Writes intentionally do not check the database first, so purging between read and write changes behaviour val remapped = mapOf(Scenario(true, ReadOrWrite.Read, ReadOrWrite.Write, Outcome.Success, Outcome.Fail) to Scenario(true, ReadOrWrite.Read, ReadOrWrite.Write, Outcome.Success, Outcome.SuccessButErrorOnCommit)) scenario = remapped[scenario] ?: scenario @@ -154,8 +154,8 @@ class AppendOnlyPersistentMapTest(var scenario: Scenario) { assertTrue(map.pendingKeysIsEmpty()) } - @Test - fun `test purge mid-way in a single transaction`() { + @Test(timeout=300_000) + fun `test purge mid-way in a single transaction`() { // Writes intentionally do not check the database first, so purging between read and write changes behaviour // Also, a purge after write causes the subsequent read to flush to the database, causing the read to generate a constraint violation when single threaded (in same database transaction). val remapped = mapOf(Scenario(true, ReadOrWrite.Read, ReadOrWrite.Write, Outcome.Success, Outcome.Fail) to Scenario(true, ReadOrWrite.Read, ReadOrWrite.Write, Outcome.SuccessButErrorOnCommit, Outcome.SuccessButErrorOnCommit), diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt index c39e6e664e..c7ceb785da 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/DBCheckpointStorageTests.kt @@ -61,8 +61,8 @@ class DBCheckpointStorageTests { LogHelper.reset(PersistentUniquenessProvider::class) } - @Test - fun `add new checkpoint`() { + @Test(timeout=300_000) + fun `add new checkpoint`() { val (id, checkpoint) = newCheckpoint() database.transaction { checkpointStorage.addCheckpoint(id, checkpoint) @@ -76,8 +76,8 @@ class DBCheckpointStorageTests { } } - @Test - fun `remove checkpoint`() { + @Test(timeout=300_000) + fun `remove checkpoint`() { val (id, checkpoint) = newCheckpoint() database.transaction { checkpointStorage.addCheckpoint(id, checkpoint) @@ -94,8 +94,8 @@ class DBCheckpointStorageTests { } } - @Test - fun `add and remove checkpoint in single commit operate`() { + @Test(timeout=300_000) + fun `add and remove checkpoint in single commit operate`() { val (id, checkpoint) = newCheckpoint() val (id2, checkpoint2) = newCheckpoint() database.transaction { @@ -112,8 +112,8 @@ class DBCheckpointStorageTests { } } - @Test - fun `add two checkpoints then remove first one`() { + @Test(timeout=300_000) + fun `add two checkpoints then remove first one`() { val (id, firstCheckpoint) = newCheckpoint() database.transaction { checkpointStorage.addCheckpoint(id, firstCheckpoint) @@ -134,8 +134,8 @@ class DBCheckpointStorageTests { } } - @Test - fun `add checkpoint and then remove after 'restart'`() { + @Test(timeout=300_000) + fun `add checkpoint and then remove after 'restart'`() { val (id, originalCheckpoint) = newCheckpoint() database.transaction { checkpointStorage.addCheckpoint(id, originalCheckpoint) @@ -155,8 +155,8 @@ class DBCheckpointStorageTests { } } - @Test - fun `verify checkpoints compatible`() { + @Test(timeout=300_000) + fun `verify checkpoints compatible`() { val mockServices = MockServices(emptyList(), ALICE.name) database.transaction { val (id, checkpoint) = newCheckpoint(1) diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/DBTransactionStorageTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/DBTransactionStorageTests.kt index a512e5985b..0dabdd1069 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/DBTransactionStorageTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/DBTransactionStorageTests.kt @@ -61,7 +61,7 @@ class DBTransactionStorageTests { override fun instant(): Instant = timeNow } - @Test + @Test(timeout = 300_000) fun `create verified transaction and validate timestamp in db`() { val now = Instant.ofEpochSecond(111222333L) val transactionClock = TransactionClock(now) @@ -71,7 +71,7 @@ class DBTransactionStorageTests { assertEquals(now, readTransactionTimestampFromDB(transaction.id)) } - @Test + @Test(timeout = 300_000) fun `create unverified transaction and validate timestamp in db`() { val now = Instant.ofEpochSecond(333444555L) val transactionClock = TransactionClock(now) @@ -81,7 +81,7 @@ class DBTransactionStorageTests { assertEquals(now, readTransactionTimestampFromDB(transaction.id)) } - @Test + @Test(timeout = 300_000) fun `create unverified then verified transaction and validate timestamps in db`() { val unverifiedTime = Instant.ofEpochSecond(555666777L) val verifiedTime = Instant.ofEpochSecond(888999111L) @@ -95,7 +95,7 @@ class DBTransactionStorageTests { assertEquals(verifiedTime, readTransactionTimestampFromDB(transaction.id)) } - @Test + @Test(timeout = 300_000) fun `check timestamp does not change when attempting to move transaction from verified to unverified`() { val verifiedTime = Instant.ofEpochSecond(555666222L) @@ -116,7 +116,7 @@ class DBTransactionStorageTests { assertEquals(verifiedTime, readTransactionTimestampFromDB(transaction.id)) } - @Test + @Test(timeout = 300_000) fun `check timestamp does not change when transaction saved twice in same DB transaction scope`() { val verifiedTime = Instant.ofEpochSecond(3333666222L) val differentTime = Instant.ofEpochSecond(111777666L) @@ -133,7 +133,7 @@ class DBTransactionStorageTests { assertEquals(verifiedTime, readTransactionTimestampFromDB(firstTransaction.id)) } - @Test + @Test(timeout = 300_000) fun `check timestamp does not change when transaction saved twice in two DB transaction scopes`() { val verifiedTime = Instant.ofEpochSecond(11119999222L) val differentTime = Instant.ofEpochSecond(666333222L) @@ -166,7 +166,7 @@ class DBTransactionStorageTests { return fromDb[0].timestamp } - @Test + @Test(timeout = 300_000) fun `empty store`() { assertThat(transactionStorage.getTransaction(newTransaction().id)).isNull() assertThat(transactionStorage.transactions).isEmpty() @@ -174,7 +174,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).isEmpty() } - @Test + @Test(timeout = 300_000) fun `one transaction`() { val transaction = newTransaction() transactionStorage.addTransaction(transaction) @@ -185,7 +185,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).containsExactly(transaction) } - @Test + @Test(timeout = 300_000) fun `two transactions across restart`() { val firstTransaction = newTransaction() val secondTransaction = newTransaction() @@ -197,7 +197,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).containsOnly(firstTransaction, secondTransaction) } - @Test + @Test(timeout = 300_000) fun `two transactions with rollback`() { val firstTransaction = newTransaction() val secondTransaction = newTransaction() @@ -210,7 +210,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).isEmpty() } - @Test + @Test(timeout = 300_000) fun `two transactions in same DB transaction scope`() { val firstTransaction = newTransaction() val secondTransaction = newTransaction() @@ -221,7 +221,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).containsOnly(firstTransaction, secondTransaction) } - @Test + @Test(timeout = 300_000) fun `transaction saved twice in same DB transaction scope`() { val firstTransaction = newTransaction() database.transaction { @@ -232,7 +232,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).containsOnly(firstTransaction) } - @Test + @Test(timeout = 300_000) fun `transaction saved twice in two DB transaction scopes`() { val firstTransaction = newTransaction() val secondTransaction = newTransaction() @@ -247,7 +247,7 @@ class DBTransactionStorageTests { assertThat(transactionStorage.transactions).containsOnly(firstTransaction, secondTransaction) } - @Test + @Test(timeout = 300_000) fun `updates are fired`() { val future = transactionStorage.updates.toFuture() val expected = newTransaction() @@ -256,7 +256,7 @@ class DBTransactionStorageTests { assertEquals(expected, actual) } - @Test + @Test(timeout = 300_000) fun `duplicates are detected when transaction is evicted from cache`() { newTransactionStorage(cacheSizeBytesOverride = 0) val transaction = newTransaction() @@ -269,7 +269,7 @@ class DBTransactionStorageTests { } } - @Test + @Test(timeout = 300_000) fun `unverified transaction is correctly added in add transaction`() { val transaction = newTransaction() val added = database.transaction { @@ -292,8 +292,8 @@ class DBTransactionStorageTests { assertTrue(secondAdded) } - @Test - fun `cannot move transaction from verified to unverified`() { + @Test(timeout=300_000) + fun `cannot move transaction from verified to unverified`() { val transaction = newTransaction() database.transaction { transactionStorage.addTransaction(transaction) diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/DbMapDeadlockTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/DbMapDeadlockTest.kt index cf10667496..45c800aaf8 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/DbMapDeadlockTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/DbMapDeadlockTest.kt @@ -84,8 +84,8 @@ class DbMapDeadlockTest { } } - @Test - fun checkAppendOnlyPersistentMapForDeadlockH2() { + @Test(timeout=300_000) + fun checkAppendOnlyPersistentMapForDeadlockH2() { recreateDeadlock(h2Properties) } diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/ExposeJpaToFlowsTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/ExposeJpaToFlowsTests.kt index 924b1ac78e..30f370e38f 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/ExposeJpaToFlowsTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/ExposeJpaToFlowsTests.kt @@ -60,8 +60,8 @@ class ExposeJpaToFlowsTests { mockNet.stopNodes() } - @Test - fun `can persist and query custom entities`() { + @Test(timeout=300_000) + fun `can persist and query custom entities`() { val foo = FooSchemaV1.PersistentFoo(UniqueIdentifier().id.toString(), "Bar") // Persist the foo. @@ -80,8 +80,8 @@ class ExposeJpaToFlowsTests { assertEquals("Bar", result.single().fooData) } - @Test - fun `can't perform suspendable operations inside withEntityManager`() { + @Test(timeout=300_000) + fun `can't perform suspendable operations inside withEntityManager`() { val mockNode = mockNet.createNode() assertFailsWith(KryoException::class) { mockNode.startFlow(object : FlowLogic() { diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt index b12c2e00ae..a4f0a47e8c 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/HibernateConfigurationTest.kt @@ -155,8 +155,8 @@ class HibernateConfigurationTest { database.close() } - @Test - fun `count rows`() { + @Test(timeout=300_000) + fun `count rows`() { // structure query val countQuery = criteriaBuilder.createQuery(Long::class.java) countQuery.select(criteriaBuilder.count(countQuery.from(VaultSchemaV1.VaultStates::class.java))) @@ -167,8 +167,8 @@ class HibernateConfigurationTest { assertThat(countResult).isEqualTo(10) } - @Test - fun `consumed states`() { + @Test(timeout=300_000) + fun `consumed states`() { database.transaction { consumeCash(50.DOLLARS) } @@ -187,8 +187,8 @@ class HibernateConfigurationTest { assertThat(coins.toDecimal() >= BigDecimal("50.00")) } - @Test - fun `select by composite primary key`() { + @Test(timeout=300_000) + fun `select by composite primary key`() { val issuedStates = database.transaction { vaultFiller.fillWithSomeTestLinearStates(8) @@ -212,8 +212,8 @@ class HibernateConfigurationTest { assertThat(queryResults.last().stateRef?.index).isEqualTo(issuedStates.states.last().ref.index) } - @Test - fun `distinct contract types`() { + @Test(timeout=300_000) + fun `distinct contract types`() { database.transaction { // add 2 more contract types vaultFiller.fillWithSomeTestLinearStates(10) @@ -230,8 +230,8 @@ class HibernateConfigurationTest { Assertions.assertThat(queryResults.size).isEqualTo(3) } - @Test - fun `with sorting`() { + @Test(timeout=300_000) + fun `with sorting`() { // structure query val criteriaQuery = criteriaBuilder.createQuery(VaultSchemaV1.VaultStates::class.java) val vaultStates = criteriaQuery.from(VaultSchemaV1.VaultStates::class.java) @@ -247,8 +247,8 @@ class HibernateConfigurationTest { queryResultsAsc.map { println(it.recordedTime) } } - @Test - fun `with sorting by state ref desc and asc`() { + @Test(timeout=300_000) + fun `with sorting by state ref desc and asc`() { // generate additional state ref indexes database.transaction { (1..5).forEach { consumeCash(it.DOLLARS) } @@ -273,8 +273,8 @@ class HibernateConfigurationTest { queryResultsAsc.map { println(it.stateRef) } } - @Test - fun `with sorting by state ref index and txId desc and asc`() { + @Test(timeout=300_000) + fun `with sorting by state ref index and txId desc and asc`() { // generate additional state ref indexes database.transaction { (1..5).forEach { consumeCash(it.DOLLARS) } @@ -300,8 +300,8 @@ class HibernateConfigurationTest { queryResultsAsc.map { println(it.stateRef) } } - @Test - fun `with pagination`() { + @Test(timeout=300_000) + fun `with pagination`() { // add 100 additional cash entries database.transaction { vaultFiller.fillWithSomeTestCash(1000.POUNDS, issuerServices, 100, issuer.ref(1), rng = Random(0L)) @@ -332,8 +332,8 @@ class HibernateConfigurationTest { /** * VaultLinearState is a concrete table, extendible by any Contract extending a LinearState */ - @Test - fun `select by composite primary key on LinearStates`() { + @Test(timeout=300_000) + fun `select by composite primary key on LinearStates`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(10) } @@ -359,8 +359,8 @@ class HibernateConfigurationTest { /** * CashSchemaV1 = original Cash schema (extending PersistentState) */ - @Test - fun `count CashStates`() { + @Test(timeout=300_000) + fun `count CashStates`() { // structure query val countQuery = criteriaBuilder.createQuery(Long::class.java) countQuery.select(criteriaBuilder.count(countQuery.from(CashSchemaV1.PersistentCashState::class.java))) @@ -371,8 +371,8 @@ class HibernateConfigurationTest { assertThat(countResult).isEqualTo(10) } - @Test - fun `select by composite primary key on CashStates`() { + @Test(timeout=300_000) + fun `select by composite primary key on CashStates`() { // structure query val criteriaQuery = criteriaBuilder.createQuery(VaultSchemaV1.VaultStates::class.java) val vaultStates = criteriaQuery.from(VaultSchemaV1.VaultStates::class.java) @@ -383,8 +383,8 @@ class HibernateConfigurationTest { assertThat(queryResults).hasSize(10) } - @Test - fun `select and join by composite primary key on CashStates`() { + @Test(timeout=300_000) + fun `select and join by composite primary key on CashStates`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(5) // structure query @@ -401,8 +401,8 @@ class HibernateConfigurationTest { } } - @Test - fun `calculate cash balances`() { + @Test(timeout=300_000) + fun `calculate cash balances`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 10, issuer.ref(1)) // +$100 = $200 vaultFiller.fillWithSomeTestCash(50.POUNDS, issuerServices, 5, issuer.ref(1)) // £50 = £50 @@ -434,8 +434,8 @@ class HibernateConfigurationTest { assertThat(queryResults[2].get(1)).isEqualTo(20000L) } - @Test - fun `calculate cash balance for single currency`() { + @Test(timeout=300_000) + fun `calculate cash balance for single currency`() { database.transaction { vaultFiller.fillWithSomeTestCash(50.POUNDS, issuerServices, 5, issuer.ref(1)) // £50 = £50 vaultFiller.fillWithSomeTestCash(25.POUNDS, issuerServices, 5, issuer.ref(1)) // +£25 = £175 @@ -464,8 +464,8 @@ class HibernateConfigurationTest { assertThat(queryResults[0].get(1)).isEqualTo(7500L) } - @Test - fun `calculate and order by cash balance for owner and currency`() { + @Test(timeout=300_000) + fun `calculate and order by cash balance for owner and currency`() { database.transaction { val bank = bankServices.myInfo.legalIdentities.single() vaultFiller.fillWithSomeTestCash(200.DOLLARS, bankServices, 2, bank.ref(1)) @@ -506,8 +506,8 @@ class HibernateConfigurationTest { /** * CashSchemaV2 = optimised Cash schema (extending FungibleState) */ - @Test - fun `count CashStates in V2`() { + @Test(timeout=300_000) + fun `count CashStates in V2`() { database.transaction { // persist cash states explicitly with V2 schema val stateAndRefs = cashStates.map { @@ -528,8 +528,8 @@ class HibernateConfigurationTest { assertThat(countResult).isEqualTo(10) } - @Test - fun `select by composite primary key on CashStates in V2`() { + @Test(timeout=300_000) + fun `select by composite primary key on CashStates in V2`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(5) // persist cash states explicitly with V2 schema @@ -564,8 +564,8 @@ class HibernateConfigurationTest { /** * DummyLinearStateV1 = original DummyLinearState schema (extending PersistentState) */ - @Test - fun `select by composite primary between VaultStates, VaultLinearStates and DummyLinearStates`() { + @Test(timeout=300_000) + fun `select by composite primary between VaultStates, VaultLinearStates and DummyLinearStates`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(8) vaultFiller.fillWithSomeTestDeals(listOf("123", "456", "789")) @@ -595,8 +595,8 @@ class HibernateConfigurationTest { * DummyLinearSchemaV2 = optimised DummyLinear schema (extending LinearState) */ - @Test - fun `three way join by composite primary between VaultStates, VaultLinearStates and DummyLinearStates`() { + @Test(timeout=300_000) + fun `three way join by composite primary between VaultStates, VaultLinearStates and DummyLinearStates`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(8) vaultFiller.fillWithSomeTestDeals(listOf("123", "456", "789")) @@ -625,8 +625,8 @@ class HibernateConfigurationTest { /** * Composite OR query */ - @Test - fun `composite or query across VaultStates, VaultLinearStates and DummyLinearStates`() { + @Test(timeout=300_000) + fun `composite or query across VaultStates, VaultLinearStates and DummyLinearStates`() { val uniqueID456 = UniqueIdentifier("456") database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, externalId = "123", linearString = "123", linearNumber = 123, linearBoolean = true) @@ -671,8 +671,8 @@ class HibernateConfigurationTest { /** * Test a OneToOne table mapping */ - @Test - fun `select fungible states by owner party`() { + @Test(timeout=300_000) + fun `select fungible states by owner party`() { database.transaction { // persist original cash states explicitly with V3 schema val stateAndRefs = cashStates.map { @@ -695,8 +695,8 @@ class HibernateConfigurationTest { /** * Test Query by Party (OneToOne table mapping) */ - @Test - fun `query fungible states by owner party`() { + @Test(timeout=300_000) + fun `query fungible states by owner party`() { database.transaction { // persist original cash states explicitly with V3 schema val stateAndRefs: MutableList = cashStates.map { @@ -748,8 +748,8 @@ class HibernateConfigurationTest { /** * Test a OneToMany table mapping */ - @Test - fun `select fungible states by participants`() { + @Test(timeout=300_000) + fun `select fungible states by participants`() { database.transaction { // persist cash states explicitly with V3 schema val stateAndRefs = cashStates.map { @@ -773,8 +773,8 @@ class HibernateConfigurationTest { /** * Test Query by participants (OneToMany table mapping) */ - @Test - fun `query fungible states by participants`() { + @Test(timeout=300_000) + fun `query fungible states by participants`() { val firstCashState = database.transaction { // persist original cash states explicitly with V3 schema @@ -832,8 +832,8 @@ class HibernateConfigurationTest { /** * Query with sorting on Common table attribute */ - @Test - fun `with sorting on attribute from common table`() { + @Test(timeout=300_000) + fun `with sorting on attribute from common table`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, externalId = "111") @@ -884,8 +884,8 @@ class HibernateConfigurationTest { /** * Query with sorting on Custom table attribute */ - @Test - fun `with sorting on attribute from custom table`() { + @Test(timeout=300_000) + fun `with sorting on attribute from custom table`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, externalId = "111") @@ -940,8 +940,8 @@ class HibernateConfigurationTest { /** * Test invoking SQL query using DB connection (session) */ - @Test - fun `test calling an arbitrary JDBC native query`() { + @Test(timeout=300_000) + fun `test calling an arbitrary JDBC native query`() { // DOCSTART JdbcSession val nativeQuery = "SELECT v.transaction_id, v.output_index FROM vault_states v WHERE v.state_status = 0" @@ -964,8 +964,8 @@ class HibernateConfigurationTest { return StateRef(SecureHash.parse(pStateRef.txId), pStateRef.index) } - @Test - fun `schema change`() { + @Test(timeout=300_000) + fun `schema change`() { fun createNewDB(schemas: Set, initialiseSchema: Boolean = true): CordaPersistence { val schemaService = NodeSchemaService(extraSchemas = schemas) val dataSourceProps = makeTestDataSourceProperties("aa") diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/HibernateInteractionTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/HibernateInteractionTests.kt index 07acf56246..b34fce53fe 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/HibernateInteractionTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/HibernateInteractionTests.kt @@ -74,8 +74,8 @@ class HibernateInteractionTests { // AbstractPartyToX500NameAsStringConverter could cause circular flush of Hibernate session because it is invoked during flush, and a // cache miss was doing a flush. This also checks that loading during flush does actually work. - @Test - fun `issue some cash on a notary that exists only in the database to check cache loading works in our identity column converters during flush of vault update`() { + @Test(timeout=300_000) + fun `issue some cash on a notary that exists only in the database to check cache loading works in our identity column converters during flush of vault update`() { val expected = 500.DOLLARS val ref = OpaqueBytes.of(0x01) @@ -90,8 +90,8 @@ class HibernateInteractionTests { assertEquals(expected.`issued by`(ourIdentity.ref(ref)), output.amount) } - @Test - fun `when a cascade is in progress (because of nested entities), the node avoids to flush & detach entities, since it's not allowed by Hibernate`() { + @Test(timeout=300_000) + fun `when a cascade is in progress (because of nested entities), the node avoids to flush & detach entities, since it's not allowed by Hibernate`() { val ourIdentity = services.myInfo.legalIdentities.first() val childEntities = listOf(SimpleContract.ChildState(ourIdentity)) diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt index ad84218294..aa0d828a7d 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt @@ -93,8 +93,8 @@ class NodeAttachmentServiceTest { database.close() } - @Test - fun `importing a signed jar saves the signers to the storage`() { + @Test(timeout=300_000) + fun `importing a signed jar saves the signers to the storage`() { SelfCleaningDir().use { file -> val jarAndSigner = makeTestSignedContractJar(file.path, "com.example.MyContract") val signedJar = jarAndSigner.first @@ -105,8 +105,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `importing a non-signed jar will save no signers`() { + @Test(timeout=300_000) + fun `importing a non-signed jar will save no signers`() { SelfCleaningDir().use { val jarName = makeTestContractJar(it.path, "com.example.MyContract") it.path.resolve(jarName).inputStream().use { jarStream -> @@ -116,8 +116,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `insert and retrieve`() { + @Test(timeout=300_000) + fun `insert and retrieve`() { val (testJar, expectedHash) = makeTestJar() val id = testJar.read { storage.importAttachment(it, "test", null) } @@ -140,8 +140,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `attachment can be overridden by trusted uploader`() { + @Test(timeout=300_000) + fun `attachment can be overridden by trusted uploader`() { SelfCleaningDir().use { file -> val contractJarName = makeTestContractJar(file.path, "com.example.MyContract") val attachment = file.path.resolve(contractJarName) @@ -160,8 +160,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `attachment cannot be overridden by untrusted uploader`() { + @Test(timeout=300_000) + fun `attachment cannot be overridden by untrusted uploader`() { SelfCleaningDir().use { file -> val contractJarName = makeTestContractJar(file.path, "com.example.MyContract") val attachment = file.path.resolve(contractJarName) @@ -177,8 +177,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `insert contract attachment as an untrusted uploader and then as trusted CorDapp uploader`() { + @Test(timeout=300_000) + fun `insert contract attachment as an untrusted uploader and then as trusted CorDapp uploader`() { SelfCleaningDir().use { file -> val contractJarName = makeTestContractJar(file.path, "com.example.MyContract") val testJar = file.path.resolve(contractJarName) @@ -203,8 +203,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `missing is not cached`() { + @Test(timeout=300_000) + fun `missing is not cached`() { val (testJar, expectedHash) = makeTestJar() val (jarB, hashB) = makeTestJar(listOf(Pair("file", "content"))) @@ -237,8 +237,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `metadata can be used to search`() { + @Test(timeout=300_000) + fun `metadata can be used to search`() { val (jarA, _) = makeTestJar() val (jarB, hashB) = makeTestJar(listOf(Pair("file", "content"))) val (jarC, hashC) = makeTestJar(listOf(Pair("magic_file", "magic_content_puff"))) @@ -259,8 +259,8 @@ class NodeAttachmentServiceTest { ) } - @Test - fun `contract class, versioning and signing metadata can be used to search`() { + @Test(timeout=300_000) + fun `contract class, versioning and signing metadata can be used to search`() { SelfCleaningDir().use { file -> val (sampleJar, _) = makeTestJar() val contractJar = makeTestContractJar(file.path, "com.example.MyContract") @@ -341,8 +341,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can import jar with duplicated contract class, version and signers for trusted uploader`() { + @Test(timeout=300_000) + fun `can import jar with duplicated contract class, version and signers for trusted uploader`() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), true, generateManifest = false, jarFileName = "another-sample.jar") @@ -351,8 +351,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can import jar with duplicated contract class, version and signers - when one uploader is trusted and other isnt`() { + @Test(timeout=300_000) + fun `can import jar with duplicated contract class, version and signers - when one uploader is trusted and other isnt`() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), true, generateManifest = false, jarFileName = "another-sample.jar") @@ -362,8 +362,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can promote to trusted uploader for the same attachment`() { + @Test(timeout=300_000) + fun `can promote to trusted uploader for the same attachment`() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val attachmentId = contractJar.read { storage.importAttachment(it, "uploaderA", "sample.jar") } @@ -372,8 +372,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can promote to trusted uploader if other trusted attachment already has duplicated contract class, version and signers`() { + @Test(timeout=300_000) + fun `can promote to trusted uploader if other trusted attachment already has duplicated contract class, version and signers`() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") contractJar.read { storage.importAttachment(it, "uploaderA", "sample.jar") } @@ -383,8 +383,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can promote to trusted uploader the same jar if other trusted uploader `() { + @Test(timeout=300_000) + fun `can promote to trusted uploader the same jar if other trusted uploader `() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), true, generateManifest = false, jarFileName = "another-sample.jar") @@ -393,8 +393,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can import duplicated contract class and signers if versions differ`() { + @Test(timeout=300_000) + fun `can import duplicated contract class and signers if versions differ`() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract", 2) val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), true, generateManifest = false, jarFileName = "another-sample.jar") @@ -409,8 +409,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can import duplicated contract class and version from unsigned attachment if a signed attachment already exists`() { + @Test(timeout=300_000) + fun `can import duplicated contract class and version from unsigned attachment if a signed attachment already exists`() { SelfCleaningDir().use { file -> val (contractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), generateManifest = false, jarFileName = "another-sample.jar") @@ -427,8 +427,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can import duplicated contract class and version from signed attachment if an unsigned attachment already exists`() { + @Test(timeout=300_000) + fun `can import duplicated contract class and version from signed attachment if an unsigned attachment already exists`() { SelfCleaningDir().use { file -> val contractJar = makeTestContractJar(file.path, "com.example.MyContract") val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), true, generateManifest = false, jarFileName = "another-sample.jar") @@ -445,8 +445,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `can import duplicated contract class and version for unsigned attachments`() { + @Test(timeout=300_000) + fun `can import duplicated contract class and version for unsigned attachments`() { SelfCleaningDir().use { file -> val contractJar = makeTestContractJar(file.path, "com.example.MyContract") val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), generateManifest = false, jarFileName = "another-sample.jar") @@ -463,8 +463,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `sorting and compound conditions work`() { + @Test(timeout=300_000) + fun `sorting and compound conditions work`() { val (jarA, hashA) = makeTestJar(listOf(Pair("a", "a"))) val (jarB, hashB) = makeTestJar(listOf(Pair("b", "b"))) val (jarC, hashC) = makeTestJar(listOf(Pair("c", "c"))) @@ -510,8 +510,8 @@ class NodeAttachmentServiceTest { } @Ignore("We need to be able to restart nodes - make importing attachments idempotent?") - @Test - fun `duplicates not allowed`() { + @Test(timeout=300_000) + fun `duplicates not allowed`() { val (testJar) = makeTestJar() testJar.read { storage.importAttachment(it, "test", null) @@ -523,8 +523,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `corrupt entry throws exception`() { + @Test(timeout=300_000) + fun `corrupt entry throws exception`() { val (testJar) = makeTestJar() val id = database.transaction { val id = testJar.read { storage.importAttachment(it, "test", null) } @@ -549,8 +549,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `non jar rejected`() { + @Test(timeout=300_000) + fun `non jar rejected`() { val path = fs.getPath("notajar") path.writeLines(listOf("Hey", "there!")) path.read { @@ -560,8 +560,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `using reserved uploader tokens`() { + @Test(timeout=300_000) + fun `using reserved uploader tokens`() { val (testJar) = makeTestJar() fun assertImportFails(uploader: String) { @@ -589,8 +589,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `retrieve latest versions of unsigned and signed contracts - both exist at same version`() { + @Test(timeout=300_000) + fun `retrieve latest versions of unsigned and signed contracts - both exist at same version`() { SelfCleaningDir().use { file -> val contractJar = makeTestContractJar(file.path, "com.example.MyContract") val (signedContractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") @@ -611,8 +611,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `retrieve latest versions of unsigned and signed contracts - signed is later version than unsigned`() { + @Test(timeout=300_000) + fun `retrieve latest versions of unsigned and signed contracts - signed is later version than unsigned`() { SelfCleaningDir().use { file -> val contractJar = makeTestContractJar(file.path, "com.example.MyContract") val (signedContractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") @@ -631,8 +631,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `retrieve latest versions of unsigned and signed contracts - unsigned is later version than signed`() { + @Test(timeout=300_000) + fun `retrieve latest versions of unsigned and signed contracts - unsigned is later version than signed`() { SelfCleaningDir().use { file -> val contractJar = makeTestContractJar(file.path, "com.example.MyContract") val (signedContractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") @@ -651,8 +651,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `retrieve latest versions of unsigned and signed contracts - only signed contracts exist in store`() { + @Test(timeout=300_000) + fun `retrieve latest versions of unsigned and signed contracts - only signed contracts exist in store`() { SelfCleaningDir().use { file -> val (signedContractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val (signedContractJarV2, _) = makeTestSignedContractJar(file.path,"com.example.MyContract", version = 2) @@ -667,8 +667,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `retrieve latest versions of unsigned and signed contracts - only unsigned contracts exist in store`() { + @Test(timeout=300_000) + fun `retrieve latest versions of unsigned and signed contracts - only unsigned contracts exist in store`() { SelfCleaningDir().use { file -> val contractJar = makeTestContractJar(file.path, "com.example.MyContract") val contractJarV2 = makeTestContractJar(file.path,"com.example.MyContract", version = 2) @@ -683,16 +683,16 @@ class NodeAttachmentServiceTest { } } - @Test - fun `retrieve latest versions of unsigned and signed contracts - none exist in store`() { + @Test(timeout=300_000) + fun `retrieve latest versions of unsigned and signed contracts - none exist in store`() { SelfCleaningDir().use { _ -> val latestAttachments = storage.getLatestContractAttachments("com.example.MyContract") assertEquals(0, latestAttachments.size) } } - @Test - fun `development mode - retrieve latest versions of signed contracts - multiple versions of same version id exist in store`() { + @Test(timeout=300_000) + fun `development mode - retrieve latest versions of signed contracts - multiple versions of same version id exist in store`() { SelfCleaningDir().use { file -> val (signedContractJar, _) = makeTestSignedContractJar(file.path, "com.example.MyContract") val (signedContractJarSameVersion, _) = makeTestSignedContractJar(file.path,"com.example.MyContract", versionSeed = Random().nextInt()) @@ -717,8 +717,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `The strict JAR verification function fails signed JARs with removed or extra files that are valid according to the usual jarsigner`() { + @Test(timeout=300_000) + fun `The strict JAR verification function fails signed JARs with removed or extra files that are valid according to the usual jarsigner`() { // Signed jar that has a modified file. val changedFileJAR = this::class.java.getResource("/changed-file-signed-jar.jar") @@ -763,8 +763,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `attachments can be queried by providing a intersection of signers using an EQUAL statement - EQUAL containing a single public key`() { + @Test(timeout=300_000) + fun `attachments can be queried by providing a intersection of signers using an EQUAL statement - EQUAL containing a single public key`() { SelfCleaningDir().use { file -> val aliasA = "Luke Skywalker" val aliasB = "Han Solo" @@ -837,8 +837,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `attachments can be queried by providing a intersection of signers using an EQUAL statement - EQUAL containing multiple public keys`() { + @Test(timeout=300_000) + fun `attachments can be queried by providing a intersection of signers using an EQUAL statement - EQUAL containing multiple public keys`() { SelfCleaningDir().use { file -> val aliasA = "Ironman" val aliasB = "Captain America" @@ -904,22 +904,22 @@ class NodeAttachmentServiceTest { } } - @Test - fun `getAllAttachmentsByCriteria returns no attachments if there are no stored attachments`() { + @Test(timeout=300_000) + fun `getAllAttachmentsByCriteria returns no attachments if there are no stored attachments`() { assertTrue(database.transaction { storage.getAllAttachmentsByCriteria().toList().isEmpty() }) } - @Test - fun `getAllAttachmentsByCriteria fails if no database transaction is set`() { + @Test(timeout=300_000) + fun `getAllAttachmentsByCriteria fails if no database transaction is set`() { assertThatExceptionOfType(IllegalStateException::class.java).isThrownBy { storage.getAllAttachmentsByCriteria() }.withMessageContaining("Was expecting to find transaction set on current strand") } - @Test - fun `getAllAttachmentsByCriteria returns all stored attachments when no filtering is applied`() { + @Test(timeout=300_000) + fun `getAllAttachmentsByCriteria returns all stored attachments when no filtering is applied`() { SelfCleaningDir().use { file -> val aliasA = "Spiderman" val password = "why is Sony taking me out of the MCU?!?!" @@ -952,8 +952,8 @@ class NodeAttachmentServiceTest { } } - @Test - fun `getAllAttachmentsByCriteria returns attachments filtered by criteria`() { + @Test(timeout=300_000) + fun `getAllAttachmentsByCriteria returns attachments filtered by criteria`() { SelfCleaningDir().use { file -> val aliasA = "Dan" val password = "i am so tired with this work" diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/ObserverNodeTransactionTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/ObserverNodeTransactionTests.kt index d5f27791b7..5ad409d710 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/ObserverNodeTransactionTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/ObserverNodeTransactionTests.kt @@ -80,8 +80,8 @@ class ObserverNodeTransactionTests { } } - @Test - fun `Broadcasting an old transaction does not cause 2 unconsumed states`() { + @Test(timeout=300_000) + fun `Broadcasting an old transaction does not cause 2 unconsumed states`() { val node = mockNet.createPartyNode(ALICE_NAME) val regulator = mockNet.createPartyNode(BOB_NAME) val notary = mockNet.defaultNotaryIdentity @@ -96,8 +96,8 @@ class ObserverNodeTransactionTests { checkObserverTransactions(outputMessage, regulator) } - @Test - fun `Non relevant states are recorded if transaction is re-received with new states to record`() { + @Test(timeout=300_000) + fun `Non relevant states are recorded if transaction is re-received with new states to record`() { val node = mockNet.createPartyNode(ALICE_NAME) val regulator = mockNet.createPartyNode(BOB_NAME) val notary = mockNet.defaultNotaryIdentity @@ -112,8 +112,8 @@ class ObserverNodeTransactionTests { checkObserverTransactions(outputMessage, regulator) } - @Test - fun `Re-recording a transaction adds non-relevant states`() { + @Test(timeout=300_000) + fun `Re-recording a transaction adds non-relevant states`() { val alice = mockNet.createPartyNode(ALICE_NAME) val bob = mockNet.createPartyNode(BOB_NAME) val notary = mockNet.defaultNotaryIdentity @@ -127,8 +127,8 @@ class ObserverNodeTransactionTests { checkObserverTransactions(message, bob, 2) } - @Test - fun `Re-recording a transaction at only relevant does not cause failures`() { + @Test(timeout=300_000) + fun `Re-recording a transaction at only relevant does not cause failures`() { val alice = mockNet.createPartyNode(ALICE_NAME) val bob = mockNet.createPartyNode(BOB_NAME) val notary = mockNet.defaultNotaryIdentity @@ -142,8 +142,8 @@ class ObserverNodeTransactionTests { checkObserverTransactions(message, bob, 1) } - @Test - fun `Recording a transaction twice at all visible works`() { + @Test(timeout=300_000) + fun `Recording a transaction twice at all visible works`() { val alice = mockNet.createPartyNode(ALICE_NAME) val bob = mockNet.createPartyNode(BOB_NAME) val notary = mockNet.defaultNotaryIdentity diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/PublicKeyToOwningIdentityCacheImplTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/PublicKeyToOwningIdentityCacheImplTest.kt index c7484136b5..af31369209 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/PublicKeyToOwningIdentityCacheImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/PublicKeyToOwningIdentityCacheImplTest.kt @@ -70,13 +70,13 @@ class PublicKeyToOwningIdentityCacheImplTest { } } - @Test - fun `cache returns right key for each UUID`() { + @Test(timeout=300_000) + fun `cache returns right key for each UUID`() { performTestRun() } - @Test - fun `querying for key twice does not go to database the second time`() { + @Test(timeout=300_000) + fun `querying for key twice does not go to database the second time`() { performTestRun() withoutDatabaseAccess { @@ -84,15 +84,15 @@ class PublicKeyToOwningIdentityCacheImplTest { } } - @Test - fun `entries can be fetched if cache invalidated`() { + @Test(timeout=300_000) + fun `entries can be fetched if cache invalidated`() { testCache = PublicKeyToOwningIdentityCacheImpl(database, TestingNamedCacheFactory(sizeOverride = 0)) performTestRun() } - @Test - fun `cache access is thread safe`() { + @Test(timeout=300_000) + fun `cache access is thread safe`() { val executor = Executors.newFixedThreadPool(2) val f1 = executor.submit { performTestRun() } val f2 = executor.submit { performTestRun() } @@ -104,8 +104,8 @@ class PublicKeyToOwningIdentityCacheImplTest { keyManagementService.freshKey(UUID.randomUUID()) } - @Test - fun `can set multiple keys across threads`() { + @Test(timeout=300_000) + fun `can set multiple keys across threads`() { val executor = Executors.newFixedThreadPool(2) val f1 = executor.submit { repeat(5) { createAndAddKeys() } } val f2 = executor.submit { repeat(5) { createAndAddKeys() } } @@ -113,14 +113,14 @@ class PublicKeyToOwningIdentityCacheImplTest { f1.getOrThrow() } - @Test - fun `requesting a key unknown to the node returns null`() { + @Test(timeout=300_000) + fun `requesting a key unknown to the node returns null`() { val keys = generateKeyPair() assertEquals(null, testCache[keys.public]) } - @Test - fun `can request initial identity key`() { + @Test(timeout=300_000) + fun `can request initial identity key`() { val key = alice.publicKey assertEquals(KeyOwningIdentity.UnmappedIdentity, testCache[key]) } diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/TransactionCallbackTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/TransactionCallbackTest.kt index e6c4e8fdf2..7e46a1cab3 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/TransactionCallbackTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/TransactionCallbackTest.kt @@ -16,8 +16,8 @@ class TransactionCallbackTest { database.close() } - @Test - fun `onCommit called and onRollback not called on commit`() { + @Test(timeout=300_000) + fun `onCommit called and onRollback not called on commit`() { var onCommitCount = 0 var onRollbackCount = 0 database.transaction { @@ -28,8 +28,8 @@ class TransactionCallbackTest { assertEquals(0, onRollbackCount) } - @Test - fun `onCommit not called and onRollback called on rollback`() { + @Test(timeout=300_000) + fun `onCommit not called and onRollback called on rollback`() { class TestException : Exception() var onCommitCount = 0 diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/TransactionOrderingTests.kt b/node/src/test/kotlin/net/corda/node/services/persistence/TransactionOrderingTests.kt index 7ec1eba568..5b41189a4e 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/TransactionOrderingTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/TransactionOrderingTests.kt @@ -45,8 +45,8 @@ class TransactionOrderingTests { mockNet.stopNodes() } - @Test - fun `Out of order transactions are recorded in vault correctly`() { + @Test(timeout=300_000) + fun `Out of order transactions are recorded in vault correctly`() { val alice = mockNet.createPartyNode(ALICE_NAME) val aliceID = alice.info.identityFromX500Name(ALICE_NAME) diff --git a/node/src/test/kotlin/net/corda/node/services/rpc/CheckpointDumperImplTest.kt b/node/src/test/kotlin/net/corda/node/services/rpc/CheckpointDumperImplTest.kt index 497f2d0203..bf9a482e66 100644 --- a/node/src/test/kotlin/net/corda/node/services/rpc/CheckpointDumperImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/rpc/CheckpointDumperImplTest.kt @@ -96,8 +96,8 @@ class CheckpointDumperImplTest { baseDirectory.deleteRecursively() } - @Test - fun testDumpCheckpoints() { + @Test(timeout=300_000) + fun testDumpCheckpoints() { val dumper = CheckpointDumperImpl(checkpointStorage, database, services, baseDirectory) dumper.update(mockAfterStartEvent) @@ -122,8 +122,8 @@ class CheckpointDumperImplTest { // This test will only succeed when the VM startup includes the "checkpoint-agent": // -javaagent:tools/checkpoint-agent/build/libs/checkpoint-agent.jar - @Test - fun testDumpCheckpointsAndAgentDiagnostics() { + @Test(timeout=300_000) + fun testDumpCheckpointsAndAgentDiagnostics() { val dumper = CheckpointDumperImpl(checkpointStorage, database, services, Paths.get(".")) dumper.update(mockAfterStartEvent) diff --git a/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt index fece373e9e..f4f10163ef 100644 --- a/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt @@ -29,8 +29,8 @@ class NodeSchemaServiceTest { /** * Note: this test requires explicitly registering custom contract schemas with a StartedMockNode */ - @Test - fun `registering custom schemas for testing with MockNode`() { + @Test(timeout=300_000) + fun `registering custom schemas for testing with MockNode`() { val mockNet = InternalMockNetwork(cordappsForAllNodes = cordappsForPackages(DummyLinearStateSchemaV1::class.packageName)) val mockNode = mockNet.createNode() val schemaService = mockNode.services.schemaService @@ -38,8 +38,8 @@ class NodeSchemaServiceTest { mockNet.stopNodes() } - @Test - fun `check node runs with minimal core schema set`() { + @Test(timeout=300_000) + fun `check node runs with minimal core schema set`() { val mockNet = InternalMockNetwork() val mockNode = mockNet.createNode() val schemaService = mockNode.services.schemaService @@ -49,8 +49,8 @@ class NodeSchemaServiceTest { mockNet.stopNodes() } - @Test - fun `check node runs inclusive of notary node schema set`() { + @Test(timeout=300_000) + fun `check node runs inclusive of notary node schema set`() { val mockNet = InternalMockNetwork() val mockNotaryNode = mockNet.notaryNodes.first() val schemaService = mockNotaryNode.services.schemaService @@ -63,8 +63,8 @@ class NodeSchemaServiceTest { /** * Note: this test verifies auto-scanning to register identified [MappedSchema] schemas. */ - @Test - fun `auto scanning of custom schemas for testing with Driver`() { + @Test(timeout=300_000) + fun `auto scanning of custom schemas for testing with Driver`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val result = defaultNotaryNode.getOrThrow().rpc.startFlow(::MappedSchemasFlow) val mappedSchemas = result.returnValue.getOrThrow() @@ -72,8 +72,8 @@ class NodeSchemaServiceTest { } } - @Test - fun `custom schemas are loaded eagerly`() { + @Test(timeout=300_000) + fun `custom schemas are loaded eagerly`() { val expected = setOf("PARENTS", "CHILDREN") val tables = driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { (defaultNotaryNode.getOrThrow() as InProcessImpl).database.transaction { @@ -84,8 +84,8 @@ class NodeSchemaServiceTest { } @Ignore - @Test - fun `check node runs with minimal core schema set using driverDSL`() { + @Test(timeout=300_000) + fun `check node runs with minimal core schema set using driverDSL`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode().getOrThrow() val result = node.rpc.startFlow(::MappedSchemasFlow) @@ -96,8 +96,8 @@ class NodeSchemaServiceTest { } - @Test - fun `check node runs inclusive of notary node schema set using driverDSL`() { + @Test(timeout=300_000) + fun `check node runs inclusive of notary node schema set using driverDSL`() { driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val notary = defaultNotaryNode.getOrThrow() val mappedSchemas = notary.rpc.startFlow(::MappedSchemasFlow).returnValue.getOrThrow() diff --git a/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt index a77c9ca8ed..0b00c2adee 100644 --- a/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt @@ -46,8 +46,8 @@ class PersistentStateServiceTests { get() = throw UnsupportedOperationException() } - @Test - fun `test child objects are persisted`() { + @Test(timeout=300_000) + fun `test child objects are persisted`() { val testSchema = TestSchema val schemaService = object : SchemaService { override val schemas: Set = setOf(testSchema) diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/ExceptionsSerializationTest.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/ExceptionsSerializationTest.kt index e072716f0c..2fb02b69ac 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/ExceptionsSerializationTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/ExceptionsSerializationTest.kt @@ -32,8 +32,8 @@ class ExceptionsSerializationTest(private val initialException: CordaException, @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun testMarshal() { + @Test(timeout=300_000) + fun testMarshal() { val fromSerialized = performRoundTripSerialization(initialException) assertEquals(initialException.message, fromSerialized.message) } diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowAsyncOperationTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowAsyncOperationTests.kt index 6d3600a831..e8b34358cb 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowAsyncOperationTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowAsyncOperationTests.kt @@ -38,8 +38,8 @@ class FlowAsyncOperationTests { mockNet.stopNodes() } - @Test - fun `operation errors are propagated correctly`() { + @Test(timeout=300_000) + fun `operation errors are propagated correctly`() { val flow = object : FlowLogic() { @Suspendable override fun call() { @@ -56,8 +56,8 @@ class FlowAsyncOperationTests { } } - @Test - fun `operation result errors are propagated correctly`() { + @Test(timeout=300_000) + fun `operation result errors are propagated correctly`() { val flow = object : FlowLogic() { @Suspendable override fun call() { @@ -68,8 +68,8 @@ class FlowAsyncOperationTests { assertFailsWith { aliceNode.services.startFlow(flow).resultFuture.getOrThrow() } } - @Test - fun `operation result errors are propagated correctly, and can be caught by the flow`() { + @Test(timeout=300_000) + fun `operation result errors are propagated correctly, and can be caught by the flow`() { val flow = object : FlowLogic() { @Suspendable override fun call() { diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkPersistenceTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkPersistenceTests.kt index 10e4c0b7ae..be2870ece1 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkPersistenceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkPersistenceTests.kt @@ -66,16 +66,16 @@ class FlowFrameworkPersistenceTests { receivedSessionMessages.clear() } - @Test - fun `newly added flow is preserved on restart`() { + @Test(timeout=300_000) + fun `newly added flow is preserved on restart`() { aliceNode.services.startFlow(NoOpFlow(nonTerminating = true)) aliceNode.internals.acceptableLiveFiberCountOnStop = 1 val restoredFlow = aliceNode.restartAndGetRestoredFlow() assertThat(restoredFlow.flowStarted).isTrue() } - @Test - fun `flow restarted just after receiving payload`() { + @Test(timeout=300_000) + fun `flow restarted just after receiving payload`() { bobNode.registerCordappFlowFactory(SendFlow::class) { InitiatedReceiveFlow(it) .nonTerminating() } aliceNode.services.startFlow(SendFlow("Hello", bob)) @@ -90,8 +90,8 @@ class FlowFrameworkPersistenceTests { assertThat(restoredFlow.receivedPayloads[0]).isEqualTo("Hello") } - @Test - fun `flow loaded from checkpoint will respond to messages from before start`() { + @Test(timeout=300_000) + fun `flow loaded from checkpoint will respond to messages from before start`() { aliceNode.registerCordappFlowFactory(ReceiveFlow::class) { InitiatedSendFlow("Hello", it) } bobNode.services.startFlow(ReceiveFlow(alice).nonTerminating()) // Prepare checkpointed receive flow val restoredFlow = bobNode.restartAndGetRestoredFlow() @@ -99,8 +99,8 @@ class FlowFrameworkPersistenceTests { } @Ignore("Some changes in startup order make this test's assumptions fail.") - @Test - fun `flow with send will resend on interrupted restart`() { + @Test(timeout=300_000) + fun `flow with send will resend on interrupted restart`() { val payload = random63BitValue() val payload2 = random63BitValue() diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt index f8d6812790..a4f77c5390 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt @@ -97,8 +97,8 @@ class FlowFrameworkTests { receivedSessionMessages.clear() } - @Test - fun `flow can lazily use the serviceHub in its constructor`() { + @Test(timeout=300_000) + fun `flow can lazily use the serviceHub in its constructor`() { val flow = LazyServiceHubAccessFlow() aliceNode.services.startFlow(flow) assertThat(flow.lazyTime).isNotNull() @@ -117,8 +117,8 @@ class FlowFrameworkTests { } } - @Test - fun `exception while fiber suspended is retried and completes successfully`() { + @Test(timeout=300_000) + fun `exception while fiber suspended is retried and completes successfully`() { bobNode.registerCordappFlowFactory(ReceiveFlow::class) { InitiatedSendFlow("Hello", it) } val flow = ReceiveFlow(bob) val fiber = aliceNode.services.startFlow(flow) as FlowStateMachineImpl @@ -133,8 +133,8 @@ class FlowFrameworkTests { assertThat(fiber.state).isEqualTo(Strand.State.WAITING) } - @Test - fun `both sides do a send as their first IO request`() { + @Test(timeout=300_000) + fun `both sides do a send as their first IO request`() { bobNode.registerCordappFlowFactory(PingPongFlow::class) { PingPongFlow(it, 20L) } aliceNode.services.startFlow(PingPongFlow(bob, 10L)) mockNet.runNetwork() @@ -150,8 +150,8 @@ class FlowFrameworkTests { ) } - @Test - fun `other side ends before doing expected send`() { + @Test(timeout=300_000) + fun `other side ends before doing expected send`() { bobNode.registerCordappFlowFactory(ReceiveFlow::class) { NoOpFlow() } val resultFuture = aliceNode.services.startFlow(ReceiveFlow(bob)).resultFuture mockNet.runNetwork() @@ -160,8 +160,8 @@ class FlowFrameworkTests { } } - @Test - fun `FlowMonitor flow suspends on a FlowIORequest`() { // alice flow only, suspends on a FlowIORequest + @Test(timeout=300_000) + fun `FlowMonitor flow suspends on a FlowIORequest`() { // alice flow only, suspends on a FlowIORequest monitorFlows { aliceFlowMonitor, bobFlowMonitor -> val terminationSignal = Semaphore(0) // bob's flow need to wait otherwise it could end the session prematurely @@ -178,8 +178,8 @@ class FlowFrameworkTests { } } - @Test - fun `FlowMonitor flows suspend on a FlowIORequest`() { // alice and bob's flows, both suspend on a FlowIORequest + @Test(timeout=300_000) + fun `FlowMonitor flows suspend on a FlowIORequest`() { // alice and bob's flows, both suspend on a FlowIORequest monitorFlows { aliceFlowMonitor, bobFlowMonitor -> bobNode.registerCordappFlowFactory(ReceiveFlow::class) { InitiatedReceiveFlow(it) } aliceNode.services.startFlow(ReceiveFlow(bob)) @@ -190,8 +190,8 @@ class FlowFrameworkTests { } } - @Test - fun `FlowMonitor flow is running`() { // flow is running a "take a long time" task + @Test(timeout=300_000) + fun `FlowMonitor flow is running`() { // flow is running a "take a long time" task monitorFlows { aliceFlowMonitor, _ -> val terminationSignal = Semaphore(0) // "take a long time" task, implemented by a NoOpFlow stuck in call method @@ -208,8 +208,8 @@ class FlowFrameworkTests { script(FlowMonitor(aliceNode.smm, Duration.ZERO, Duration.ZERO), FlowMonitor(bobNode.smm, Duration.ZERO, Duration.ZERO)) } - @Test - fun `receiving unexpected session end before entering sendAndReceive`() { + @Test(timeout=300_000) + fun `receiving unexpected session end before entering sendAndReceive`() { bobNode.registerCordappFlowFactory(WaitForOtherSideEndBeforeSendAndReceive::class) { NoOpFlow() } val sessionEndReceived = Semaphore(0) receivedSessionMessagesObservable().filter { @@ -224,8 +224,8 @@ class FlowFrameworkTests { } } - @Test - fun `FlowException thrown on other side`() { + @Test(timeout=300_000) + fun `FlowException thrown on other side`() { val erroringFlow = bobNode.registerCordappFlowFactory(ReceiveFlow::class) { ExceptionFlow { MyFlowException("Nothing useful") } } @@ -262,8 +262,8 @@ class FlowFrameworkTests { assertThat((lastMessage.payload as ErrorSessionMessage).flowException!!.stackTrace).isEmpty() } - @Test - fun `sub-class of FlowException can have a peer field without causing serialisation problems`() { + @Test(timeout=300_000) + fun `sub-class of FlowException can have a peer field without causing serialisation problems`() { val exception = MyPeerFlowException("Nothing useful", alice) bobNode.registerCordappFlowFactory(ReceiveFlow::class) { ExceptionFlow { exception } @@ -296,8 +296,8 @@ class FlowFrameworkTests { } } - @Test - fun `retry subFlow due to receiving FlowException`() { + @Test(timeout=300_000) + fun `retry subFlow due to receiving FlowException`() { @InitiatingFlow class AskForExceptionFlow(val otherParty: Party, val throwException: Boolean) : FlowLogic() { @Suspendable @@ -321,8 +321,8 @@ class FlowFrameworkTests { assertThat(resultFuture.getOrThrow()).isEqualTo("Hello") } - @Test - fun `serialisation issue in counterparty`() { + @Test(timeout=300_000) + fun `serialisation issue in counterparty`() { bobNode.registerCordappFlowFactory(ReceiveFlow::class) { InitiatedSendFlow(NonSerialisableData(1), it) } val result = aliceNode.services.startFlow(ReceiveFlow(bob)).resultFuture mockNet.runNetwork() @@ -331,8 +331,8 @@ class FlowFrameworkTests { } } - @Test - fun `FlowException has non-serialisable object`() { + @Test(timeout=300_000) + fun `FlowException has non-serialisable object`() { bobNode.registerCordappFlowFactory(ReceiveFlow::class) { ExceptionFlow { NonSerialisableFlowException(NonSerialisableData(1)) } } @@ -343,8 +343,8 @@ class FlowFrameworkTests { } } - @Test - fun waitForLedgerCommit() { + @Test(timeout=300_000) + fun waitForLedgerCommit() { val ptx = TransactionBuilder(notary = notaryIdentity) .addOutputState(DummyState(), DummyContract.PROGRAM_ID) .addCommand(dummyCommand(alice.owningKey)) @@ -360,8 +360,8 @@ class FlowFrameworkTests { assertThat(committerStx.getOrThrow()).isEqualTo(waiterStx.getOrThrow()).isEqualTo(commitReceiverStx.getOrThrow()) } - @Test - fun `waitForLedgerCommit throws exception if any active session ends in error`() { + @Test(timeout=300_000) + fun `waitForLedgerCommit throws exception if any active session ends in error`() { val ptx = TransactionBuilder(notary = notaryIdentity) .addOutputState(DummyState(), DummyContract.PROGRAM_ID) .addCommand(dummyCommand()) @@ -375,31 +375,31 @@ class FlowFrameworkTests { } } - @Test - fun `verify vault query service is tokenizable by force checkpointing within a flow`() { + @Test(timeout=300_000) + fun `verify vault query service is tokenizable by force checkpointing within a flow`() { aliceNode.registerCordappFlowFactory(VaultQueryFlow::class) { InitiatedSendFlow("Hello", it) } val result = bobNode.services.startFlow(VaultQueryFlow(alice)).resultFuture mockNet.runNetwork() result.getOrThrow() } - @Test - fun `customised client flow`() { + @Test(timeout=300_000) + fun `customised client flow`() { val receiveFlowFuture = bobNode.registerCordappFlowFactory(SendFlow::class) { InitiatedReceiveFlow(it) } aliceNode.services.startFlow(CustomSendFlow("Hello", bob)).resultFuture mockNet.runNetwork() assertThat(receiveFlowFuture.getOrThrow().receivedPayloads).containsOnly("Hello") } - @Test - fun `customised client flow which has annotated @InitiatingFlow again`() { + @Test(timeout=300_000) + fun `customised client flow which has annotated @InitiatingFlow again`() { assertThatExceptionOfType(IllegalArgumentException::class.java).isThrownBy { aliceNode.services.startFlow(IncorrectCustomSendFlow("Hello", bob)).resultFuture }.withMessageContaining(InitiatingFlow::class.java.simpleName) } - @Test - fun `upgraded initiating flow`() { + @Test(timeout=300_000) + fun `upgraded initiating flow`() { bobNode.registerCordappFlowFactory(UpgradedFlow::class, initiatedFlowVersion = 1) { InitiatedSendFlow("Old initiated", it) } val result = aliceNode.services.startFlow(UpgradedFlow(bob)).resultFuture mockNet.runNetwork() @@ -412,8 +412,8 @@ class FlowFrameworkTests { assertThat(node2FlowVersion).isEqualTo(1) } - @Test - fun `upgraded initiated flow`() { + @Test(timeout=300_000) + fun `upgraded initiated flow`() { bobNode.registerCordappFlowFactory(SendFlow::class, initiatedFlowVersion = 2) { UpgradedFlow(it) } val initiatingFlow = SendFlow("Old initiating", bob) val flowInfo = aliceNode.services.startFlow(initiatingFlow).resultFuture @@ -425,8 +425,8 @@ class FlowFrameworkTests { assertThat(flowInfo.get().flowVersion).isEqualTo(2) } - @Test - fun `unregistered flow`() { + @Test(timeout=300_000) + fun `unregistered flow`() { val future = aliceNode.services.startFlow(NeverRegisteredFlow("Hello", bob)).resultFuture mockNet.runNetwork() assertThatExceptionOfType(UnexpectedFlowEndException::class.java) @@ -434,8 +434,8 @@ class FlowFrameworkTests { .withMessageEndingWith("${NeverRegisteredFlow::class.java.name} is not registered") } - @Test - fun `session init with unknown class is sent to the flow hospital, from where we then drop it`() { + @Test(timeout=300_000) + fun `session init with unknown class is sent to the flow hospital, from where we then drop it`() { aliceNode.sendSessionMessage(InitialSessionMessage(SessionId(random63BitValue()), 0, "not.a.real.Class", 1, "", null), bob) mockNet.runNetwork() assertThat(receivedSessionMessages).hasSize(1) // Only the session-init is expected as the session-reject is blocked by the flow hospital @@ -450,8 +450,8 @@ class FlowFrameworkTests { assertThat((lastMessage.payload as RejectSessionMessage).message).isEqualTo("Don't know not.a.real.Class") } - @Test - fun `non-flow class in session init`() { + @Test(timeout=300_000) + fun `non-flow class in session init`() { aliceNode.sendSessionMessage(InitialSessionMessage(SessionId(random63BitValue()), 0, String::class.java.name, 1, "", null), bob) mockNet.runNetwork() assertThat(receivedSessionMessages).hasSize(2) // Only the session-init and session-reject are expected @@ -459,24 +459,24 @@ class FlowFrameworkTests { assertThat((lastMessage.payload as RejectSessionMessage).message).isEqualTo("${String::class.java.name} is not a flow") } - @Test - fun `single inlined sub-flow`() { + @Test(timeout=300_000) + fun `single inlined sub-flow`() { bobNode.registerCordappFlowFactory(SendAndReceiveFlow::class) { SingleInlinedSubFlow(it) } val result = aliceNode.services.startFlow(SendAndReceiveFlow(bob, "Hello")).resultFuture mockNet.runNetwork() assertThat(result.getOrThrow()).isEqualTo("HelloHello") } - @Test - fun `double inlined sub-flow`() { + @Test(timeout=300_000) + fun `double inlined sub-flow`() { bobNode.registerCordappFlowFactory(SendAndReceiveFlow::class) { DoubleInlinedSubFlow(it) } val result = aliceNode.services.startFlow(SendAndReceiveFlow(bob, "Hello")).resultFuture mockNet.runNetwork() assertThat(result.getOrThrow()).isEqualTo("HelloHello") } - @Test - fun `non-FlowException thrown on other side`() { + @Test(timeout=300_000) + fun `non-FlowException thrown on other side`() { val erroringFlowFuture = bobNode.registerCordappFlowFactory(ReceiveFlow::class) { ExceptionFlow { Exception("evil bug!") } } @@ -513,8 +513,8 @@ class FlowFrameworkTests { ) } - @Test - fun `initiating flow using unknown AnonymousParty`() { + @Test(timeout=300_000) + fun `initiating flow using unknown AnonymousParty`() { val anonymousBob = bobNode.services.keyManagementService.freshKeyAndCert(bobNode.info.legalIdentitiesAndCerts.single(), false) .party.anonymise() bobNode.registerCordappFlowFactory(SendAndReceiveFlow::class) { SingleInlinedSubFlow(it) } @@ -525,8 +525,8 @@ class FlowFrameworkTests { .withMessage("Could not resolve destination: $anonymousBob") } - @Test - fun `initiating flow using known AnonymousParty`() { + @Test(timeout=300_000) + fun `initiating flow using known AnonymousParty`() { val anonymousBob = bobNode.services.keyManagementService.freshKeyAndCert(bobNode.info.legalIdentitiesAndCerts.single(), false) aliceNode.services.identityService.verifyAndRegisterIdentity(anonymousBob) val bobResponderFlow = bobNode.registerCordappFlowFactory(SendAndReceiveFlow::class) { SingleInlinedSubFlow(it) } diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTripartyTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTripartyTests.kt index 0accb9481d..ab17b06dbf 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTripartyTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTripartyTests.kt @@ -68,8 +68,8 @@ class FlowFrameworkTripartyTests { return mockNet.messagingNetwork.receivedMessages.toSessionTransfers() } - @Test - fun `sending to multiple parties`() { + @Test(timeout=300_000) + fun `sending to multiple parties`() { bobNode.registerCordappFlowFactory(SendFlow::class) { InitiatedReceiveFlow(it) .nonTerminating() } charlieNode.registerCordappFlowFactory(SendFlow::class) { InitiatedReceiveFlow(it) @@ -99,8 +99,8 @@ class FlowFrameworkTripartyTests { ) } - @Test - fun `receiving from multiple parties`() { + @Test(timeout=300_000) + fun `receiving from multiple parties`() { val bobPayload = "Test 1" val charliePayload = "Test 2" bobNode.registerCordappFlowFactory(ReceiveFlow::class) { InitiatedSendFlow(bobPayload, it) } @@ -127,8 +127,8 @@ class FlowFrameworkTripartyTests { ) } - @Test - fun `FlowException only propagated to parent`() { + @Test(timeout=300_000) + fun `FlowException only propagated to parent`() { charlieNode.registerCordappFlowFactory(ReceiveFlow::class) { ExceptionFlow { MyFlowException("Chain") } } bobNode.registerCordappFlowFactory(ReceiveFlow::class) { ReceiveFlow(charlie) } val receivingFiber = aliceNode.services.startFlow(ReceiveFlow(bob)) @@ -137,8 +137,8 @@ class FlowFrameworkTripartyTests { .isThrownBy { receivingFiber.resultFuture.getOrThrow() } } - @Test - fun `FlowException thrown and there is a 3rd unrelated party flow`() { + @Test(timeout=300_000) + fun `FlowException thrown and there is a 3rd unrelated party flow`() { // Bob will send its payload and then block waiting for the receive from Alice. Meanwhile Alice will move // onto Charlie which will throw the exception val node2Fiber = bobNode diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowLogicRefFactoryImplTest.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowLogicRefFactoryImplTest.kt index d6e0dd7d06..7d6e8734a4 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowLogicRefFactoryImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowLogicRefFactoryImplTest.kt @@ -38,41 +38,41 @@ class FlowLogicRefFactoryImplTest { } private val flowLogicRefFactory = FlowLogicRefFactoryImpl(FlowLogicRefFactoryImpl::class.java.classLoader) - @Test - fun `create kotlin no arg`() { + @Test(timeout=300_000) + fun `create kotlin no arg`() { flowLogicRefFactory.create(KotlinNoArgFlowLogic::class.jvmName) } - @Test - fun `should create kotlin types`() { + @Test(timeout=300_000) + fun `should create kotlin types`() { val args = mapOf(Pair("A", ParamType1(1)), Pair("b", ParamType2("Hello Jack"))) flowLogicRefFactory.createKotlin(KotlinFlowLogic::class.java, args) } - @Test - fun `create primary`() { + @Test(timeout=300_000) + fun `create primary`() { flowLogicRefFactory.create(KotlinFlowLogic::class.jvmName, ParamType1(1), ParamType2("Hello Jack")) } - @Test - fun `create kotlin void`() { + @Test(timeout=300_000) + fun `create kotlin void`() { flowLogicRefFactory.createKotlin(KotlinFlowLogic::class.java, emptyMap()) } - @Test - fun `create kotlin non primary`() { + @Test(timeout=300_000) + fun `create kotlin non primary`() { val args = mapOf(Pair("C", ParamType2("Hello Jack"))) flowLogicRefFactory.createKotlin(KotlinFlowLogic::class.java, args) } - @Test - fun `create java primitive no registration required`() { + @Test(timeout=300_000) + fun `create java primitive no registration required`() { val args = mapOf(Pair("primitive", "A string")) flowLogicRefFactory.createKotlin(KotlinFlowLogic::class.java, args) } - @Test - fun `create kotlin primitive no registration required`() { + @Test(timeout=300_000) + fun `create kotlin primitive no registration required`() { val args = mapOf(Pair("kotlinType", 3)) flowLogicRefFactory.createKotlin(KotlinFlowLogic::class.java, args) } diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/IdempotentFlowTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/IdempotentFlowTests.kt index 38a43a4534..7883c1513b 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/IdempotentFlowTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/IdempotentFlowTests.kt @@ -52,8 +52,8 @@ class IdempotentFlowTests { mockNet.stopNodes() } - @Test - fun `restarting idempotent flow does not replay any part of its parent flow`() { + @Test(timeout=300_000) + fun `restarting idempotent flow does not replay any part of its parent flow`() { nodeA.services.startFlow(SideEffectFlow()).resultFuture.get() assertEquals(1, executionCounter.get()) assertEquals(2, subFlowExecutionCounter.get()) diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt index d3c636872a..3dda453673 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt @@ -70,14 +70,14 @@ class RetryFlowMockTest { StaffedFlowHospital.DatabaseEndocrinologist.customConditions.clear() } - @Test - fun `Single retry`() { + @Test(timeout=300_000) + fun `Single retry`() { assertEquals(Unit, nodeA.startFlow(RetryFlow(1)).get()) assertEquals(2, RetryFlow.count) } - @Test - fun `Retry does not set senderUUID`() { + @Test(timeout=300_000) + fun `Retry does not set senderUUID`() { val messagesSent = Collections.synchronizedList(mutableListOf()) val partyB = nodeB.info.legalIdentities.first() nodeA.setMessagingServiceSpy(object : MessagingServiceSpy() { @@ -92,8 +92,8 @@ class RetryFlowMockTest { assertEquals(2, SendAndRetryFlow.count) } - @Test - fun `Restart does not set senderUUID`() { + @Test(timeout=300_000) + fun `Restart does not set senderUUID`() { val messagesSent = Collections.synchronizedList(mutableListOf()) val partyB = nodeB.info.legalIdentities.first() nodeA.setMessagingServiceSpy(object : MessagingServiceSpy() { @@ -124,14 +124,14 @@ class RetryFlowMockTest { assertNull(messagesSent.last().senderUUID) } - @Test - fun `Retry duplicate insert`() { + @Test(timeout=300_000) + fun `Retry duplicate insert`() { assertEquals(Unit, nodeA.startFlow(RetryInsertFlow(1)).get()) assertEquals(2, RetryInsertFlow.count) } - @Test - fun `Patient records do not leak in hospital`() { + @Test(timeout=300_000) + fun `Patient records do not leak in hospital`() { assertEquals(Unit, nodeA.startFlow(RetryFlow(1)).get()) // Need to make sure the state machine has finished. Otherwise this test is flakey. mockNet.waitQuiescent() @@ -139,8 +139,8 @@ class RetryFlowMockTest { assertEquals(2, RetryFlow.count) } - @Test - fun `Patient records do not leak in hospital when using killFlow`() { + @Test(timeout=300_000) + fun `Patient records do not leak in hospital when using killFlow`() { // Make sure we have seen an update from the hospital, and thus the flow went there. val alice = TestIdentity(CordaX500Name.parse("L=London,O=Alice Ltd,OU=Trade,C=GB")).party val records = nodeA.smm.flowHospital.track().updates.toBlocking().toIterable().iterator() diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/DbTransactionsResolverTopologicalSortTest.kt b/node/src/test/kotlin/net/corda/node/services/transactions/DbTransactionsResolverTopologicalSortTest.kt index e1a5b0917d..2df7ae9289 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/DbTransactionsResolverTopologicalSortTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/DbTransactionsResolverTopologicalSortTest.kt @@ -12,21 +12,21 @@ class DbTransactionsResolverTopologicalSortTest { private val t3 = SecureHash.randomSHA256() private val t4 = SecureHash.randomSHA256() - @Test - fun issuance() { + @Test(timeout=300_000) + fun issuance() { topologicalSort.add(t1, emptySet()) assertThat(topologicalSort.complete()).containsExactly(t1) } - @Test - fun `T1 to T2`() { + @Test(timeout=300_000) + fun `T1 to T2`() { topologicalSort.add(t2, setOf(t1)) topologicalSort.add(t1, emptySet()) assertThat(topologicalSort.complete()).containsExactly(t1, t2) } - @Test - fun `T1 to T2, T1 to T3`() { + @Test(timeout=300_000) + fun `T1 to T2, T1 to T3`() { topologicalSort.add(t3, setOf(t1)) topologicalSort.add(t2, setOf(t1)) topologicalSort.add(t1, emptySet()) @@ -35,8 +35,8 @@ class DbTransactionsResolverTopologicalSortTest { assertThat(listOf(t1, t3).map(sorted::indexOf)).isSorted } - @Test - fun `T1 to T2 to T4, T1 to T3 to T4`() { + @Test(timeout=300_000) + fun `T1 to T2 to T4, T1 to T3 to T4`() { topologicalSort.add(t4, setOf(t2, t3)) topologicalSort.add(t3, setOf(t1)) topologicalSort.add(t2, setOf(t1)) @@ -46,8 +46,8 @@ class DbTransactionsResolverTopologicalSortTest { assertThat(listOf(t1, t3, t4).map(sorted::indexOf)).isSorted } - @Test - fun `T1 to T2 to T3 to T4, T1 to T4`() { + @Test(timeout=300_000) + fun `T1 to T2 to T3 to T4, T1 to T4`() { topologicalSort.add(t4, setOf(t2, t1)) topologicalSort.add(t3, setOf(t2)) topologicalSort.add(t2, setOf(t1)) diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt index 2ef7dd9fca..bee69acc70 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt @@ -58,8 +58,8 @@ class MaxTransactionSizeTests { mockNet.stopNodes() } - @Test - fun `check transaction will fail when exceed max transaction size limit`() { + @Test(timeout=300_000) + fun `check transaction will fail when exceed max transaction size limit`() { // These 4 attachments yield a transaction that's got ~ 4mb, which will exceed the 3mb max transaction size limit val bigFile1 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024, 0, "a") val bigFile2 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024, 1, "b") @@ -81,8 +81,8 @@ class MaxTransactionSizeTests { assertThat(exception).hasMessageContaining("Transaction exceeded network's maximum transaction size limit") } - @Test - fun `check transaction will be rejected by counterparty when exceed max transaction size limit`() { + @Test(timeout=300_000) + fun `check transaction will be rejected by counterparty when exceed max transaction size limit`() { // These 4 attachments yield a transaction that's got ~ 4mb, which will exceed the 3mb max transaction size limit val bigFile1 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024, 0, "a") val bigFile2 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024, 1, "b") diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/NonValidatingNotaryServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/NonValidatingNotaryServiceTests.kt index c3b1ed81b1..b368a51bf2 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/NonValidatingNotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/NonValidatingNotaryServiceTests.kt @@ -61,8 +61,8 @@ class NonValidatingNotaryServiceTests { mockNet.stopNodes() } - @Test - fun `should sign a unique transaction with a valid time-window`() { + @Test(timeout=300_000) + fun `should sign a unique transaction with a valid time-window`() { val stx = run { val input = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -77,8 +77,8 @@ class NonValidatingNotaryServiceTests { signatures.forEach { it.verify(stx.id) } } - @Test - fun `should sign a unique transaction without a time-window`() { + @Test(timeout=300_000) + fun `should sign a unique transaction without a time-window`() { val stx = run { val inputStates = issueStates(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -93,8 +93,8 @@ class NonValidatingNotaryServiceTests { signatures.forEach { it.verify(stx.id) } } - @Test - fun `should re-sign a transaction with an expired time-window`() { + @Test(timeout=300_000) + fun `should re-sign a transaction with an expired time-window`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -117,8 +117,8 @@ class NonValidatingNotaryServiceTests { assertEquals(sig2.by, notary.owningKey) } - @Test - fun `should report error for transaction with an invalid time-window`() { + @Test(timeout=300_000) + fun `should report error for transaction with an invalid time-window`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -134,8 +134,8 @@ class NonValidatingNotaryServiceTests { assertThat(ex.error).isInstanceOf(NotaryError.TimeWindowInvalid::class.java) } - @Test - fun `notarise issue tx with time-window`() { + @Test(timeout=300_000) + fun `notarise issue tx with time-window`() { val stx = run { val tx = DummyContract.generateInitial(Random().nextInt(), notary, alice.ref(0)) .setTimeWindow(Instant.now(), 30.seconds) @@ -146,8 +146,8 @@ class NonValidatingNotaryServiceTests { assertEquals(sig.by, notary.owningKey) } - @Test - fun `should sign identical transaction multiple times (notarisation is idempotent)`() { + @Test(timeout=300_000) + fun `should sign identical transaction multiple times (notarisation is idempotent)`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -175,8 +175,8 @@ class NonValidatingNotaryServiceTests { assertTrue(sig2.isValid(stx.id)) } - @Test - fun `should report conflict when inputs are reused across transactions`() { + @Test(timeout=300_000) + fun `should report conflict when inputs are reused across transactions`() { val firstState = issueState(aliceNode.services, alice) val secondState = issueState(aliceNode.services, alice) @@ -218,8 +218,8 @@ class NonValidatingNotaryServiceTests { } } - @Test - fun `should reject when notarisation request not signed by the requesting party`() { + @Test(timeout=300_000) + fun `should reject when notarisation request not signed by the requesting party`() { runNotarisationAndInterceptClientPayload { originalPayload -> val transaction = originalPayload.coreTransaction val randomKeyPair = Crypto.generateKeyPair() @@ -229,8 +229,8 @@ class NonValidatingNotaryServiceTests { } } - @Test - fun `should reject when incorrect notarisation request signed - inputs don't match`() { + @Test(timeout=300_000) + fun `should reject when incorrect notarisation request signed - inputs don't match`() { runNotarisationAndInterceptClientPayload { originalPayload -> val transaction = originalPayload.coreTransaction val wrongInputs = listOf(StateRef(SecureHash.randomSHA256(), 0)) @@ -240,8 +240,8 @@ class NonValidatingNotaryServiceTests { } } - @Test - fun `should reject when incorrect notarisation request signed - transaction id doesn't match`() { + @Test(timeout=300_000) + fun `should reject when incorrect notarisation request signed - transaction id doesn't match`() { runNotarisationAndInterceptClientPayload { originalPayload -> val transaction = originalPayload.coreTransaction val wrongTransactionId = SecureHash.randomSHA256() @@ -251,8 +251,8 @@ class NonValidatingNotaryServiceTests { } } - @Test - fun `should reject a transaction with too many inputs`() { + @Test(timeout=300_000) + fun `should reject a transaction with too many inputs`() { NotaryServiceTests.notariseWithTooManyInputs(aliceNode, alice, notary, mockNet) } diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt index 5ef14c1e3c..9253d0aa24 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/NotaryServiceTests.kt @@ -50,13 +50,13 @@ class NotaryServiceTests { mockNet.stopNodes() } - @Test - fun `should reject a transaction with too many inputs`() { + @Test(timeout=300_000) + fun `should reject a transaction with too many inputs`() { notariseWithTooManyInputs(aliceNode, alice, notary, mockNet) } - @Test - fun `should reject when network parameters component is not visible`() { + @Test(timeout=300_000) + fun `should reject when network parameters component is not visible`() { val stx = generateTransaction(aliceNode, alice, notary, null, 13) val future = aliceNode.services.startFlow(DummyClientFlow(stx, notary)).resultFuture mockNet.runNetwork() @@ -65,8 +65,8 @@ class NotaryServiceTests { assertThat(notaryError.cause).hasMessageContaining("Transaction for notarisation doesn't contain network parameters hash.") } - @Test - fun `should reject when parameters not current`() { + @Test(timeout=300_000) + fun `should reject when parameters not current`() { val hash = SecureHash.randomSHA256() val stx = generateTransaction(aliceNode, alice, notary, hash, 13) val future = aliceNode.services.startFlow(DummyClientFlow(stx, notary)).resultFuture diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/NotaryWhitelistTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/NotaryWhitelistTests.kt index a43e527824..6bc5479690 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/NotaryWhitelistTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/NotaryWhitelistTests.kt @@ -81,8 +81,8 @@ class NotaryWhitelistTests( * the network operator, the old notary service can temporarily operate on the new zone to facilitate notary change requests (even though * it's not whitelisted for regular use). */ - @Test - fun `can perform notary change on a de-listed notary`() { + @Test(timeout=300_000) + fun `can perform notary change on a de-listed notary`() { // Issue a state using the old notary. It is currently whitelisted. val stateFakeNotary = issueStateOnOldNotary(oldNotary) @@ -115,8 +115,8 @@ class NotaryWhitelistTests( /** * Following on from the previous one, this test verifies that a non-whitelisted notary cannot be used for regular transactions. */ - @Test - fun `can't perform a regular transaction on a de-listed notary`() { + @Test(timeout=300_000) + fun `can't perform a regular transaction on a de-listed notary`() { // Issue a state using the old notary. It is currently whitelisted. val state = issueStateOnOldNotary(oldNotary) @@ -173,8 +173,8 @@ class NotaryWhitelistTests( return future } - @Test - fun `should reject transaction when a dependency does not contain notary in whitelist`() { + @Test(timeout=300_000) + fun `should reject transaction when a dependency does not contain notary in whitelist`() { Assume.assumeTrue(isValidating) // Skip the test for non-validating notaries val fakeNotaryKeyPair = generateKeyPair() diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/PathManagerTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/PathManagerTests.kt index 834126f17d..f7a28fcc2c 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/PathManagerTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/PathManagerTests.kt @@ -10,8 +10,8 @@ import kotlin.test.assertTrue class PathManagerTests { private class MyPathManager : PathManager(Files.createTempFile(MyPathManager::class.simpleName, null)) - @Test - fun `path deleted when manager closed`() { + @Test(timeout=300_000) + fun `path deleted when manager closed`() { val manager = MyPathManager() val leakedPath = manager.use { it.path.also { assertTrue(it.exists()) } @@ -20,8 +20,8 @@ class PathManagerTests { assertFailsWith(IllegalStateException::class) { manager.path } } - @Test - fun `path deleted when handle closed`() { + @Test(timeout=300_000) + fun `path deleted when handle closed`() { val handle = MyPathManager().use { it.handle() } diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/ResolveStatePointersTest.kt b/node/src/test/kotlin/net/corda/node/services/transactions/ResolveStatePointersTest.kt index 7b2495888d..03a2a0fa6f 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/ResolveStatePointersTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/ResolveStatePointersTest.kt @@ -66,8 +66,8 @@ class ResolveStatePointersTest { services = databaseAndServices.second } - @Test - fun `resolve linear pointers and check reference state is not added to transaction when isResolved is false`() { + @Test(timeout=300_000) + fun `resolve linear pointers and check reference state is not added to transaction when isResolved is false`() { val stateAndRef = createPointedToState(barOne) val linearId = stateAndRef.state.data.linearId @@ -86,8 +86,8 @@ class ResolveStatePointersTest { assertEquals(emptyList(), ltx.referenceStates) } - @Test - fun `resolve linear pointers and check reference state is added to transaction when isResolved is true`() { + @Test(timeout=300_000) + fun `resolve linear pointers and check reference state is added to transaction when isResolved is true`() { val stateAndRef = createPointedToState(barOne) val linearId = stateAndRef.state.data.linearId @@ -106,8 +106,8 @@ class ResolveStatePointersTest { assertEquals(barOne, ltx.referenceStates.single()) } - @Test - fun `resolve static pointers and check reference state is not added to transaction when isResolved is false`() { + @Test(timeout=300_000) + fun `resolve static pointers and check reference state is not added to transaction when isResolved is false`() { val stateAndRef = createPointedToState(barOne) val stateRef = stateAndRef.ref @@ -126,8 +126,8 @@ class ResolveStatePointersTest { assertEquals(emptyList(), ltx.referenceStates) } - @Test - fun `resolve static pointers and check reference state is added to transaction when isResolved is true`() { + @Test(timeout=300_000) + fun `resolve static pointers and check reference state is added to transaction when isResolved is true`() { val stateAndRef = createPointedToState(barOne) val stateRef = stateAndRef.ref @@ -146,8 +146,8 @@ class ResolveStatePointersTest { assertEquals(barOne, ltx.referenceStates.single()) } - @Test - fun `resolving nested pointers is possible`() { + @Test(timeout=300_000) + fun `resolving nested pointers is possible`() { // Create barOne. val barOneStateAndRef = createPointedToState(barOne) @@ -170,8 +170,8 @@ class ResolveStatePointersTest { assertEquals(setOf(barOneStateAndRef.ref, barTwoStateAndRef.ref), tx.referenceStates().toSet()) } - @Test - fun `Resolving to an unknown state throws an exception`() { + @Test(timeout=300_000) + fun `Resolving to an unknown state throws an exception`() { // Don't create the pointed to state. // Resolve the pointer for barTwo. assertFailsWith(IllegalStateException::class) { @@ -179,8 +179,8 @@ class ResolveStatePointersTest { } } - @Test - fun `resolving an exited state throws an exception`() { + @Test(timeout=300_000) + fun `resolving an exited state throws an exception`() { // Create barOne. val stateAndRef = createPointedToState(barOne) @@ -198,16 +198,16 @@ class ResolveStatePointersTest { } } - @Test - fun `resolve linear pointer with correct type`() { + @Test(timeout=300_000) + fun `resolve linear pointer with correct type`() { val stateAndRef = createPointedToState(barOne) val linearPointer = LinearPointer(stateAndRef.state.data.linearId, barOne::class.java) val resolvedPointer = linearPointer.resolve(services) assertEquals(stateAndRef::class.java, resolvedPointer::class.java) } - @Test - fun `resolve state pointer in ledger transaction`() { + @Test(timeout=300_000) + fun `resolve state pointer in ledger transaction`() { val stateAndRef = createPointedToState(barOne) val linearId = stateAndRef.state.data.linearId diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt index 3b47822fb6..bd59890436 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/UniquenessProviderTests.kt @@ -94,8 +94,8 @@ class UniquenessProviderTests( /* Group A: only time window */ - @Test - fun `commits transaction with valid time window`() { + @Test(timeout=300_000) + fun `commits transaction with valid time window`() { val inputState1 = generateStateRef() val firstTxId = SecureHash.randomSHA256() val timeWindow = TimeWindow.untilOnly(Clock.systemUTC().instant().plus(30.minutes)) @@ -108,8 +108,8 @@ class UniquenessProviderTests( assert(result2 is UniquenessProvider.Result.Success) } - @Test - fun `rejects transaction with invalid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with invalid time window`() { val inputState1 = generateStateRef() val firstTxId = SecureHash.randomSHA256() val invalidTimeWindow = TimeWindow.untilOnly(Clock.systemUTC().instant().minus(30.minutes)) @@ -120,8 +120,8 @@ class UniquenessProviderTests( /* Group B: only reference states */ - @Test - fun `commits transaction with unused reference states`() { + @Test(timeout=300_000) + fun `commits transaction with unused reference states`() { val firstTxId = SecureHash.randomSHA256() val referenceState = generateStateRef() @@ -135,8 +135,8 @@ class UniquenessProviderTests( assert(result2 is UniquenessProvider.Result.Success) } - @Test - fun `rejects transaction with previously used reference states`() { + @Test(timeout=300_000) + fun `rejects transaction with previously used reference states`() { val firstTxId = SecureHash.randomSHA256() val referenceState = generateStateRef() @@ -156,8 +156,8 @@ class UniquenessProviderTests( /* Group C: reference states & time window */ - @Test - fun `commits transaction with unused reference states and valid time window`() { + @Test(timeout=300_000) + fun `commits transaction with unused reference states and valid time window`() { val firstTxId = SecureHash.randomSHA256() val referenceState = generateStateRef() val timeWindow = TimeWindow.untilOnly(Clock.systemUTC().instant().plus(30.minutes)) @@ -178,8 +178,8 @@ class UniquenessProviderTests( assert(result3 is UniquenessProvider.Result.Success) } - @Test - fun `rejects transaction with unused reference states and invalid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with unused reference states and invalid time window`() { val firstTxId = SecureHash.randomSHA256() val referenceState = generateStateRef() val invalidTimeWindow = TimeWindow.untilOnly(Clock.systemUTC().instant().minus(30.minutes)) @@ -190,8 +190,8 @@ class UniquenessProviderTests( assertEquals(invalidTimeWindow, error.txTimeWindow) } - @Test - fun `rejects transaction with previously used reference states and valid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with previously used reference states and valid time window`() { val firstTxId = SecureHash.randomSHA256() val referenceState = generateStateRef() @@ -210,8 +210,8 @@ class UniquenessProviderTests( assertEquals(StateConsumptionDetails.ConsumedStateType.REFERENCE_INPUT_STATE, conflictCause.type) } - @Test - fun `rejects transaction with previously used reference states and invalid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with previously used reference states and invalid time window`() { val firstTxId = SecureHash.randomSHA256() val referenceState = generateStateRef() @@ -232,8 +232,8 @@ class UniquenessProviderTests( /* Group D: only input states */ - @Test - fun `commits transaction with unused inputs`() { + @Test(timeout=300_000) + fun `commits transaction with unused inputs`() { val inputState = generateStateRef() val result = uniquenessProvider.commit(listOf(inputState), txID, identity, requestSignature).get() @@ -244,8 +244,8 @@ class UniquenessProviderTests( assert(result2 is UniquenessProvider.Result.Success) } - @Test - fun `rejects transaction with previously used inputs`() { + @Test(timeout=300_000) + fun `rejects transaction with previously used inputs`() { val inputState = generateStateRef() val inputs = listOf(inputState) @@ -264,8 +264,8 @@ class UniquenessProviderTests( /* Group E: input states & time window */ - @Test - fun `commits transaction with unused inputs and valid time window`() { + @Test(timeout=300_000) + fun `commits transaction with unused inputs and valid time window`() { val inputState = generateStateRef() val timeWindow = TimeWindow.untilOnly(Clock.systemUTC().instant().plus(30.minutes)) @@ -278,8 +278,8 @@ class UniquenessProviderTests( assert(result2 is UniquenessProvider.Result.Success) } - @Test - fun `rejects transaction with unused inputs and invalid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with unused inputs and invalid time window`() { val inputState = generateStateRef() val invalidTimeWindow = TimeWindow.untilOnly(Clock.systemUTC().instant().minus(30.minutes)) @@ -288,8 +288,8 @@ class UniquenessProviderTests( assertEquals(invalidTimeWindow, error.txTimeWindow) } - @Test - fun `rejects transaction with previously used inputs and valid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with previously used inputs and valid time window`() { val inputState = generateStateRef() val inputs = listOf(inputState) val firstTxId = txID @@ -307,8 +307,8 @@ class UniquenessProviderTests( assertEquals(firstTxId.sha256(), conflictCause.hashOfTransactionId) } - @Test - fun `rejects transaction with previously used inputs and invalid time window`() { + @Test(timeout=300_000) + fun `rejects transaction with previously used inputs and invalid time window`() { val inputState = generateStateRef() val inputs = listOf(inputState) val firstTxId = txID @@ -328,8 +328,8 @@ class UniquenessProviderTests( /* Group F: input & reference states */ - @Test - fun `commits transaction with unused input & reference states`() { + @Test(timeout=300_000) + fun `commits transaction with unused input & reference states`() { val firstTxId = SecureHash.randomSHA256() val inputState = generateStateRef() val referenceState = generateStateRef() @@ -346,8 +346,8 @@ class UniquenessProviderTests( assert(result2 is UniquenessProvider.Result.Success) } - @Test - fun `rejects transaction with unused reference states and used input states`() { + @Test(timeout=300_000) + fun `rejects transaction with unused reference states and used input states`() { val firstTxId = SecureHash.randomSHA256() val inputState = generateStateRef() val referenceState = generateStateRef() @@ -366,8 +366,8 @@ class UniquenessProviderTests( assertEquals(StateConsumptionDetails.ConsumedStateType.INPUT_STATE, conflictCause.type) } - @Test - fun `rejects transaction with used reference states and unused input states`() { + @Test(timeout=300_000) + fun `rejects transaction with used reference states and unused input states`() { val firstTxId = SecureHash.randomSHA256() val inputState = generateStateRef() val referenceState = generateStateRef() @@ -390,8 +390,8 @@ class UniquenessProviderTests( /* Group G: input, reference states and time window – covered by previous tests. */ /* Transaction signing tests. */ - @Test - fun `signs transactions correctly`() { + @Test(timeout=300_000) + fun `signs transactions correctly`() { (1..10).map { val inputState1 = generateStateRef() val firstTxId = SecureHash.randomSHA256() diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt index 48b910963a..cb971a43e2 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/ValidatingNotaryServiceTests.kt @@ -63,8 +63,8 @@ class ValidatingNotaryServiceTests { mockNet.stopNodes() } - @Test - fun `should report error for invalid transaction dependency`() { + @Test(timeout=300_000) + fun `should report error for invalid transaction dependency`() { val stx = run { val inputState = issueInvalidState(aliceNode.services, alice, notary) val tx = TransactionBuilder(notary) @@ -80,8 +80,8 @@ class ValidatingNotaryServiceTests { assertThat(notaryError.cause).isInstanceOf(SignedTransaction.SignaturesMissingException::class.java) } - @Test - fun `should report error for missing signatures`() { + @Test(timeout=300_000) + fun `should report error for missing signatures`() { val expectedMissingKey = generateKeyPair().public val stx = run { val inputState = issueState(aliceNode.services, alice) @@ -100,8 +100,8 @@ class ValidatingNotaryServiceTests { assertEquals(setOf(expectedMissingKey), missingKeys) } - @Test - fun `should reject transaction without network parameters`() { + @Test(timeout=300_000) + fun `should reject transaction without network parameters`() { val inputState = issueState(aliceNode.services, alice).ref val wtx = createWireTransaction(inputs = listOf(inputState), attachments = emptyList(), @@ -122,8 +122,8 @@ class ValidatingNotaryServiceTests { assertThat(notaryError.cause).hasMessageContaining("Transaction for notarisation doesn't contain network parameters hash.") } - @Test - fun `should sign a unique transaction with a valid time-window`() { + @Test(timeout=300_000) + fun `should sign a unique transaction with a valid time-window`() { val stx = run { val inputStates = issueStates(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -139,8 +139,8 @@ class ValidatingNotaryServiceTests { signatures.forEach { it.verify(stx.id) } } - @Test - fun `should sign a unique transaction without a time-window`() { + @Test(timeout=300_000) + fun `should sign a unique transaction without a time-window`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -154,8 +154,8 @@ class ValidatingNotaryServiceTests { signatures.forEach { it.verify(stx.id) } } - @Test - fun `should re-sign a transaction with an expired time-window`() { + @Test(timeout=300_000) + fun `should re-sign a transaction with an expired time-window`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -178,8 +178,8 @@ class ValidatingNotaryServiceTests { assertEquals(sig2.by, notary.owningKey) } - @Test - fun `should report error for transaction with an invalid time-window`() { + @Test(timeout=300_000) + fun `should report error for transaction with an invalid time-window`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -195,8 +195,8 @@ class ValidatingNotaryServiceTests { assertThat(ex.error).isInstanceOf(NotaryError.TimeWindowInvalid::class.java) } - @Test - fun `notarise issue tx with time-window`() { + @Test(timeout=300_000) + fun `notarise issue tx with time-window`() { val stx = run { val tx = DummyContract.generateInitial(Random().nextInt(), notary, alice.ref(0)) .setTimeWindow(Instant.now(), 30.seconds) @@ -207,8 +207,8 @@ class ValidatingNotaryServiceTests { assertEquals(sig.by, notary.owningKey) } - @Test - fun `should sign identical transaction multiple times (notarisation is idempotent)`() { + @Test(timeout=300_000) + fun `should sign identical transaction multiple times (notarisation is idempotent)`() { val stx = run { val inputState = issueState(aliceNode.services, alice) val tx = TransactionBuilder(notary) @@ -236,8 +236,8 @@ class ValidatingNotaryServiceTests { assertTrue(sig2.isValid(stx.id)) } - @Test - fun `should report conflict when inputs are reused across transactions`() { + @Test(timeout=300_000) + fun `should report conflict when inputs are reused across transactions`() { val firstState = issueState(aliceNode.services, alice) val secondState = issueState(aliceNode.services, alice) @@ -279,8 +279,8 @@ class ValidatingNotaryServiceTests { } } - @Test - fun `should reject when notarisation request not signed by the requesting party`() { + @Test(timeout=300_000) + fun `should reject when notarisation request not signed by the requesting party`() { runNotarisationAndInterceptClientPayload { originalPayload -> val transaction = originalPayload.signedTransaction val randomKeyPair = Crypto.generateKeyPair() @@ -290,8 +290,8 @@ class ValidatingNotaryServiceTests { } } - @Test - fun `should reject when incorrect notarisation request signed - inputs don't match`() { + @Test(timeout=300_000) + fun `should reject when incorrect notarisation request signed - inputs don't match`() { runNotarisationAndInterceptClientPayload { originalPayload -> val transaction = originalPayload.signedTransaction val wrongInputs = listOf(StateRef(SecureHash.randomSHA256(), 0)) @@ -301,8 +301,8 @@ class ValidatingNotaryServiceTests { } } - @Test - fun `should reject when incorrect notarisation request signed - transaction id doesn't match`() { + @Test(timeout=300_000) + fun `should reject when incorrect notarisation request signed - transaction id doesn't match`() { runNotarisationAndInterceptClientPayload { originalPayload -> val transaction = originalPayload.signedTransaction val wrongTransactionId = SecureHash.randomSHA256() @@ -312,8 +312,8 @@ class ValidatingNotaryServiceTests { } } - @Test - fun `should reject a transaction with too many inputs`() { + @Test(timeout=300_000) + fun `should reject a transaction with too many inputs`() { NotaryServiceTests.notariseWithTooManyInputs(aliceNode, alice, notary, mockNet) } diff --git a/node/src/test/kotlin/net/corda/node/services/vault/ExternalIdMappingTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/ExternalIdMappingTest.kt index f5fa968e3c..653e5b6ddb 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/ExternalIdMappingTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/ExternalIdMappingTest.kt @@ -65,8 +65,8 @@ class ExternalIdMappingTest { return stx.tx.outputsOfType().single() } - @Test - fun `Two states can be mapped to a single externalId`() { + @Test(timeout=300_000) + fun `Two states can be mapped to a single externalId`() { val vaultService = services.vaultService // Create new external ID and two keys mapped to it. val id = UUID.randomUUID() @@ -88,8 +88,8 @@ class ExternalIdMappingTest { assertEquals(setOf(dummyStateOne, dummyStateTwo), resultTwo.map { it.state.data }.toSet()) } - @Test - fun `externalIds query criteria test`() { + @Test(timeout=300_000) + fun `externalIds query criteria test`() { val vaultService = services.vaultService // Create new external ID and two keys mapped to it. @@ -129,8 +129,8 @@ class ExternalIdMappingTest { assertEquals(setOf(dummyStateOne, dummyStateTwo, dummyStateThree), resultFour.map { it.state.data }.toSet()) } - @Test - fun `One state can be mapped to multiple externalIds`() { + @Test(timeout=300_000) + fun `One state can be mapped to multiple externalIds`() { val vaultService = services.vaultService // Create new external ID. val idOne = UUID.randomUUID() @@ -146,8 +146,8 @@ class ExternalIdMappingTest { assertEquals(dummyState, result.single().state.data) } - @Test - fun `roger uber keys test`() { + @Test(timeout=300_000) + fun `roger uber keys test`() { // IDs. val id = UUID.randomUUID() val idTwo = UUID.randomUUID() diff --git a/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt index a4ce3e72c3..ac468f5533 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt @@ -139,8 +139,8 @@ class NodeVaultServiceTest { class FungibleFoo(override val amount: Amount, override val participants: List) : FungibleState - @Test - fun `fungible state selection test`() { + @Test(timeout=300_000) + fun `fungible state selection test`() { val issuerParty = services.myInfo.legalIdentities.first() val fungibleFoo = FungibleFoo(100.DOLLARS, listOf(issuerParty)) services.apply { @@ -164,8 +164,8 @@ class NodeVaultServiceTest { } } - @Test - fun `duplicate insert of transaction does not fail`() { + @Test(timeout=300_000) + fun `duplicate insert of transaction does not fail`() { database.transaction { val cash = Cash() val howMuch = 100.DOLLARS @@ -177,8 +177,8 @@ class NodeVaultServiceTest { } } - @Test - fun `can query with page size max-integer`() { + @Test(timeout=300_000) + fun `can query with page size max-integer`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 3, DUMMY_CASH_ISSUER) } @@ -188,8 +188,8 @@ class NodeVaultServiceTest { } } - @Test - fun `states not local to instance`() { + @Test(timeout=300_000) + fun `states not local to instance`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 3, DUMMY_CASH_ISSUER) } @@ -213,8 +213,8 @@ class NodeVaultServiceTest { } } - @Test - fun `states for refs`() { + @Test(timeout=300_000) + fun `states for refs`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 3, DUMMY_CASH_ISSUER) } @@ -227,8 +227,8 @@ class NodeVaultServiceTest { } } - @Test - fun `states soft locking reserve and release`() { + @Test(timeout=300_000) + fun `states soft locking reserve and release`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 3, DUMMY_CASH_ISSUER) } @@ -269,8 +269,8 @@ class NodeVaultServiceTest { } } - @Test - fun `soft locking attempt concurrent reserve`() { + @Test(timeout=300_000) + fun `soft locking attempt concurrent reserve`() { val backgroundExecutor = Executors.newFixedThreadPool(2) val countDown = CountDownLatch(2) @@ -330,8 +330,8 @@ class NodeVaultServiceTest { } } - @Test - fun `soft locking partial reserve states fails`() { + @Test(timeout=300_000) + fun `soft locking partial reserve states fails`() { val softLockId1 = UUID.randomUUID() val softLockId2 = UUID.randomUUID() @@ -358,8 +358,8 @@ class NodeVaultServiceTest { } } - @Test - fun `attempt to lock states already soft locked by me`() { + @Test(timeout=300_000) + fun `attempt to lock states already soft locked by me`() { val softLockId1 = UUID.randomUUID() val criteriaByLockId1 = VaultQueryCriteria(softLockingCondition = SoftLockingCondition(SoftLockingType.SPECIFIED, listOf(softLockId1))) @@ -384,8 +384,8 @@ class NodeVaultServiceTest { } } - @Test - fun `lock additional states to some already soft locked by me`() { + @Test(timeout=300_000) + fun `lock additional states to some already soft locked by me`() { val softLockId1 = UUID.randomUUID() val criteriaByLockId1 = VaultQueryCriteria(softLockingCondition = SoftLockingCondition(SoftLockingType.SPECIFIED, listOf(softLockId1))) @@ -411,8 +411,8 @@ class NodeVaultServiceTest { } } - @Test - fun `unconsumedStatesForSpending exact amount`() { + @Test(timeout=300_000) + fun `unconsumedStatesForSpending exact amount`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 1, DUMMY_CASH_ISSUER) } @@ -430,8 +430,8 @@ class NodeVaultServiceTest { } } - @Test - fun `unconsumedStatesForSpending from two issuer parties`() { + @Test(timeout=300_000) + fun `unconsumedStatesForSpending from two issuer parties`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 1, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCash(100.DOLLARS, bocServices, 1, BOC.ref(1)) @@ -447,8 +447,8 @@ class NodeVaultServiceTest { } } - @Test - fun `unconsumedStatesForSpending from specific issuer party and refs`() { + @Test(timeout=300_000) + fun `unconsumedStatesForSpending from specific issuer party and refs`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 1, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCash(100.DOLLARS, bocServices, 1, BOC.ref(1)) @@ -469,8 +469,8 @@ class NodeVaultServiceTest { } } - @Test - fun `unconsumedStatesForSpending insufficient amount`() { + @Test(timeout=300_000) + fun `unconsumedStatesForSpending insufficient amount`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 1, DUMMY_CASH_ISSUER) } @@ -486,8 +486,8 @@ class NodeVaultServiceTest { } } - @Test - fun `unconsumedStatesForSpending small amount`() { + @Test(timeout=300_000) + fun `unconsumedStatesForSpending small amount`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 2, DUMMY_CASH_ISSUER) } @@ -504,8 +504,8 @@ class NodeVaultServiceTest { } } - @Test - fun `states soft locking query granularity`() { + @Test(timeout=300_000) + fun `states soft locking query granularity`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), issuerServices, 10, DUMMY_CASH_ISSUER) @@ -539,8 +539,8 @@ class NodeVaultServiceTest { } } - @Test - fun addNoteToTransaction() { + @Test(timeout=300_000) + fun addNoteToTransaction() { val megaCorpServices = MockServices(cordappPackages, MEGA_CORP.name, mock(), MEGA_CORP_KEY) database.transaction { val freshKey = identity.owningKey @@ -571,8 +571,8 @@ class NodeVaultServiceTest { } } - @Test - fun `is ownable state relevant`() { + @Test(timeout=300_000) + fun `is ownable state relevant`() { val myAnonymousIdentity = services.keyManagementService.freshKeyAndCert(identity, false) val myKeys = services.keyManagementService.filterMyKeys(listOf(identity.owningKey, myAnonymousIdentity.owningKey)).toSet() @@ -599,8 +599,8 @@ class NodeVaultServiceTest { } // TODO: Unit test linear state relevancy checks - @Test - fun `correct updates are generated for general transactions`() { + @Test(timeout=300_000) + fun `correct updates are generated for general transactions`() { val notary = identity.party val vaultSubscriber = TestSubscriber>().apply { vaultService.updates.subscribe(this) @@ -643,8 +643,8 @@ class NodeVaultServiceTest { assertEquals(observedUpdates, listOf(expectedIssueUpdate, expectedMoveUpdate)) } - @Test - fun `correct updates are generated when changing notaries`() { + @Test(timeout=300_000) + fun `correct updates are generated when changing notaries`() { val service = vaultService val notary = identity.party @@ -708,8 +708,8 @@ class NodeVaultServiceTest { assertEquals(observedUpdates, listOf(expectedIssueUpdate, expectedNotaryChangeUpdate, expectedMoveUpdate)) } - @Test - fun observerMode() { + @Test(timeout=300_000) + fun observerMode() { fun countCash(): Long { return database.transaction { vaultService.queryBy(Cash.State::class.java, QueryCriteria.VaultQueryCriteria(relevancyStatus = Vault.RelevancyStatus.ALL), PageSpecification(1)).totalStatesAvailable @@ -740,8 +740,8 @@ class NodeVaultServiceTest { assertEquals(currentCashStates + 1, countCash()) } - @Test - fun `insert equal cash states issued by single transaction`() { + @Test(timeout=300_000) + fun `insert equal cash states issued by single transaction`() { val nodeIdentity = MEGA_CORP val coins = listOf(1.DOLLARS, 1.DOLLARS).map { it.issuedBy(nodeIdentity.ref(1)) } @@ -763,8 +763,8 @@ class NodeVaultServiceTest { assertThat(recordedStates).isEqualTo(coins.size) } - @Test - fun `insert different cash states issued by single transaction`() { + @Test(timeout=300_000) + fun `insert different cash states issued by single transaction`() { val nodeIdentity = MEGA_CORP val coins = listOf(2.DOLLARS, 1.DOLLARS).map { it.issuedBy(nodeIdentity.ref(1)) } @@ -786,8 +786,8 @@ class NodeVaultServiceTest { assertThat(recordedStates).isEqualTo(coins.size) } - @Test - fun `test state relevance criteria`() { + @Test(timeout=300_000) + fun `test state relevance criteria`() { fun createTx(number: Int, vararg participants: Party): SignedTransaction { return services.signInitialTransaction(TransactionBuilder(DUMMY_NOTARY).apply { addOutputState(DummyState(number, participants.toList()), DummyContract.PROGRAM_ID) @@ -825,8 +825,8 @@ class NodeVaultServiceTest { // We should never see 2 or 7. } - @Test - fun `Unique column constraint failing causes linear state to not persist to vault`() { + @Test(timeout=300_000) + fun `Unique column constraint failing causes linear state to not persist to vault`() { fun createTx(): SignedTransaction { return services.signInitialTransaction(TransactionBuilder(DUMMY_NOTARY).apply { addOutputState(UniqueDummyLinearContract.State(listOf(megaCorp.party), "Dummy linear id"), UNIQUE_DUMMY_LINEAR_CONTRACT_PROGRAM_ID) @@ -843,8 +843,8 @@ class NodeVaultServiceTest { }) } - @Test - fun `Unique column constraint failing causes fungible state to not persist to vault`() { + @Test(timeout=300_000) + fun `Unique column constraint failing causes fungible state to not persist to vault`() { fun createTx(): SignedTransaction { return services.signInitialTransaction(TransactionBuilder(DUMMY_NOTARY).apply { addOutputState(UniqueDummyFungibleContract.State(10.DOLLARS `issued by` DUMMY_CASH_ISSUER, megaCorp.party), UNIQUE_DUMMY_FUNGIBLE_CONTRACT_PROGRAM_ID) @@ -864,8 +864,8 @@ class NodeVaultServiceTest { }) } - @Test - fun `Unique column constraint failing causes all states in transaction to fail`() { + @Test(timeout=300_000) + fun `Unique column constraint failing causes all states in transaction to fail`() { fun createTx(): SignedTransaction { return services.signInitialTransaction(TransactionBuilder(DUMMY_NOTARY).apply { addOutputState(UniqueDummyLinearContract.State(listOf(megaCorp.party), "Dummy linear id"), UNIQUE_DUMMY_LINEAR_CONTRACT_PROGRAM_ID) @@ -886,8 +886,8 @@ class NodeVaultServiceTest { }) } - @Test - fun `V3 vault queries return all states by default`() { + @Test(timeout=300_000) + fun `V3 vault queries return all states by default`() { fun createTx(number: Int, vararg participants: Party): SignedTransaction { return services.signInitialTransaction(TransactionBuilder(DUMMY_NOTARY).apply { addOutputState(DummyState(number, participants.toList()), DummyContract.PROGRAM_ID) @@ -915,8 +915,8 @@ class NodeVaultServiceTest { // We should never see 2 or 7. } - @Test - @Ignore + @Test(timeout=300_000) +@Ignore fun `trackByCriteria filters updates and snapshots`() { /* * This test is ignored as the functionality it tests is not yet implemented - see CORDA-2389 @@ -954,8 +954,8 @@ class NodeVaultServiceTest { } } - @Test - fun `test concurrent update of contract state type mappings`() { + @Test(timeout=300_000) + fun `test concurrent update of contract state type mappings`() { // no registered contract state types at start-up. assertEquals(0, vaultService.contractStateTypeMappings.size) diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultFlowTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultFlowTest.kt index 42237ee304..361d8f296e 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultFlowTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultFlowTest.kt @@ -54,8 +54,8 @@ class VaultFlowTest { StaffedFlowHospital.onFlowKeptForOvernightObservation.clear() } - @Test - fun `Unique column constraint failing causes states to not persist to vaults`() { + @Test(timeout=300_000) + fun `Unique column constraint failing causes states to not persist to vaults`() { StaffedFlowHospital.DatabaseEndocrinologist.customConditions.add( { t: Throwable -> t is javax.persistence.PersistenceException }) partyA.startFlow(Initiator(listOf(partyA.info.singleIdentity(), partyB.info.singleIdentity()))).get() val hospitalLatch = CountDownLatch(1) diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt index b77da36fcf..d1a96ccda5 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryExceptionsTests.kt @@ -38,8 +38,8 @@ class VaultQueryExceptionsTests : VaultQueryParties by rule { @JvmField val rollbackRule = VaultQueryRollbackRule(this) - @Test - fun `query attempting to use unregistered schema`() { + @Test(timeout=300_000) + fun `query attempting to use unregistered schema`() { database.transaction { // CashSchemaV3 NOT registered with NodeSchemaService val logicalExpression = builder { SampleCashSchemaV3.PersistentCashState::currency.equal(GBP.currencyCode) } diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt index 28d1a5a5f0..1166a1a500 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt @@ -186,8 +186,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { * Helper method for generating a Persistent H2 test database */ @Ignore - @Test - fun createPersistentTestDb() { + @Test(timeout=300_000) + fun createPersistentTestDb() { val database = configureDatabase(makePersistentDataSourceProperties(), DatabaseConfig(), identitySvc::wellKnownPartyFromX500Name, identitySvc::wellKnownPartyFromAnonymous) setUpDb(database, 5000) @@ -231,8 +231,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** Generic Query tests: using CommonQueryCriteria */ - @Test - fun `unconsumed base contract states for single participant`() { + @Test(timeout=300_000) + fun `unconsumed base contract states for single participant`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BIG_CORP_IDENTITY) vaultFiller.fillWithDummyState(participants = listOf(MEGA_CORP, MINI_CORP)) @@ -249,8 +249,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed base contract states for two participants`() { + @Test(timeout=300_000) + fun `unconsumed base contract states for two participants`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BIG_CORP_IDENTITY) vaultFiller.fillWithDummyState(participants = listOf(MEGA_CORP, MINI_CORP)) // true @@ -270,8 +270,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** Generic Query tests (combining both FungibleState and LinearState contract types) */ - @Test - fun `criteria with field from mapped superclass`() { + @Test(timeout=300_000) + fun `criteria with field from mapped superclass`() { database.transaction { val expression = builder { SampleCashSchemaV2.PersistentCashState::quantity.sum( @@ -284,8 +284,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `criteria with field from mapped superclass of superclass`() { + @Test(timeout=300_000) + fun `criteria with field from mapped superclass of superclass`() { database.transaction { val expression = builder { SampleCashSchemaV2.PersistentCashState::quantity.sum( @@ -298,8 +298,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `query by interface for a contract class extending a parent contract class`() { + @Test(timeout=300_000) + fun `query by interface for a contract class extending a parent contract class`() { database.transaction { // build custom contract and store in vault @@ -335,8 +335,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { open class BaseState(override val participants: List = emptyList()) : MyContractInterface data class MyState(val name: String, override val participants: List = emptyList()) : BaseState(participants) - @Test - fun `unconsumed states simple`() { + @Test(timeout=300_000) + fun `unconsumed states simple`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -360,8 +360,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed states verbose`() { + @Test(timeout=300_000) + fun `unconsumed states verbose`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -374,8 +374,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `query with sort criteria works even when multiple pages have the same value for the sort criteria field`() { + @Test(timeout=300_000) + fun `query with sort criteria works even when multiple pages have the same value for the sort criteria field`() { val numberOfStates = 59 val pageSize = 13 @@ -415,8 +415,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `query with sort criteria works with pagination`() { + @Test(timeout=300_000) + fun `query with sort criteria works with pagination`() { val numberOfStates = 59 val pageSize = 13 @@ -456,8 +456,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed states with count`() { + @Test(timeout=300_000) + fun `unconsumed states with count`() { database.transaction { repeat(4) { vaultFiller.fillWithSomeTestCash(25.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -475,8 +475,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash states simple`() { + @Test(timeout=300_000) + fun `unconsumed cash states simple`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -488,8 +488,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash states verbose`() { + @Test(timeout=300_000) + fun `unconsumed cash states verbose`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -502,8 +502,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash states sorted by state ref`() { + @Test(timeout=300_000) + fun `unconsumed cash states sorted by state ref`() { val stateRefs: MutableList = mutableListOf() database.transaction { val issuedStates = vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 10, DUMMY_CASH_ISSUER) @@ -533,8 +533,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash states sorted by state ref txnId and index`() { + @Test(timeout=300_000) + fun `unconsumed cash states sorted by state ref txnId and index`() { val consumed = mutableSetOf() database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 10, DUMMY_CASH_ISSUER) @@ -559,8 +559,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed states for state refs`() { + @Test(timeout=300_000) + fun `unconsumed states for state refs`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(8) val issuedStates = vaultFiller.fillWithSomeTestLinearStates(2) @@ -580,8 +580,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed states for contract state types`() { + @Test(timeout=300_000) + fun `unconsumed states for contract state types`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -595,8 +595,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `query by contract states constraint type`() { + @Test(timeout=300_000) + fun `query by contract states constraint type`() { database.transaction { // insert states with different constraint types vaultFiller.fillWithSomeTestLinearStates(1).states.first().state.constraint @@ -650,8 +650,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `query by contract states constraint type and data`() { + @Test(timeout=300_000) + fun `query by contract states constraint type and data`() { database.transaction { // insert states with different constraint types vaultFiller.fillWithSomeTestLinearStates(1).states.first().state.constraint @@ -714,8 +714,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `consumed states`() { + @Test(timeout=300_000) + fun `consumed states`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) val linearStates = vaultFiller.fillWithSomeTestLinearStates(2, "TEST") // create 2 states with same externalId @@ -730,8 +730,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `consumed states with count`() { + @Test(timeout=300_000) + fun `consumed states with count`() { database.transaction { repeat(4) { vaultFiller.fillWithSomeTestCash(25.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -749,8 +749,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `all states`() { + @Test(timeout=300_000) + fun `all states`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) val linearStates = vaultFiller.fillWithSomeTestLinearStates(2, "TEST") // create 2 results with same UID @@ -768,8 +768,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `all states with count`() { + @Test(timeout=300_000) + fun `all states with count`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) val criteria = VaultQueryCriteria(status = Vault.StateStatus.ALL) @@ -785,8 +785,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed states by notary`() { + @Test(timeout=300_000) + fun `unconsumed states by notary`() { database.transaction { vaultFillerCashNotary.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -799,8 +799,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear states for single participant`() { + @Test(timeout=300_000) + fun `unconsumed linear states for single participant`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BIG_CORP_IDENTITY) vaultFiller.fillWithSomeTestLinearStates(2, "TEST", participants = listOf(MEGA_CORP, MINI_CORP)) @@ -818,8 +818,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed dummy states for exact single participant`() { + @Test(timeout=300_000) + fun `unconsumed dummy states for exact single participant`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BIG_CORP_IDENTITY) vaultFiller.fillWithDummyState(participants = listOf(MEGA_CORP, MINI_CORP)) @@ -831,8 +831,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed dummy states for exact two participants`() { + @Test(timeout=300_000) + fun `unconsumed dummy states for exact two participants`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BIG_CORP_IDENTITY) vaultFiller.fillWithDummyState(participants = listOf(MEGA_CORP, MINI_CORP)) @@ -850,8 +850,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear states for two participants`() { + @Test(timeout=300_000) + fun `unconsumed linear states for two participants`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BIG_CORP_IDENTITY) vaultFiller.fillWithSomeTestLinearStates(2, "TEST", participants = listOf(MEGA_CORP, MINI_CORP)) @@ -877,8 +877,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed states with soft locking`() { + @Test(timeout=300_000) + fun `unconsumed states with soft locking`() { database.transaction { val issuedStates = vaultFillerCashNotary.fillWithSomeTestCash(100.DOLLARS, notaryServices, 10, DUMMY_CASH_ISSUER).states.toList() vaultService.softLockReserve(UUID.randomUUID(), NonEmptySet.of(issuedStates[1].ref, issuedStates[2].ref, issuedStates[3].ref)) @@ -920,8 +920,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `state relevancy queries`() { + @Test(timeout=300_000) + fun `state relevancy queries`() { database.transaction { vaultFiller.fillWithSomeTestDeals(listOf("123", "456", "789"), includeMe = true) vaultFiller.fillWithSomeTestDeals(listOf("ABC", "DEF", "GHI"), includeMe = false) @@ -959,8 +959,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator EQUAL`() { + @Test(timeout=300_000) + fun `logical operator EQUAL`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -972,8 +972,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator NOT EQUAL`() { + @Test(timeout=300_000) + fun `logical operator NOT EQUAL`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -985,8 +985,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator GREATER_THAN`() { + @Test(timeout=300_000) + fun `logical operator GREATER_THAN`() { database.transaction { listOf(1.DOLLARS, 10.POUNDS, 100.SWISS_FRANCS).forEach { vaultFiller.fillWithSomeTestCash(it, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -998,8 +998,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator GREATER_THAN_OR_EQUAL`() { + @Test(timeout=300_000) + fun `logical operator GREATER_THAN_OR_EQUAL`() { database.transaction { listOf(1.DOLLARS, 10.POUNDS, 100.SWISS_FRANCS).forEach { vaultFiller.fillWithSomeTestCash(it, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1011,8 +1011,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator LESS_THAN`() { + @Test(timeout=300_000) + fun `logical operator LESS_THAN`() { database.transaction { listOf(1.DOLLARS, 10.POUNDS, 100.SWISS_FRANCS).forEach { vaultFiller.fillWithSomeTestCash(it, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1024,8 +1024,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator LESS_THAN_OR_EQUAL`() { + @Test(timeout=300_000) + fun `logical operator LESS_THAN_OR_EQUAL`() { database.transaction { listOf(1.DOLLARS, 10.POUNDS, 100.SWISS_FRANCS).forEach { vaultFiller.fillWithSomeTestCash(it, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1037,8 +1037,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator BETWEEN`() { + @Test(timeout=300_000) + fun `logical operator BETWEEN`() { database.transaction { listOf(1.DOLLARS, 10.POUNDS, 100.SWISS_FRANCS).forEach { vaultFiller.fillWithSomeTestCash(it, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1050,8 +1050,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator IN`() { + @Test(timeout=300_000) + fun `logical operator IN`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1064,8 +1064,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator NOT IN`() { + @Test(timeout=300_000) + fun `logical operator NOT IN`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1078,8 +1078,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator LIKE`() { + @Test(timeout=300_000) + fun `logical operator LIKE`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1091,8 +1091,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator NOT LIKE`() { + @Test(timeout=300_000) + fun `logical operator NOT LIKE`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1104,8 +1104,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator IS_NULL`() { + @Test(timeout=300_000) + fun `logical operator IS_NULL`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1117,8 +1117,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator NOT_NULL`() { + @Test(timeout=300_000) + fun `logical operator NOT_NULL`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1130,8 +1130,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive EQUAL`() { + @Test(timeout=300_000) + fun `logical operator case insensitive EQUAL`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1143,8 +1143,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive EQUAL does not affect numbers`() { + @Test(timeout=300_000) + fun `logical operator case insensitive EQUAL does not affect numbers`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1156,8 +1156,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive NOT_EQUAL does not return results containing the same characters as the case insensitive string`() { + @Test(timeout=300_000) + fun `logical operator case insensitive NOT_EQUAL does not return results containing the same characters as the case insensitive string`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1169,8 +1169,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive NOT_EQUAL does not affect numbers`() { + @Test(timeout=300_000) + fun `logical operator case insensitive NOT_EQUAL does not affect numbers`() { database.transaction { listOf(USD, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1183,8 +1183,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive IN`() { + @Test(timeout=300_000) + fun `logical operator case insensitive IN`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1197,8 +1197,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive IN does not affect numbers`() { + @Test(timeout=300_000) + fun `logical operator case insensitive IN does not affect numbers`() { database.transaction { vaultFiller.fillWithSomeTestCash(AMOUNT(100, USD), notaryServices, 1, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCash(AMOUNT(200, CHF), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1210,8 +1210,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive NOT IN does not return results containing the same characters as the case insensitive strings`() { + @Test(timeout=300_000) + fun `logical operator case insensitive NOT IN does not return results containing the same characters as the case insensitive strings`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1224,8 +1224,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive NOT_IN does not affect numbers`() { + @Test(timeout=300_000) + fun `logical operator case insensitive NOT_IN does not affect numbers`() { database.transaction { vaultFiller.fillWithSomeTestCash(AMOUNT(100, USD), notaryServices, 1, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCash(AMOUNT(200, CHF), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1237,8 +1237,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator case insensitive LIKE`() { + @Test(timeout=300_000) + fun `logical operator case insensitive LIKE`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1250,8 +1250,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `logical operator NOT LIKE does not return results containing the same characters as the case insensitive string`() { + @Test(timeout=300_000) + fun `logical operator NOT LIKE does not return results containing the same characters as the case insensitive string`() { database.transaction { listOf(USD, GBP, CHF).forEach { vaultFiller.fillWithSomeTestCash(AMOUNT(100, it), notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1263,8 +1263,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions without group clause`() { + @Test(timeout=300_000) + fun `aggregate functions without group clause`() { database.transaction { listOf(100.DOLLARS, 200.DOLLARS, 300.DOLLARS, 400.POUNDS, 500.SWISS_FRANCS).zip(1..5).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -1301,8 +1301,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions with single group clause`() { + @Test(timeout=300_000) + fun `aggregate functions with single group clause`() { database.transaction { listOf(100.DOLLARS, 200.DOLLARS, 300.DOLLARS, 400.POUNDS, 500.SWISS_FRANCS).zip(1..5).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -1342,8 +1342,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions with single group clause desc first column`() { + @Test(timeout=300_000) + fun `aggregate functions with single group clause desc first column`() { database.transaction { listOf(100.DOLLARS, 200.DOLLARS, 300.DOLLARS, 400.POUNDS, 500.SWISS_FRANCS).zip(1..5).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -1364,8 +1364,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions with single group clause desc mid column`() { + @Test(timeout=300_000) + fun `aggregate functions with single group clause desc mid column`() { database.transaction { listOf(100.DOLLARS, 200.DOLLARS, 300.DOLLARS, 400.POUNDS, 500.SWISS_FRANCS).zip(1..5).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -1386,8 +1386,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions with single group clause desc last column`() { + @Test(timeout=300_000) + fun `aggregate functions with single group clause desc last column`() { database.transaction { listOf(100.DOLLARS, 200.DOLLARS, 300.DOLLARS, 400.POUNDS, 500.SWISS_FRANCS).zip(1..5).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -1408,8 +1408,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions sum by issuer and currency and sort by aggregate sum`() { + @Test(timeout=300_000) + fun `aggregate functions sum by issuer and currency and sort by aggregate sum`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BOC_IDENTITY) vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -1443,8 +1443,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions count by contract type`() { + @Test(timeout=300_000) + fun `aggregate functions count by contract type`() { database.transaction { // create new states vaultFillerCashNotary.fillWithSomeTestCash(100.DOLLARS, notaryServices, 10, DUMMY_CASH_ISSUER) @@ -1468,8 +1468,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `aggregate functions count by contract type and state status`() { + @Test(timeout=300_000) + fun `aggregate functions count by contract type and state status`() { database.transaction { // create new states vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 10, DUMMY_CASH_ISSUER) @@ -1531,8 +1531,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { private val TODAY = LocalDate.now().atStartOfDay().toInstant(ZoneOffset.UTC) - @Test - fun `unconsumed states recorded between two time intervals`() { + @Test(timeout=300_000) + fun `unconsumed states recorded between two time intervals`() { database.transaction { vaultFillerCashNotary.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) // DOCSTART VaultQueryExample6 @@ -1555,8 +1555,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `states consumed after time`() { + @Test(timeout=300_000) + fun `states consumed after time`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -1575,8 +1575,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // pagination: first page - @Test - fun `all states with paging specification - first page`() { + @Test(timeout=300_000) + fun `all states with paging specification - first page`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 100, DUMMY_CASH_ISSUER) // DOCSTART VaultQueryExample7 @@ -1590,8 +1590,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // pagination: last page - @Test - fun `all states with paging specification - last`() { + @Test(timeout=300_000) + fun `all states with paging specification - last`() { database.transaction { vaultFiller.fillWithSomeTestCash(95.DOLLARS, notaryServices, 95, DUMMY_CASH_ISSUER) // Last page implies we need to perform a row count for the Query first, @@ -1606,8 +1606,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // pagination: invalid page number - @Test - fun `invalid page number`() { + @Test(timeout=300_000) + fun `invalid page number`() { expectedEx.expect(VaultQueryException::class.java) expectedEx.expectMessage("Page specification: invalid page number") @@ -1621,8 +1621,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // pagination: invalid page size - @Test - fun `invalid page size`() { + @Test(timeout=300_000) + fun `invalid page size`() { expectedEx.expect(VaultQueryException::class.java) expectedEx.expectMessage("Page specification: invalid page size") @@ -1636,8 +1636,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // pagination not specified but more than DEFAULT_PAGE_SIZE results available (fail-fast test) - @Test - fun `pagination not specified but more than default results available`() { + @Test(timeout=300_000) + fun `pagination not specified but more than default results available`() { expectedEx.expect(VaultQueryException::class.java) expectedEx.expectMessage("provide a `PageSpecification(pageNumber, pageSize)`") @@ -1664,8 +1664,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // test paging query example works - @Test - fun `test example of querying states with paging works correctly`() { + @Test(timeout=300_000) + fun `test example of querying states with paging works correctly`() { database.transaction { vaultFiller.fillWithSomeTestCash(25.DOLLARS, notaryServices, 4, DUMMY_CASH_ISSUER) assertThat(queryStatesWithPaging(vaultService, 5).count()).isEqualTo(4) @@ -1677,8 +1677,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // test paging with aggregate function and group by clause - @Test - fun `test paging with aggregate function and group by clause`() { + @Test(timeout=300_000) + fun `test paging with aggregate function and group by clause`() { database.transaction { (0..200).forEach { vaultFiller.fillWithSomeTestLinearStates(1, linearNumber = it.toLong(), linearString = it.toString()) @@ -1707,8 +1707,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // sorting - @Test - fun `sorting - all states sorted by contract type, state status, consumed time`() { + @Test(timeout=300_000) + fun `sorting - all states sorted by contract type, state status, consumed time`() { database.transaction { setUpDb(database) val sortCol1 = Sort.SortColumn(SortAttribute.Standard(Sort.VaultStateAttribute.CONTRACT_STATE_TYPE), Sort.Direction.DESC) @@ -1728,8 +1728,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible assets`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCommodity(Amount(100, Commodity.getInstance("FCOJ")!!), notaryServices, DUMMY_OBLIGATION_ISSUER.ref(1)) @@ -1740,8 +1740,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `consumed fungible assets`() { + @Test(timeout=300_000) + fun `consumed fungible assets`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) this.session.flush() @@ -1755,8 +1755,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash fungible assets`() { + @Test(timeout=300_000) + fun `unconsumed cash fungible assets`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -1765,8 +1765,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash fungible assets after spending`() { + @Test(timeout=300_000) + fun `unconsumed cash fungible assets after spending`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) this.session.flush() @@ -1779,8 +1779,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `consumed cash fungible assets`() { + @Test(timeout=300_000) + fun `consumed cash fungible assets`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) this.session.flush() @@ -1794,8 +1794,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads`() { + @Test(timeout=300_000) + fun `unconsumed linear heads`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestLinearStates(10) @@ -1805,8 +1805,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `consumed linear heads`() { + @Test(timeout=300_000) + fun `consumed linear heads`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 3, DUMMY_CASH_ISSUER) val linearStates = vaultFiller.fillWithSomeTestLinearStates(2, "TEST") // create 2 states with same externalId @@ -1823,8 +1823,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** LinearState tests */ - @Test - fun `unconsumed linear heads for linearId without external Id`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for linearId without external Id`() { database.transaction { val issuedStates = vaultFiller.fillWithSomeTestLinearStates(10) // DOCSTART VaultQueryExample8 @@ -1836,8 +1836,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads by linearId`() { + @Test(timeout=300_000) + fun `unconsumed linear heads by linearId`() { database.transaction { val linearState1 = vaultFiller.fillWithSomeTestLinearStates(1, "ID1") vaultFiller.fillWithSomeTestLinearStates(1, "ID2") @@ -1849,8 +1849,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads for linearId by external Id`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for linearId by external Id`() { database.transaction { val linearState1 = vaultFiller.fillWithSomeTestLinearStates(1, "ID1") vaultFiller.fillWithSomeTestLinearStates(1, "ID2") @@ -1862,8 +1862,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `all linear states for a given linear id`() { + @Test(timeout=300_000) + fun `all linear states for a given linear id`() { database.transaction { val txns = vaultFiller.fillWithSomeTestLinearStates(1, "TEST") val linearState = txns.states.first() @@ -1882,8 +1882,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `all linear states for a given id sorted by uuid`() { + @Test(timeout=300_000) + fun `all linear states for a given id sorted by uuid`() { database.transaction { val txns = vaultFiller.fillWithSomeTestLinearStates(2, "TEST") val linearStates = txns.states.toList() @@ -1901,8 +1901,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear states sorted by external id`() { + @Test(timeout=300_000) + fun `unconsumed linear states sorted by external id`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, externalId = "111") vaultFiller.fillWithSomeTestLinearStates(2, externalId = "222") @@ -1915,8 +1915,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed deal states sorted`() { + @Test(timeout=300_000) + fun `unconsumed deal states sorted`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(10) val uid = UniqueIdentifier("999") @@ -1935,8 +1935,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear states sorted by custom attribute`() { + @Test(timeout=300_000) + fun `unconsumed linear states sorted by custom attribute`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, linearString = "111") vaultFiller.fillWithSomeTestLinearStates(2, linearString = "222") @@ -1950,8 +1950,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `return consumed linear states for a given linear id`() { + @Test(timeout=300_000) + fun `return consumed linear states for a given linear id`() { database.transaction { val txns = vaultFiller.fillWithSomeTestLinearStates(1, "TEST") val linearState = txns.states.first() @@ -1970,8 +1970,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** * Deal Contract state to be removed as is duplicate of LinearState */ - @Test - fun `unconsumed deals`() { + @Test(timeout=300_000) + fun `unconsumed deals`() { database.transaction { vaultFiller.fillWithSomeTestDeals(listOf("123", "456", "789")) val results = vaultService.queryBy() @@ -1979,8 +1979,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed deals for ref`() { + @Test(timeout=300_000) + fun `unconsumed deals for ref`() { database.transaction { vaultFiller.fillWithSomeTestDeals(listOf("123", "456", "789")) // DOCSTART VaultQueryExample10 @@ -1992,8 +1992,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `latest unconsumed deals for ref`() { + @Test(timeout=300_000) + fun `latest unconsumed deals for ref`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(2, "TEST") vaultFiller.fillWithSomeTestDeals(listOf("456")) @@ -2005,8 +2005,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `latest unconsumed deals with party`() { + @Test(timeout=300_000) + fun `latest unconsumed deals with party`() { val parties = listOf(MINI_CORP) database.transaction { vaultFiller.fillWithSomeTestLinearStates(2, "TEST") @@ -2030,8 +2030,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** FungibleAsset tests */ - @Test - fun `unconsumed fungible assets for specific issuer party and refs`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets for specific issuer party and refs`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BOC_IDENTITY) listOf(DUMMY_CASH_ISSUER, BOC.ref(1), BOC.ref(2), BOC.ref(3)).forEach { @@ -2044,8 +2044,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible assets for selected issuer parties`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets for selected issuer parties`() { // GBP issuer val gbpCashIssuerName = CordaX500Name(organisation = "British Pounds Cash Issuer", locality = "London", country = "GB") val gbpCashIssuerServices = MockServices(cordappPackages, gbpCashIssuerName, mock(), generateKeyPair()) @@ -2073,8 +2073,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible assets by owner`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets by owner`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, BOC.ref(1)) vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, MEGA_CORP.ref(0), MINI_CORP) @@ -2085,8 +2085,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible states for owners`() { + @Test(timeout=300_000) + fun `unconsumed fungible states for owners`() { database.transaction { vaultFillerCashNotary.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, MEGA_CORP.ref(0), MEGA_CORP) @@ -2102,8 +2102,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } /** Cash Fungible State specific */ - @Test - fun `unconsumed fungible assets for single currency`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets for single currency`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(10) listOf(USD, GBP, CHF).forEach { @@ -2119,8 +2119,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash balance for single currency`() { + @Test(timeout=300_000) + fun `unconsumed cash balance for single currency`() { database.transaction { listOf(100, 200).zip(1..2).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch.DOLLARS, notaryServices, states, DUMMY_CASH_ISSUER) @@ -2139,8 +2139,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed cash balances for all currencies`() { + @Test(timeout=300_000) + fun `unconsumed cash balances for all currencies`() { database.transaction { listOf(100.DOLLARS, 200.DOLLARS, 300.POUNDS, 400.POUNDS, 500.SWISS_FRANCS, 600.SWISS_FRANCS).zip(1..6).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -2161,8 +2161,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible assets for quantity greater than`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets for quantity greater than`() { database.transaction { listOf(10.DOLLARS, 25.POUNDS, 50.POUNDS, 100.SWISS_FRANCS).zip(listOf(3, 1, 1, 3)).forEach { (howMuch, states) -> vaultFiller.fillWithSomeTestCash(howMuch, notaryServices, states, DUMMY_CASH_ISSUER) @@ -2176,8 +2176,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible assets for issuer party`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets for issuer party`() { database.transaction { identitySvc.verifyAndRegisterIdentity(BOC_IDENTITY) listOf(DUMMY_CASH_ISSUER, BOC.ref(1)).forEach { @@ -2192,8 +2192,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed fungible assets for single currency and quantity greater than`() { + @Test(timeout=300_000) + fun `unconsumed fungible assets for single currency and quantity greater than`() { database.transaction { listOf(100.DOLLARS, 100.POUNDS, 50.POUNDS, 100.SWISS_FRANCS).forEach { vaultFiller.fillWithSomeTestCash(it, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -2210,8 +2210,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** Vault Custom Query tests */ // specifying Query on Commercial Paper contract state attributes - @Test - fun `custom query using JPA - commercial paper schema V1 single attribute`() { + @Test(timeout=300_000) + fun `custom query using JPA - commercial paper schema V1 single attribute`() { database.transaction { val issuance = MEGA_CORP.ref(1) @@ -2247,8 +2247,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // specifying Query on Commercial Paper contract state attributes - @Test - fun `custom query using JPA - commercial paper schema V1 - multiple attributes`() { + @Test(timeout=300_000) + fun `custom query using JPA - commercial paper schema V1 - multiple attributes`() { database.transaction { val issuance = MEGA_CORP.ref(1) @@ -2294,8 +2294,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { /** Chaining together different Query Criteria tests**/ // specifying Query on Cash contract state attributes - @Test - fun `custom - all cash states with amount of currency greater or equal than`() { + @Test(timeout=300_000) + fun `custom - all cash states with amount of currency greater or equal than`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.POUNDS, notaryServices, 1, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -2321,8 +2321,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // specifying Query on Linear state attributes - @Test - fun `unconsumed linear heads for linearId between two timestamps`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for linearId between two timestamps`() { database.transaction { val start = services.clock.instant() vaultFiller.fillWithSomeTestLinearStates(1, "TEST") @@ -2340,8 +2340,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // specifying Query on Linear state attributes - @Test - fun `unconsumed linear heads for a given external id`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for a given external id`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, "TEST1") vaultFiller.fillWithSomeTestLinearStates(1, "TEST2") @@ -2356,8 +2356,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // specifying Query on Linear state attributes - @Test - fun `unconsumed linear heads for linearId between two timestamps for a given external id`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for linearId between two timestamps for a given external id`() { database.transaction { val start = services.clock.instant() vaultFiller.fillWithSomeTestLinearStates(1, "TEST1") @@ -2383,8 +2383,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } // specifying Query on Linear state attributes - @Test - fun `unconsumed linear heads for a given external id or uuid`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for a given external id or uuid`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, "TEST1") val aState = vaultFiller.fillWithSomeTestLinearStates(1, "TEST2").states @@ -2406,8 +2406,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads for single participant`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for single participant`() { database.transaction { identitySvc.verifyAndRegisterIdentity(ALICE_IDENTITY) vaultFiller.fillWithSomeTestLinearStates(1, "TEST1", listOf(ALICE)) @@ -2426,8 +2426,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads for multiple participants`() { + @Test(timeout=300_000) + fun `unconsumed linear heads for multiple participants`() { database.transaction { identitySvc.verifyAndRegisterIdentity(ALICE_IDENTITY) identitySvc.verifyAndRegisterIdentity(BOB_IDENTITY) @@ -2448,8 +2448,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `composite query for fungible and linear states`() { + @Test(timeout=300_000) + fun `composite query for fungible and linear states`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, "TEST1") vaultFiller.fillWithSomeTestDeals(listOf("123")) @@ -2476,8 +2476,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `composite query for fungible, linear and dummy states for multiple participants`() { + @Test(timeout=300_000) + fun `composite query for fungible, linear and dummy states for multiple participants`() { database.transaction { identitySvc.verifyAndRegisterIdentity(ALICE_IDENTITY) identitySvc.verifyAndRegisterIdentity(BOB_IDENTITY) @@ -2509,8 +2509,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads where external id is null`() { + @Test(timeout=300_000) + fun `unconsumed linear heads where external id is null`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, "TEST1") vaultFiller.fillWithSomeTestLinearStates(1) @@ -2526,8 +2526,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumed linear heads where external id is not null`() { + @Test(timeout=300_000) + fun `unconsumed linear heads where external id is not null`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, "TEST1") vaultFiller.fillWithSomeTestLinearStates(1) @@ -2543,8 +2543,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `enriched and overridden composite query handles defaults correctly`() { + @Test(timeout=300_000) + fun `enriched and overridden composite query handles defaults correctly`() { database.transaction { vaultFiller.fillWithSomeTestCash(100.DOLLARS, notaryServices, 2, DUMMY_CASH_ISSUER) vaultFiller.fillWithSomeTestCommodity(Amount(100, Commodity.getInstance("FCOJ")!!), notaryServices, DUMMY_OBLIGATION_ISSUER.ref(1)) @@ -2568,8 +2568,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `sorted, enriched and overridden composite query with constraints handles defaults correctly`() { + @Test(timeout=300_000) + fun `sorted, enriched and overridden composite query with constraints handles defaults correctly`() { database.transaction { vaultFiller.fillWithSomeTestLinearStates(1, constraint = WhitelistedByZoneAttachmentConstraint) vaultFiller.fillWithSomeTestLinearStates(1, constraint = SignatureAttachmentConstraint(alice.publicKey)) @@ -2595,8 +2595,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun unconsumedCashStatesForSpending_single_issuer_reference() { + @Test(timeout=300_000) + fun unconsumedCashStatesForSpending_single_issuer_reference() { database.transaction { vaultFiller.fillWithSomeTestCash(1000.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) this.session.flush() @@ -2613,8 +2613,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `unconsumedCashStatesForSpending single issuer reference not matching`() { + @Test(timeout=300_000) + fun `unconsumedCashStatesForSpending single issuer reference not matching`() { database.transaction { vaultFiller.fillWithSomeTestCash(1000.DOLLARS, notaryServices, 1, DUMMY_CASH_ISSUER) @@ -2628,8 +2628,8 @@ abstract class VaultQueryTestsBase : VaultQueryParties { } } - @Test - fun `record a transaction with number of inputs greater than vault page size`() { + @Test(timeout=300_000) + fun `record a transaction with number of inputs greater than vault page size`() { val notary = dummyNotary val issuerKey = notary.keyPair val signatureMetadata = SignatureMetadata(services.myInfo.platformVersion, Crypto.findSignatureScheme(issuerKey.public).schemeNumberID) @@ -2669,8 +2669,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { * Dynamic trackBy() tests are H2 only, since rollback stops events being emitted. */ - @Test - fun trackCashStates_unconsumed() { + @Test(timeout=300_000) + fun trackCashStates_unconsumed() { val updates = database.transaction { val updates = // DOCSTART VaultQueryExample15 @@ -2710,8 +2710,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun trackCashStates_consumed() { + @Test(timeout=300_000) + fun trackCashStates_consumed() { val updates = database.transaction { val criteria = VaultQueryCriteria(status = Vault.StateStatus.CONSUMED) @@ -2752,8 +2752,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun trackCashStates_all() { + @Test(timeout=300_000) + fun trackCashStates_all() { val updates = database.transaction { val updates = database.transaction { @@ -2805,8 +2805,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun trackLinearStates() { + @Test(timeout=300_000) + fun trackLinearStates() { val updates = database.transaction { // DOCSTART VaultQueryExample16 @@ -2852,8 +2852,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun trackDealStates() { + @Test(timeout=300_000) + fun trackDealStates() { val updates = database.transaction { // DOCSTART VaultQueryExample17 val (snapshot, updates) = vaultService.trackBy() @@ -2893,8 +2893,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun `track by only returns updates of tracked type`() { + @Test(timeout=300_000) + fun `track by only returns updates of tracked type`() { val updates = database.transaction { val (snapshot, updates) = vaultService.trackBy() assertThat(snapshot.states).hasSize(0) @@ -2916,8 +2916,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun `track by of super class only returns updates of sub classes of tracked type`() { + @Test(timeout=300_000) + fun `track by of super class only returns updates of sub classes of tracked type`() { val updates = database.transaction { val (snapshot, updates) = vaultService.trackBy() assertThat(snapshot.states).hasSize(0) @@ -2939,8 +2939,8 @@ class VaultQueryTests : VaultQueryTestsBase(), VaultQueryParties by delegate { } } - @Test - fun `track by of contract state interface returns updates of all states`() { + @Test(timeout=300_000) + fun `track by of contract state interface returns updates of all states`() { val updates = database.transaction { val (snapshot, updates) = vaultService.trackBy() assertThat(snapshot.states).hasSize(0) diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt index c9cfd400a1..959a407429 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt @@ -162,15 +162,15 @@ class VaultSoftLockManagerTest { mockNet.stopNodes() } - @Test - fun `plain old state is not soft locked`() = run(false, PlainOldState(nodePair), false) + @Test(timeout=300_000) + fun `plain old state is not soft locked`() = run(false, PlainOldState(nodePair), false) - @Test - fun `plain old state is not soft locked with checkpoint`() = run(false, PlainOldState(nodePair), true) + @Test(timeout=300_000) + fun `plain old state is not soft locked with checkpoint`() = run(false, PlainOldState(nodePair), true) - @Test - fun `fungible asset is soft locked`() = run(true, FungibleAssetImpl(nodePair), false) + @Test(timeout=300_000) + fun `fungible asset is soft locked`() = run(true, FungibleAssetImpl(nodePair), false) - @Test - fun `fungible asset is soft locked with checkpoint`() = run(true, FungibleAssetImpl(nodePair), true) + @Test(timeout=300_000) + fun `fungible asset is soft locked with checkpoint`() = run(true, FungibleAssetImpl(nodePair), true) } diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt index 69beebe45b..24c2f89e36 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt @@ -100,8 +100,8 @@ class VaultWithCashTest { database.close() } - @Test - fun splits() { + @Test(timeout=300_000) + fun splits() { database.transaction { // Fix the PRNG so that we get the same splits every time. vaultFiller.fillWithSomeTestCash(100.DOLLARS, issuerServices, 3, DUMMY_CASH_ISSUER) @@ -124,8 +124,8 @@ class VaultWithCashTest { } } - @Test - fun `issue and spend total correctly and irrelevant ignored`() { + @Test(timeout=300_000) + fun `issue and spend total correctly and irrelevant ignored`() { val megaCorpServices = MockServices(cordappPackages, MEGA_CORP.name, mock(), MEGA_CORP_KEY) val freshKey = services.keyManagementService.freshKey() @@ -172,8 +172,8 @@ class VaultWithCashTest { } } - @Test - fun `issue and attempt double spend`() { + @Test(timeout=300_000) + fun `issue and attempt double spend`() { val freshKey = services.keyManagementService.freshKey() val criteriaLocked = VaultQueryCriteria(softLockingCondition = QueryCriteria.SoftLockingCondition(QueryCriteria.SoftLockingType.LOCKED_ONLY)) @@ -262,8 +262,8 @@ class VaultWithCashTest { } } - @Test - fun `branching LinearStates fails to verify`() { + @Test(timeout=300_000) + fun `branching LinearStates fails to verify`() { database.transaction { val freshKey = services.keyManagementService.freshKey() val freshIdentity = AnonymousParty(freshKey) @@ -283,8 +283,8 @@ class VaultWithCashTest { } } - @Test - fun `sequencing LinearStates works`() { + @Test(timeout=300_000) + fun `sequencing LinearStates works`() { val freshKey = services.keyManagementService.freshKey() val freshIdentity = AnonymousParty(freshKey) val linearId = UniqueIdentifier() @@ -324,8 +324,8 @@ class VaultWithCashTest { } } - @Test - fun `spending cash in vault of mixed state types works`() { + @Test(timeout=300_000) + fun `spending cash in vault of mixed state types works`() { val freshKey = services.keyManagementService.freshKey() database.transaction { @@ -362,8 +362,8 @@ class VaultWithCashTest { } } - @Test - fun `consuming multiple contract state types`() { + @Test(timeout=300_000) + fun `consuming multiple contract state types`() { val freshKey = services.keyManagementService.freshKey() val freshIdentity = AnonymousParty(freshKey) diff --git a/node/src/test/kotlin/net/corda/node/utilities/AddressUtilsTests.kt b/node/src/test/kotlin/net/corda/node/utilities/AddressUtilsTests.kt index e009ca3d5c..a34809f3e1 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/AddressUtilsTests.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/AddressUtilsTests.kt @@ -6,8 +6,8 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue class AddressUtilsTests { - @Test - fun `correctly determines if the provided address is public`() { + @Test(timeout=300_000) + fun `correctly determines if the provided address is public`() { assertFalse { AddressUtils.isPublic("localhost") } assertFalse { AddressUtils.isPublic("127.0.0.1") } assertFalse { AddressUtils.isPublic("::1") } diff --git a/node/src/test/kotlin/net/corda/node/utilities/AffinityExecutorTests.kt b/node/src/test/kotlin/net/corda/node/utilities/AffinityExecutorTests.kt index 28423baed6..a5f1b77567 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/AffinityExecutorTests.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/AffinityExecutorTests.kt @@ -17,8 +17,8 @@ class AffinityExecutorTests { _executor = null } - @Test - fun `flush handles nested executes`() { + @Test(timeout=300_000) + fun `flush handles nested executes`() { _executor = AffinityExecutor.ServiceAffinityExecutor("test4", 1) var nestedRan = false val latch = CountDownLatch(1) @@ -31,8 +31,8 @@ class AffinityExecutorTests { assertTrue(nestedRan) } - @Test - fun `single threaded affinity executor runs on correct thread`() { + @Test(timeout=300_000) + fun `single threaded affinity executor runs on correct thread`() { val thisThread = Thread.currentThread() _executor = AffinityExecutor.ServiceAffinityExecutor("test thread", 1) assertTrue(!executor.isOnThread) @@ -53,8 +53,8 @@ class AffinityExecutorTests { assertEquals(thread2.get(), thread.get()) } - @Test - fun `pooled executor`() { + @Test(timeout=300_000) + fun `pooled executor`() { _executor = AffinityExecutor.ServiceAffinityExecutor("test2", 3) assertFalse(executor.isOnThread) diff --git a/node/src/test/kotlin/net/corda/node/utilities/ClockUtilsTest.kt b/node/src/test/kotlin/net/corda/node/utilities/ClockUtilsTest.kt index 571dee482b..2a755389b9 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/ClockUtilsTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/ClockUtilsTest.kt @@ -42,55 +42,55 @@ class ClockUtilsTest { executor.shutdown() } - @Test - fun `test waiting no time for a deadline`() { + @Test(timeout=300_000) + fun `test waiting no time for a deadline`() { assertFalse(NodeSchedulerService.awaitWithDeadline(stoppedClock, stoppedClock.instant()), "Should have reached deadline") } - @Test - fun `test waiting negative time for a deadline`() { + @Test(timeout=300_000) + fun `test waiting negative time for a deadline`() { assertFalse(NodeSchedulerService.awaitWithDeadline(stoppedClock, stoppedClock.instant().minus(1.hours)), "Should have reached deadline") } - @Test - fun `test waiting no time for a deadline with incomplete future`() { + @Test(timeout=300_000) + fun `test waiting no time for a deadline with incomplete future`() { val future = SettableFuture.create() assertFalse(NodeSchedulerService.awaitWithDeadline(stoppedClock, stoppedClock.instant(), future), "Should have reached deadline") } - @Test - fun `test waiting negative time for a deadline with incomplete future`() { + @Test(timeout=300_000) + fun `test waiting negative time for a deadline with incomplete future`() { val future = SettableFuture.create() assertFalse(NodeSchedulerService.awaitWithDeadline(stoppedClock, stoppedClock.instant().minus(1.hours), future), "Should have reached deadline") } - @Test - fun `test waiting for a deadline with future completed before wait`() { + @Test(timeout=300_000) + fun `test waiting for a deadline with future completed before wait`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val future = SettableFuture.create() completeNow(future) assertTrue(NodeSchedulerService.awaitWithDeadline(stoppedClock, advancedClock.instant(), future), "Should not have reached deadline") } - @Test - fun `test waiting for a deadline with future completed after wait`() { + @Test(timeout=300_000) + fun `test waiting for a deadline with future completed after wait`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val future = SettableFuture.create() completeAfterWaiting(future) assertTrue(NodeSchedulerService.awaitWithDeadline(stoppedClock, advancedClock.instant(), future), "Should not have reached deadline") } - @Test - fun `test waiting for a deadline with clock advance`() { + @Test(timeout=300_000) + fun `test waiting for a deadline with clock advance`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val testClock = TestClock(stoppedClock) advanceClockAfterWait(testClock, 1.hours) assertFalse(NodeSchedulerService.awaitWithDeadline(testClock, advancedClock.instant()), "Should have reached deadline") } - @Test - fun `test waiting for a deadline with clock advance and incomplete future`() { + @Test(timeout=300_000) + fun `test waiting for a deadline with clock advance and incomplete future`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val testClock = TestClock(stoppedClock) val future = SettableFuture.create() @@ -98,8 +98,8 @@ class ClockUtilsTest { assertFalse(NodeSchedulerService.awaitWithDeadline(testClock, advancedClock.instant(), future), "Should have reached deadline") } - @Test - fun `test waiting for a deadline with clock advance and complete future`() { + @Test(timeout=300_000) + fun `test waiting for a deadline with clock advance and complete future`() { val advancedClock = Clock.offset(stoppedClock, 2.hours) val testClock = TestClock(stoppedClock) val future = SettableFuture.create() @@ -108,8 +108,8 @@ class ClockUtilsTest { assertTrue(NodeSchedulerService.awaitWithDeadline(testClock, advancedClock.instant(), future), "Should not have reached deadline") } - @Test - fun `test waiting for a deadline with multiple clock advance and incomplete future`() { + @Test(timeout=300_000) + fun `test waiting for a deadline with multiple clock advance and incomplete future`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val testClock = TestClock(stoppedClock) val future = SettableFuture.create() @@ -119,8 +119,8 @@ class ClockUtilsTest { assertFalse(NodeSchedulerService.awaitWithDeadline(testClock, advancedClock.instant(), future), "Should have reached deadline") } - @Test - fun `test external interrupt of a clock future`() { + @Test(timeout=300_000) + fun `test external interrupt of a clock future`() { val mainStrand = Strand.currentStrand() executor.execute @Suspendable { // Wait until main thread is waiting @@ -140,8 +140,8 @@ class ClockUtilsTest { } } - @Test - @Suspendable + @Test(timeout=300_000) +@Suspendable fun `test waiting for a deadline with multiple clock advance and incomplete JDK8 future on Fibers`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val testClock = TestClock(stoppedClock) @@ -162,8 +162,8 @@ class ClockUtilsTest { assertFalse(future.getOrThrow(), "Should have reached deadline") } - @Test - @Suspendable + @Test(timeout=300_000) +@Suspendable fun `test waiting for a deadline with multiple clock advance and incomplete Guava future on Fibers`() { val advancedClock = Clock.offset(stoppedClock, 1.hours) val testClock = TestClock(stoppedClock) diff --git a/node/src/test/kotlin/net/corda/node/utilities/InfrequentlyMutatedCacheTest.kt b/node/src/test/kotlin/net/corda/node/utilities/InfrequentlyMutatedCacheTest.kt index 17bd9ceaba..fab9b1d7be 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/InfrequentlyMutatedCacheTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/InfrequentlyMutatedCacheTest.kt @@ -25,8 +25,8 @@ class InfrequentlyMutatedCacheTest { database.close() } - @Test - fun `get from empty cache returns result of loader`() { + @Test(timeout=300_000) + fun `get from empty cache returns result of loader`() { database.transaction { // This will cache "1" val result = cache.get("foo") { @@ -36,16 +36,16 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `getIfPresent from empty cache returns null`() { + @Test(timeout=300_000) + fun `getIfPresent from empty cache returns null`() { database.transaction { val result = cache.getIfPresent("foo") assertNull(result) } } - @Test - fun `other thread get returns result of local thread loader`() { + @Test(timeout=300_000) + fun `other thread get returns result of local thread loader`() { database.transaction { // This will cache "1" val result = cache.get("foo") { @@ -58,8 +58,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `second get from empty cache returns result of first loader`() { + @Test(timeout=300_000) + fun `second get from empty cache returns result of first loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -72,8 +72,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `getIfPresent after get from empty cache returns result of first loader`() { + @Test(timeout=300_000) + fun `getIfPresent after get from empty cache returns result of first loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -84,8 +84,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `second get from empty cache with invalidate in the middle returns result of second loader`() { + @Test(timeout=300_000) + fun `second get from empty cache with invalidate in the middle returns result of second loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -99,8 +99,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `getIfPresent after get from empty cache with invalidate in the middle returns null`() { + @Test(timeout=300_000) + fun `getIfPresent after get from empty cache with invalidate in the middle returns null`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -112,8 +112,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `second get from empty cache with invalidate and flush in the middle returns result of third loader`() { + @Test(timeout=300_000) + fun `second get from empty cache with invalidate and flush in the middle returns result of third loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -131,8 +131,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `other thread get with invalidate in the middle returns result of second loader`() { + @Test(timeout=300_000) + fun `other thread get with invalidate in the middle returns result of second loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -149,8 +149,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `third get outside first transaction from empty cache with invalidate in the middle returns result of third loader`() { + @Test(timeout=300_000) + fun `third get outside first transaction from empty cache with invalidate in the middle returns result of third loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -171,8 +171,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `getIfPresent outside first transaction from empty cache with invalidate in the middle returns result of third loader`() { + @Test(timeout=300_000) + fun `getIfPresent outside first transaction from empty cache with invalidate in the middle returns result of third loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -191,8 +191,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `other thread get outside first transaction with invalidate in the middle returns result of other thread`() { + @Test(timeout=300_000) + fun `other thread get outside first transaction with invalidate in the middle returns result of other thread`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -216,8 +216,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `fourth get outside first transaction from empty cache with invalidate in the middle returns result of third loader`() { + @Test(timeout=300_000) + fun `fourth get outside first transaction from empty cache with invalidate in the middle returns result of third loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -245,8 +245,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `fourth get outside first transaction from empty cache with nested invalidate in the middle returns result of third loader`() { + @Test(timeout=300_000) + fun `fourth get outside first transaction from empty cache with nested invalidate in the middle returns result of third loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -275,8 +275,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `fourth get outside first transaction from empty cache with invalidate in other thread in the middle returns result of second loader`() { + @Test(timeout=300_000) + fun `fourth get outside first transaction from empty cache with invalidate in other thread in the middle returns result of second loader`() { database.transaction { // This will cache "2" cache.get("foo") { @@ -299,8 +299,8 @@ class InfrequentlyMutatedCacheTest { } } - @Test - fun `transaction started before invalidating thread commits does not cache until after the other thread commits`() { + @Test(timeout=300_000) + fun `transaction started before invalidating thread commits does not cache until after the other thread commits`() { database.transaction { // This will cache "2" cache.get("foo") { diff --git a/node/src/test/kotlin/net/corda/node/utilities/ObservablesTests.kt b/node/src/test/kotlin/net/corda/node/utilities/ObservablesTests.kt index 8e0cf25a21..e9817111d3 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/ObservablesTests.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/ObservablesTests.kt @@ -34,7 +34,7 @@ class ObservablesTests { toBeClosed.clear() } - @Test + @Test(timeout=300_000) fun `bufferUntilDatabaseCommit delays until transaction closed`() { val database = createDatabase() @@ -63,7 +63,7 @@ class ObservablesTests { class TestException : Exception("Synthetic exception for tests") - @Test + @Test(timeout=300_000) fun `bufferUntilDatabaseCommit swallows if transaction rolled back`() { val database = createDatabase() @@ -93,7 +93,7 @@ class ObservablesTests { assertThat(firstEvent.get()).isEqualTo(1 to true) } - @Test + @Test(timeout=300_000) fun `bufferUntilDatabaseCommit propagates error if transaction rolled back`() { val database = createDatabase() @@ -125,7 +125,7 @@ class ObservablesTests { assertThat(secondEvent.get()).isEqualTo(2 to false) } - @Test + @Test(timeout=300_000) fun `bufferUntilDatabaseCommit delays until transaction closed repeatable`() { val database = createDatabase() @@ -159,7 +159,7 @@ class ObservablesTests { assertThat(secondEvent.get()).isEqualTo(1 to false) } - @Test + @Test(timeout=300_000) fun `tee correctly copies observations to multiple observers`() { val source1 = PublishSubject.create() @@ -196,7 +196,7 @@ class ObservablesTests { * SafeSubscriber wrapping that PublishSubject and will call [PublishSubject.PublishSubjectState.onError], which will * eventually shut down all of the subscribers under that PublishSubjectState. */ - @Test + @Test(timeout=300_000) fun `error in unsafe subscriber won't shutdown subscribers under same publish subject, after tee`() { val source1 = PublishSubject.create() val source2 = PublishSubject.create() @@ -214,7 +214,7 @@ class ObservablesTests { assertEquals(2, count) } - @Test + @Test(timeout=300_000) fun `combine tee and bufferUntilDatabaseCommit`() { val database = createDatabase() @@ -243,7 +243,7 @@ class ObservablesTests { assertThat(teedEvent.get()).isEqualTo(0 to true) } - @Test + @Test(timeout=300_000) fun `new transaction open in observer when wrapped`() { val database = createDatabase() @@ -283,7 +283,7 @@ class ObservablesTests { assertThat(delayedEventFromSecondObserver.get().second).isEqualTo(delayedEventFromThirdObserver.get().second) } - @Test + @Test(timeout=300_000) fun `check wrapping in db tx doesn't eagerly subscribe`() { val database = createDatabase() @@ -306,7 +306,7 @@ class ObservablesTests { assertThat(event.get()).isEqualTo(0) } - @Test + @Test(timeout=300_000) fun `check wrapping in db tx unsubscribes`() { val database = createDatabase() @@ -328,7 +328,7 @@ class ObservablesTests { assertThat(unsubscribed).isTrue() } - @Test + @Test(timeout=300_000) fun `check wrapping in db tx restarts if we pass through zero subscribers`() { val database = createDatabase() diff --git a/node/src/test/kotlin/net/corda/node/utilities/PersistentMapTests.kt b/node/src/test/kotlin/net/corda/node/utilities/PersistentMapTests.kt index 69212e7369..f2d08608cf 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/PersistentMapTests.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/PersistentMapTests.kt @@ -31,8 +31,8 @@ class PersistentMapTests { ).apply { preload() } } - @Test - fun `make sure persistence works`() { + @Test(timeout=300_000) + fun `make sure persistence works`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { @@ -47,8 +47,8 @@ class PersistentMapTests { } } - @Test - fun `make sure persistence works using assignment operator`() { + @Test(timeout=300_000) + fun `make sure persistence works using assignment operator`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { @@ -63,8 +63,8 @@ class PersistentMapTests { } } - @Test - fun `make sure updating works`() { + @Test(timeout=300_000) + fun `make sure updating works`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { @@ -81,8 +81,8 @@ class PersistentMapTests { } } - @Test - fun `make sure updating works using assignment operator`() { + @Test(timeout=300_000) + fun `make sure updating works using assignment operator`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { @@ -99,8 +99,8 @@ class PersistentMapTests { } } - @Test - fun `make sure removal works`() { + @Test(timeout=300_000) + fun `make sure removal works`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { @@ -125,8 +125,8 @@ class PersistentMapTests { } } - @Test - fun `make sure persistence works against base class`() { + @Test(timeout=300_000) + fun `make sure persistence works against base class`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { @@ -141,8 +141,8 @@ class PersistentMapTests { } } - @Test - fun `make sure persistence works using assignment operator base class`() { + @Test(timeout=300_000) + fun `make sure persistence works using assignment operator base class`() { val testHash = SecureHash.randomSHA256().toString() database.transaction { diff --git a/node/src/test/kotlin/net/corda/node/utilities/TLSAuthenticationTests.kt b/node/src/test/kotlin/net/corda/node/utilities/TLSAuthenticationTests.kt index 9be77927f9..abd7abe80f 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/TLSAuthenticationTests.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/TLSAuthenticationTests.kt @@ -67,8 +67,8 @@ class TLSAuthenticationTests { "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" ) - @Test - fun `All EC R1`() { + @Test(timeout=300_000) + fun `All EC R1`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.ECDSA_SECP256R1_SHA256, intermediateCAScheme = Crypto.ECDSA_SECP256R1_SHA256, @@ -83,8 +83,8 @@ class TLSAuthenticationTests { testConnect(serverSocket, clientSocket, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256") } - @Test - fun `All RSA`() { + @Test(timeout=300_000) + fun `All RSA`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.RSA_SHA256, intermediateCAScheme = Crypto.RSA_SHA256, @@ -100,8 +100,8 @@ class TLSAuthenticationTests { } // Server's public key type is the one selected if users use different key types (e.g RSA and EC R1). - @Test - fun `Server RSA - Client EC R1 - CAs all EC R1`() { + @Test(timeout=300_000) + fun `Server RSA - Client EC R1 - CAs all EC R1`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.ECDSA_SECP256R1_SHA256, intermediateCAScheme = Crypto.ECDSA_SECP256R1_SHA256, @@ -115,8 +115,8 @@ class TLSAuthenticationTests { testConnect(serverSocket, clientSocket, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256") // Server's key type is selected. } - @Test - fun `Server EC R1 - Client RSA - CAs all EC R1`() { + @Test(timeout=300_000) + fun `Server EC R1 - Client RSA - CAs all EC R1`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.ECDSA_SECP256R1_SHA256, intermediateCAScheme = Crypto.ECDSA_SECP256R1_SHA256, @@ -130,8 +130,8 @@ class TLSAuthenticationTests { testConnect(serverSocket, clientSocket, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256") // Server's key type is selected. } - @Test - fun `Server EC R1 - Client EC R1 - CAs all RSA`() { + @Test(timeout=300_000) + fun `Server EC R1 - Client EC R1 - CAs all RSA`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.RSA_SHA256, intermediateCAScheme = Crypto.RSA_SHA256, @@ -145,8 +145,8 @@ class TLSAuthenticationTests { testConnect(serverSocket, clientSocket, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256") } - @Test - fun `Server EC R1 - Client RSA - Mixed CAs`() { + @Test(timeout=300_000) + fun `Server EC R1 - Client RSA - Mixed CAs`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.ECDSA_SECP256R1_SHA256, intermediateCAScheme = Crypto.RSA_SHA256, @@ -165,8 +165,8 @@ class TLSAuthenticationTests { // // However, the server is still free to ignore this order and pick what it thinks is best, // see https://security.stackexchange.com/questions/121608 for more information. - @Test - fun `TLS cipher suite order matters - client wins`() { + @Test(timeout=300_000) + fun `TLS cipher suite order matters - client wins`() { val (serverSocketFactory, clientSocketFactory) = buildTLSFactories( rootCAScheme = Crypto.ECDSA_SECP256R1_SHA256, intermediateCAScheme = Crypto.ECDSA_SECP256R1_SHA256, diff --git a/node/src/test/kotlin/net/corda/node/utilities/logging/AsyncLoggingTest.kt b/node/src/test/kotlin/net/corda/node/utilities/logging/AsyncLoggingTest.kt index 351760d811..93ccc7bfc3 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/logging/AsyncLoggingTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/logging/AsyncLoggingTest.kt @@ -5,8 +5,8 @@ import kotlin.test.assertTrue class AsyncLoggingTest { - @Test - fun `async logging is configured`() { + @Test(timeout=300_000) + fun `async logging is configured`() { assertTrue(AsyncLoggerContextSelectorNoThreadLocal.isSelected()) } } \ No newline at end of file diff --git a/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt b/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt index e1710283d8..bbc5751118 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt @@ -18,8 +18,8 @@ import kotlin.test.assertEquals class HTTPNetworkRegistrationServiceTest { - @Test - fun `post request properties`() { + @Test(timeout=300_000) + fun `post request properties`() { val versionInfo = VersionInfo.UNKNOWN val pnm = UUID.randomUUID(); val config = rigorousMock().also { @@ -34,8 +34,8 @@ class HTTPNetworkRegistrationServiceTest { assertEquals(listOf("application/octet-stream"), header["Content-Type"]) } - @Test - fun `post request properties with CSR token`() { + @Test(timeout=300_000) + fun `post request properties with CSR token`() { val versionInfo = VersionInfo.UNKNOWN val config = rigorousMock().also { doReturn(null).whenever(it).pnm diff --git a/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt b/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt index e1c2623ca6..a2d9362783 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt @@ -77,8 +77,8 @@ class NetworkRegistrationHelperTest { fs.close() } - @Test - fun `successful registration`() { + @Test(timeout=300_000) + fun `successful registration`() { assertThat(config.signingCertificateStore.getOptional()).isNull() assertThat(config.p2pSslOptions.keyStore.getOptional()).isNull() assertThat(config.p2pSslOptions.trustStore.getOptional()).isNull() @@ -116,16 +116,16 @@ class NetworkRegistrationHelperTest { } } - @Test - fun `missing truststore`() { + @Test(timeout=300_000) + fun `missing truststore`() { val nodeCaCertPath = createNodeCaCertPath() assertThatThrownBy { createFixedResponseRegistrationHelper(nodeCaCertPath) }.hasMessageContaining("This file must contain the root CA cert of your compatibility zone. Please contact your CZ operator.") } - @Test - fun `node CA with incorrect cert role`() { + @Test(timeout=300_000) + fun `node CA with incorrect cert role`() { val nodeCaCertPath = createNodeCaCertPath(type = CertificateType.TLS) saveNetworkTrustStore(CORDA_ROOT_CA to nodeCaCertPath.last()) val registrationHelper = createFixedResponseRegistrationHelper(nodeCaCertPath) @@ -134,8 +134,8 @@ class NetworkRegistrationHelperTest { .withMessageContaining(CertificateType.TLS.toString()) } - @Test - fun `node CA with incorrect subject`() { + @Test(timeout=300_000) + fun `node CA with incorrect subject`() { val invalidName = CordaX500Name("Foo", "MU", "GB") val nodeCaCertPath = createNodeCaCertPath(legalName = invalidName) saveNetworkTrustStore(CORDA_ROOT_CA to nodeCaCertPath.last()) @@ -145,8 +145,8 @@ class NetworkRegistrationHelperTest { .withMessageContaining(invalidName.toString()) } - @Test - fun `multiple certificates are copied to the node's trust store`() { + @Test(timeout=300_000) + fun `multiple certificates are copied to the node's trust store`() { val extraTrustedCertAlias = "trusted_test" val extraTrustedCert = createSelfSignedCACertificate( X500Principal("O=Test Trusted CA,L=MU,C=GB"), @@ -165,8 +165,8 @@ class NetworkRegistrationHelperTest { } } - @Test - fun `wrong root cert in truststore`() { + @Test(timeout=300_000) + fun `wrong root cert in truststore`() { val wrongRootCert = createSelfSignedCACertificate( X500Principal("O=Foo,L=MU,C=GB"), Crypto.generateKeyPair(X509Utilities.DEFAULT_TLS_SIGNATURE_SCHEME)) @@ -178,8 +178,8 @@ class NetworkRegistrationHelperTest { }.isInstanceOf(CertPathValidatorException::class.java) } - @Test - fun `create service identity cert`() { + @Test(timeout=300_000) + fun `create service identity cert`() { assertThat(config.signingCertificateStore.getOptional()).isNull() assertThat(config.p2pSslOptions.keyStore.getOptional()).isNull() assertThat(config.p2pSslOptions.trustStore.getOptional()).isNull() diff --git a/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTNotaryServiceTests.kt b/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTNotaryServiceTests.kt index 5511b44fda..a80575c5ee 100644 --- a/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTNotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTNotaryServiceTests.kt @@ -105,8 +105,8 @@ class BFTNotaryServiceTests { } } - @Test - fun `detect double spend`() { + @Test(timeout=300_000) + fun `detect double spend`() { node.run { val issueTx = signInitialTransaction(notary) { addOutputState(DummyContract.SingleOwnerState(owner = info.singleIdentity()), DummyContract.PROGRAM_ID, AlwaysAcceptAttachmentConstraint) @@ -147,8 +147,8 @@ class BFTNotaryServiceTests { } } - @Test - fun `transactions outside their time window are rejected`() { + @Test(timeout=300_000) + fun `transactions outside their time window are rejected`() { node.run { val issueTx = signInitialTransaction(notary) { addOutputState(DummyContract.SingleOwnerState(owner = info.singleIdentity()), DummyContract.PROGRAM_ID, AlwaysAcceptAttachmentConstraint) @@ -168,8 +168,8 @@ class BFTNotaryServiceTests { } } - @Test - fun `notarise issue tx with time-window`() { + @Test(timeout=300_000) + fun `notarise issue tx with time-window`() { node.run { val issueTx = signInitialTransaction(notary) { setTimeWindow(services.clock.instant(), 30.seconds) @@ -183,8 +183,8 @@ class BFTNotaryServiceTests { } } - @Test - fun `transactions can be re-notarised outside their time window`() { + @Test(timeout=300_000) + fun `transactions can be re-notarised outside their time window`() { node.run { val issueTx = signInitialTransaction(notary) { addOutputState(DummyContract.SingleOwnerState(owner = info.singleIdentity()), DummyContract.PROGRAM_ID, AlwaysAcceptAttachmentConstraint) diff --git a/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTSmartConfigTests.kt b/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTSmartConfigTests.kt index c077312ccf..87d79265c6 100644 --- a/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTSmartConfigTests.kt +++ b/node/src/test/kotlin/net/corda/notary/experimental/bftsmart/BFTSmartConfigTests.kt @@ -11,8 +11,8 @@ import org.junit.Test import kotlin.test.assertEquals class BFTSmartConfigTests { - @Test - fun `replica arithmetic`() { + @Test(timeout=300_000) + fun `replica arithmetic`() { (1..20).forEach { n -> assertEquals(n, maxFaultyReplicas(n) + minCorrectReplicas(n)) } @@ -22,16 +22,16 @@ class BFTSmartConfigTests { 10.let { n -> assertEquals(3, maxFaultyReplicas(n)) } } - @Test - fun `min cluster size`() { + @Test(timeout=300_000) + fun `min cluster size`() { assertEquals(1, minClusterSize(0)) assertEquals(4, minClusterSize(1)) assertEquals(7, minClusterSize(2)) assertEquals(10, minClusterSize(3)) } - @Test - fun `overlapping port ranges are rejected`() { + @Test(timeout=300_000) + fun `overlapping port ranges are rejected`() { fun config(vararg ports: Int) = BFTSmartConfigInternal(ports.map { NetworkHostAndPort("localhost", it) }, false, false) assertThatThrownBy { config(11000, 11001).use {} } .isInstanceOf(IllegalArgumentException::class.java) diff --git a/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftNotaryServiceTests.kt b/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftNotaryServiceTests.kt index d8bc9a71a9..cde76833d9 100644 --- a/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftNotaryServiceTests.kt +++ b/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftNotaryServiceTests.kt @@ -29,8 +29,8 @@ import kotlin.test.assertFailsWith class RaftNotaryServiceTests { private val notaryName = CordaX500Name("RAFT Notary Service", "London", "GB") - @Test - fun `detect double spend`() { + @Test(timeout=300_000) + fun `detect double spend`() { driver(DriverParameters( startNodesInProcess = true, cordappsForAllNodes = listOf(DUMMY_CONTRACTS_CORDAPP), @@ -62,8 +62,8 @@ class RaftNotaryServiceTests { } } - @Test - fun `notarise issue tx with time-window`() { + @Test(timeout=300_000) + fun `notarise issue tx with time-window`() { driver(DriverParameters( startNodesInProcess = true, cordappsForAllNodes = listOf(DUMMY_CONTRACTS_CORDAPP), diff --git a/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftTransactionCommitLogTests.kt b/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftTransactionCommitLogTests.kt index 46608be981..a03f72308e 100644 --- a/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftTransactionCommitLogTests.kt +++ b/node/src/test/kotlin/net/corda/notary/experimental/raft/RaftTransactionCommitLogTests.kt @@ -63,8 +63,8 @@ class RaftTransactionCommitLogTests { databases.forEach { it.close() } } - @Test - fun `stores entries correctly`() { + @Test(timeout=300_000) + fun `stores entries correctly`() { val client = cluster.last().client val states = listOf(StateRef(SecureHash.randomSHA256(), 0), StateRef(SecureHash.randomSHA256(), 0)) @@ -83,8 +83,8 @@ class RaftTransactionCommitLogTests { assertEquals(value2.getOrThrow(), txId) } - @Test - fun `returns conflict for duplicate entries`() { + @Test(timeout=300_000) + fun `returns conflict for duplicate entries`() { val client = cluster.last().client val states = listOf(StateRef(SecureHash.randomSHA256(), 0), StateRef(SecureHash.randomSHA256(), 0)) @@ -103,8 +103,8 @@ class RaftTransactionCommitLogTests { assertEquals(states.toSet(), conflict.consumedStates.keys) } - @Test - fun `transactions outside their time window are rejected`() { + @Test(timeout=300_000) + fun `transactions outside their time window are rejected`() { val client = cluster.last().client val states = listOf(StateRef(SecureHash.randomSHA256(), 0), StateRef(SecureHash.randomSHA256(), 0)) @@ -120,8 +120,8 @@ class RaftTransactionCommitLogTests { assertThat(commitError, instanceOf(NotaryError.TimeWindowInvalid::class.java)) } - @Test - fun `transactions can be re-notarised outside their time window`() { + @Test(timeout=300_000) + fun `transactions can be re-notarised outside their time window`() { val client = cluster.last().client val states = listOf(StateRef(SecureHash.randomSHA256(), 0), StateRef(SecureHash.randomSHA256(), 0)) diff --git a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt index 04cd8ec21e..290452c9de 100644 --- a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt +++ b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt @@ -15,8 +15,8 @@ import java.util.concurrent.CompletableFuture.supplyAsync class AttachmentDemoTest { // run with a 10,000,000 bytes in-memory zip file. In practice, a slightly bigger file will be used (~10,002,000 bytes). - @Test - fun `attachment demo using a 10MB zip file`() { + @Test(timeout=300_000) + fun `attachment demo using a 10MB zip file`() { val numOfExpectedBytes = 10_000_000 driver(DriverParameters( portAllocation = incrementalPortAllocation(), diff --git a/samples/irs-demo/cordapp/contracts-irs/src/test/kotlin/net/corda/irs/contract/IRSTests.kt b/samples/irs-demo/cordapp/contracts-irs/src/test/kotlin/net/corda/irs/contract/IRSTests.kt index 961ef7abdf..200aa422db 100644 --- a/samples/irs-demo/cordapp/contracts-irs/src/test/kotlin/net/corda/irs/contract/IRSTests.kt +++ b/samples/irs-demo/cordapp/contracts-irs/src/test/kotlin/net/corda/irs/contract/IRSTests.kt @@ -242,13 +242,13 @@ class IRSTests { networkParameters ) - @Test - fun ok() { + @Test(timeout=300_000) + fun ok() { trade().verifies() } - @Test - fun `ok with groups`() { + @Test(timeout=300_000) + fun `ok with groups`() { tradegroups().verifies() } @@ -276,8 +276,8 @@ class IRSTests { /** * Just make sure it's sane. */ - @Test - fun pprintIRS() { + @Test(timeout=300_000) + fun pprintIRS() { val irs = singleIRS() println(irs.prettyPrint()) } @@ -292,8 +292,8 @@ class IRSTests { /** * Test the generate. No explicit exception as if something goes wrong, we'll find out anyway. */ - @Test - fun generateIRS() { + @Test(timeout=300_000) + fun generateIRS() { // Tests aren't allowed to return things generateIRSTxn(1) } @@ -301,8 +301,8 @@ class IRSTests { /** * Testing a simple IRS, add a few fixings and then display as CSV. */ - @Test - fun `IRS Export test`() { + @Test(timeout=300_000) + fun `IRS Export test`() { // No transactions etc required - we're just checking simple maths and export functionallity val irs = singleIRS(2) @@ -325,8 +325,8 @@ class IRSTests { /** * Make sure it has a schedule and the schedule has some unfixed rates. */ - @Test - fun `next fixing date`() { + @Test(timeout=300_000) + fun `next fixing date`() { val irs = singleIRS(1) println(irs.calculation.nextFixingDate()) } @@ -334,8 +334,8 @@ class IRSTests { /** * Iterate through all the fix dates and add something. */ - @Test - fun generateIRSandFixSome() { + @Test(timeout=300_000) + fun generateIRSandFixSome() { val services = MockServices(listOf("net.corda.irs.contract"), MEGA_CORP.name, mock().also { listOf(MEGA_CORP, MINI_CORP).forEach { party -> @@ -366,14 +366,14 @@ class IRSTests { } // Move these later as they aren't IRS specific. - @Test - fun `test some rate objects 100 * FixedRate(5%)`() { + @Test(timeout=300_000) + fun `test some rate objects 100 * FixedRate(5%)`() { val r1 = FixedRate(PercentageRatioUnit("5")) assertEquals(5, 100 * r1) } - @Test - fun `expression calculation testing`() { + @Test(timeout=300_000) + fun `expression calculation testing`() { val dummyIRS = singleIRS() val stuffToPrint: ArrayList = arrayListOf( "fixedLeg.notional.quantity", @@ -442,8 +442,8 @@ class IRSTests { ledgerServices.transaction(DUMMY_NOTARY, script) } - @Test - fun `ensure failure occurs when there are inbound states for an agreement command`() { + @Test(timeout=300_000) + fun `ensure failure occurs when there are inbound states for an agreement command`() { val irs = singleIRS() transaction { attachments(IRS_PROGRAM_ID) @@ -455,8 +455,8 @@ class IRSTests { } } - @Test - fun `ensure failure occurs when no events in fix schedule`() { + @Test(timeout=300_000) + fun `ensure failure occurs when no events in fix schedule`() { val irs = singleIRS() val emptySchedule = mutableMapOf() transaction { @@ -468,8 +468,8 @@ class IRSTests { } } - @Test - fun `ensure failure occurs when no events in floating schedule`() { + @Test(timeout=300_000) + fun `ensure failure occurs when no events in floating schedule`() { val irs = singleIRS() val emptySchedule = mutableMapOf() transaction { @@ -481,8 +481,8 @@ class IRSTests { } } - @Test - fun `ensure notionals are non zero`() { + @Test(timeout=300_000) + fun `ensure notionals are non zero`() { val irs = singleIRS() transaction { attachments(IRS_PROGRAM_ID) @@ -501,8 +501,8 @@ class IRSTests { } } - @Test - fun `ensure positive rate on fixed leg`() { + @Test(timeout=300_000) + fun `ensure positive rate on fixed leg`() { val irs = singleIRS() val modifiedIRS = irs.copy(fixedLeg = irs.fixedLeg.copy(fixedRate = FixedRate(PercentageRatioUnit("-0.1")))) transaction { @@ -517,8 +517,8 @@ class IRSTests { /** * This will be modified once we adapt the IRS to be cross currency. */ - @Test - fun `ensure same currency notionals`() { + @Test(timeout=300_000) + fun `ensure same currency notionals`() { val irs = singleIRS() val modifiedIRS = irs.copy(fixedLeg = irs.fixedLeg.copy(notional = Amount(irs.fixedLeg.notional.quantity, Currency.getInstance("JPY")))) transaction { @@ -530,8 +530,8 @@ class IRSTests { } } - @Test - fun `ensure notional amounts are equal`() { + @Test(timeout=300_000) + fun `ensure notional amounts are equal`() { val irs = singleIRS() val modifiedIRS = irs.copy(fixedLeg = irs.fixedLeg.copy(notional = Amount(irs.floatingLeg.notional.quantity + 1, irs.floatingLeg.notional.token))) transaction { @@ -543,8 +543,8 @@ class IRSTests { } } - @Test - fun `ensure trade date and termination date checks are done pt1`() { + @Test(timeout=300_000) + fun `ensure trade date and termination date checks are done pt1`() { val irs = singleIRS() val modifiedIRS1 = irs.copy(fixedLeg = irs.fixedLeg.copy(terminationDate = irs.fixedLeg.effectiveDate.minusDays(1))) transaction { @@ -565,8 +565,8 @@ class IRSTests { } } - @Test - fun `ensure trade date and termination date checks are done pt2`() { + @Test(timeout=300_000) + fun `ensure trade date and termination date checks are done pt2`() { val irs = singleIRS() val modifiedIRS3 = irs.copy(floatingLeg = irs.floatingLeg.copy(terminationDate = irs.fixedLeg.terminationDate.minusDays(1))) @@ -588,8 +588,8 @@ class IRSTests { } } - @Test - fun `various fixing tests`() { + @Test(timeout=300_000) + fun `various fixing tests`() { val ld = LocalDate.of(2016, 3, 8) val bd = BigDecimal("0.0063518") diff --git a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt index 09946bef03..bb82a178eb 100644 --- a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt +++ b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt @@ -80,8 +80,8 @@ class NodeInterestRatesTest { database.close() } - @Test - fun `query successfully`() { + @Test(timeout=300_000) + fun `query successfully`() { database.transaction { val q = NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M") val res = oracle.query(listOf(q)) @@ -91,8 +91,8 @@ class NodeInterestRatesTest { } } - @Test - fun `query with one success and one missing`() { + @Test(timeout=300_000) + fun `query with one success and one missing`() { database.transaction { val q1 = NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M") val q2 = NodeInterestRates.parseFixOf("LIBOR 2016-03-15 1M") @@ -101,8 +101,8 @@ class NodeInterestRatesTest { } } - @Test - fun `query successfully with interpolated rate`() { + @Test(timeout=300_000) + fun `query successfully with interpolated rate`() { database.transaction { val q = NodeInterestRates.parseFixOf("LIBOR 2016-03-16 5M") val res = oracle.query(listOf(q)) @@ -112,23 +112,23 @@ class NodeInterestRatesTest { } } - @Test - fun `rate missing and unable to interpolate`() { + @Test(timeout=300_000) + fun `rate missing and unable to interpolate`() { database.transaction { val q = NodeInterestRates.parseFixOf("EURIBOR 2016-03-15 3M") assertFailsWith { oracle.query(listOf(q)) } } } - @Test - fun `empty query`() { + @Test(timeout=300_000) + fun `empty query`() { database.transaction { assertFailsWith { oracle.query(emptyList()) } } } - @Test - fun `refuse to sign with no relevant commands`() { + @Test(timeout=300_000) + fun `refuse to sign with no relevant commands`() { database.transaction { val tx = makeFullTx() val wtx1 = tx.toWireTransaction(services) @@ -149,8 +149,8 @@ class NodeInterestRatesTest { } } - @Test - fun `sign successfully`() { + @Test(timeout=300_000) + fun `sign successfully`() { database.transaction { val tx = makePartialTX() val fix = oracle.query(listOf(NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M"))).first() @@ -163,8 +163,8 @@ class NodeInterestRatesTest { } } - @Test - fun `do not sign with unknown fix`() { + @Test(timeout=300_000) + fun `do not sign with unknown fix`() { database.transaction { val tx = makePartialTX() val fixOf = NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M") @@ -177,8 +177,8 @@ class NodeInterestRatesTest { } } - @Test - fun `do not sign too many leaves`() { + @Test(timeout=300_000) + fun `do not sign too many leaves`() { database.transaction { val tx = makePartialTX() val fix = oracle.query(listOf(NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M"))).first() @@ -196,8 +196,8 @@ class NodeInterestRatesTest { } } - @Test - fun `empty partial transaction to sign`() { + @Test(timeout=300_000) + fun `empty partial transaction to sign`() { val tx = makeFullTx() val wtx = tx.toWireTransaction(services) val ftx = wtx.buildFilteredTransaction(Predicate { false }) diff --git a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/OracleNodeTearOffTests.kt b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/OracleNodeTearOffTests.kt index 068e938bee..f68c7a2963 100644 --- a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/OracleNodeTearOffTests.kt +++ b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/OracleNodeTearOffTests.kt @@ -65,8 +65,8 @@ class OracleNodeTearOffTests { } // DOCSTART 2 - @Test - fun `verify that the oracle signs the transaction if the interest rate within allowed limit`() { + @Test(timeout=300_000) + fun `verify that the oracle signs the transaction if the interest rate within allowed limit`() { // Create a partial transaction val tx = TransactionBuilder(DUMMY_NOTARY) .withItems(TransactionState(1000.DOLLARS.CASH issuedBy dummyCashIssuer.party ownedBy alice.party, Cash.PROGRAM_ID, DUMMY_NOTARY)) @@ -91,8 +91,8 @@ class OracleNodeTearOffTests { } // DOCEND 2 - @Test - fun `verify that the oracle rejects the transaction if the interest rate is outside the allowed limit`() { + @Test(timeout=300_000) + fun `verify that the oracle rejects the transaction if the interest rate is outside the allowed limit`() { val tx = makePartialTX() val fixOf = NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M") val flow = FilteredRatesFlow(tx, oracle, fixOf, BigDecimal("0.695"), BigDecimal("0.01")) @@ -106,8 +106,8 @@ class OracleNodeTearOffTests { }.isInstanceOf(RatesFixFlow.FixOutOfRange::class.java).hasMessage("Fix out of range by 0.017") } - @Test - fun `verify that the oracle rejects the transaction if there is a privacy leak`() { + @Test(timeout=300_000) + fun `verify that the oracle rejects the transaction if there is a privacy leak`() { val tx = makePartialTX() val fixOf = NodeInterestRates.parseFixOf("LIBOR 2016-03-16 1M") val flow = OverFilteredRatesFlow(tx, oracle, fixOf, BigDecimal("0.675"), BigDecimal("0.1")) diff --git a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/math/InterpolatorsTest.kt b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/math/InterpolatorsTest.kt index d004970841..fb1b7d8cf3 100644 --- a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/math/InterpolatorsTest.kt +++ b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/math/InterpolatorsTest.kt @@ -7,29 +7,29 @@ import kotlin.test.assertFailsWith class InterpolatorsTest { - @Test - fun `linear interpolator throws when key to interpolate is outside the data set`() { + @Test(timeout=300_000) + fun `linear interpolator throws when key to interpolate is outside the data set`() { val xs = doubleArrayOf(1.0, 2.0, 4.0, 5.0) val interpolator = LinearInterpolator(xs, ys = xs) assertFailsWith { interpolator.interpolate(0.0) } assertFailsWith { interpolator.interpolate(6.0) } } - @Test - fun `linear interpolator throws when data set is less than 2 points`() { + @Test(timeout=300_000) + fun `linear interpolator throws when data set is less than 2 points`() { val xs = doubleArrayOf(1.0) assertFailsWith { LinearInterpolator(xs, ys = xs) } } - @Test - fun `linear interpolator returns existing value when key is in data set`() { + @Test(timeout=300_000) + fun `linear interpolator returns existing value when key is in data set`() { val xs = doubleArrayOf(1.0, 2.0, 4.0, 5.0) val interpolatedValue = LinearInterpolator(xs, ys = xs).interpolate(2.0) assertEquals(2.0, interpolatedValue) } - @Test - fun `linear interpolator interpolates missing values correctly`() { + @Test(timeout=300_000) + fun `linear interpolator interpolates missing values correctly`() { val xs = doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0) val toInterpolate = doubleArrayOf(1.5, 2.5, 2.8, 3.3, 3.7, 4.3, 4.7) @@ -38,29 +38,29 @@ class InterpolatorsTest { Assert.assertArrayEquals(toInterpolate, actual, 0.01) } - @Test - fun `cubic interpolator throws when key to interpolate is outside the data set`() { + @Test(timeout=300_000) + fun `cubic interpolator throws when key to interpolate is outside the data set`() { val xs = doubleArrayOf(1.0, 2.0, 4.0, 5.0) val interpolator = CubicSplineInterpolator(xs, ys = xs) assertFailsWith { interpolator.interpolate(0.0) } assertFailsWith { interpolator.interpolate(6.0) } } - @Test - fun `cubic interpolator throws when data set is less than 3 points`() { + @Test(timeout=300_000) + fun `cubic interpolator throws when data set is less than 3 points`() { val xs = doubleArrayOf(1.0, 2.0) assertFailsWith { CubicSplineInterpolator(xs, ys = xs) } } - @Test - fun `cubic interpolator returns existing value when key is in data set`() { + @Test(timeout=300_000) + fun `cubic interpolator returns existing value when key is in data set`() { val xs = doubleArrayOf(1.0, 2.0, 4.0, 5.0) val interpolatedValue = CubicSplineInterpolator(xs, ys = xs).interpolate(2.0) assertEquals(2.0, interpolatedValue) } - @Test - fun `cubic interpolator interpolates missing values correctly`() { + @Test(timeout=300_000) + fun `cubic interpolator interpolates missing values correctly`() { val xs = doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0) val ys = doubleArrayOf(2.0, 4.0, 5.0, 11.0, 10.0) val toInterpolate = doubleArrayOf(1.5, 2.5, 2.8, 3.3, 3.7, 4.3, 4.7) diff --git a/samples/irs-demo/src/integration-test/kotlin/net/corda/irs/IRSDemoTest.kt b/samples/irs-demo/src/integration-test/kotlin/net/corda/irs/IRSDemoTest.kt index 5d0b5c7748..ec95489f1d 100644 --- a/samples/irs-demo/src/integration-test/kotlin/net/corda/irs/IRSDemoTest.kt +++ b/samples/irs-demo/src/integration-test/kotlin/net/corda/irs/IRSDemoTest.kt @@ -50,8 +50,8 @@ class IRSDemoTest { private val futureDate: LocalDate = currentDate.plusMonths(6) private val maxWaitTime: Duration = 60.seconds - @Test - fun `runs IRS demo`() { + @Test(timeout=300_000) + fun `runs IRS demo`() { springDriver(DriverParameters( useTestClock = true, notarySpecs = listOf(NotarySpec(DUMMY_NOTARY_NAME, rpcUsers = rpcUsers)), diff --git a/samples/irs-demo/src/system-test/kotlin/net/corda/irs/IRSDemoDockerTest.kt b/samples/irs-demo/src/system-test/kotlin/net/corda/irs/IRSDemoDockerTest.kt index 1b3f6c3ece..5826525411 100644 --- a/samples/irs-demo/src/system-test/kotlin/net/corda/irs/IRSDemoDockerTest.kt +++ b/samples/irs-demo/src/system-test/kotlin/net/corda/irs/IRSDemoDockerTest.kt @@ -38,8 +38,8 @@ class IRSDemoDockerTest { .build() } - @Test - fun `runs IRS demo selenium phantomjs`() { + @Test(timeout=300_000) + fun `runs IRS demo selenium phantomjs`() { val driver = PhantomJSDriver() diff --git a/samples/irs-demo/web/src/test/kotlin/net/corda/irs/web/IrsDemoWebApplicationTests.kt b/samples/irs-demo/web/src/test/kotlin/net/corda/irs/web/IrsDemoWebApplicationTests.kt index c1d336eba8..8b582f9c9a 100644 --- a/samples/irs-demo/web/src/test/kotlin/net/corda/irs/web/IrsDemoWebApplicationTests.kt +++ b/samples/irs-demo/web/src/test/kotlin/net/corda/irs/web/IrsDemoWebApplicationTests.kt @@ -13,7 +13,7 @@ class IrsDemoWebApplicationTests { @MockBean lateinit var rpc: CordaRPCOps - @Test - fun contextLoads() { + @Test(timeout=300_000) + fun contextLoads() { } } diff --git a/samples/network-verifier/workflows/src/test/kotlin/net/corda/configsample/TestCommsFlowInitiatorTest.kt b/samples/network-verifier/workflows/src/test/kotlin/net/corda/configsample/TestCommsFlowInitiatorTest.kt index fd94e9f014..552a1407f4 100644 --- a/samples/network-verifier/workflows/src/test/kotlin/net/corda/configsample/TestCommsFlowInitiatorTest.kt +++ b/samples/network-verifier/workflows/src/test/kotlin/net/corda/configsample/TestCommsFlowInitiatorTest.kt @@ -14,8 +14,8 @@ class TestCommsFlowInitiatorTest { val NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 12) val DUMMY_BANK_A = TestIdentity(DUMMY_BANK_A_NAME, 3) - @Test - fun `should allow all node infos through if no x500 is passed`() { + @Test(timeout=300_000) + fun `should allow all node infos through if no x500 is passed`() { val testCommsFlowInitiator = TestCommsFlowInitiator() Assert.assertTrue(testCommsFlowInitiator.matchesX500(ALICE.party)) @@ -23,8 +23,8 @@ class TestCommsFlowInitiatorTest { Assert.assertTrue(testCommsFlowInitiator.matchesX500(DUMMY_BANK_A.party)) } - @Test - fun `should allow only specified x500 if no x500 is passed`() { + @Test(timeout=300_000) + fun `should allow only specified x500 if no x500 is passed`() { val testCommsFlowInitiator = TestCommsFlowInitiator(ALICE_NAME) Assert.assertTrue(testCommsFlowInitiator.matchesX500(ALICE.party)) diff --git a/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt b/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt index 3e34a1a42a..801eed8035 100644 --- a/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt +++ b/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt @@ -30,8 +30,8 @@ class SimmValuationTest { const val testTradeId = "trade1" } - @Test - fun `runs SIMM valuation demo`() { + @Test(timeout=300_000) + fun `runs SIMM valuation demo`() { val logConfigFile = projectRootDir / "samples" / "simm-valuation-demo" / "src" / "main" / "resources" / "log4j2.xml" assertThat(logConfigFile).isRegularFile() driver(DriverParameters(isDebug = true, diff --git a/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt b/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt index ea9dcdf086..e9f91f7cbe 100644 --- a/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt +++ b/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt @@ -28,8 +28,8 @@ import org.junit.Test import java.util.concurrent.Executors class TraderDemoTest { - @Test - fun `runs trader demo`() { + @Test(timeout=300_000) + fun `runs trader demo`() { val demoUser = User("demo", "demo", setOf(startFlow(), all())) val bankUser = User("user1", "test", permissions = setOf( startFlow(), @@ -84,8 +84,8 @@ class TraderDemoTest { } } - @Test - fun `Test restart node during flow works properly`() { + @Test(timeout=300_000) + fun `Test restart node during flow works properly`() { driver(DriverParameters( startNodesInProcess = false, inMemoryDB = false, diff --git a/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt b/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt index 56f170ca41..d17bdbfc49 100644 --- a/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt +++ b/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt @@ -65,8 +65,8 @@ class TransactionGraphSearchTests { return GraphTransactionStorage(originTx, inputTx) } - @Test - fun `return empty from empty`() { + @Test(timeout=300_000) + fun `return empty from empty`() { val storage = buildTransactions(DummyContract.Commands.Create()) val search = TransactionGraphSearch(storage, emptyList(), TransactionGraphSearch.Query()) val expected = emptyList() @@ -75,8 +75,8 @@ class TransactionGraphSearchTests { assertEquals(expected, actual) } - @Test - fun `return empty from no match`() { + @Test(timeout=300_000) + fun `return empty from no match`() { val storage = buildTransactions(DummyContract.Commands.Create()) val search = TransactionGraphSearch(storage, listOf(storage.inputTx.tx), TransactionGraphSearch.Query()) val expected = emptyList() @@ -85,8 +85,8 @@ class TransactionGraphSearchTests { assertEquals(expected, actual) } - @Test - fun `return origin on match`() { + @Test(timeout=300_000) + fun `return origin on match`() { val storage = buildTransactions(DummyContract.Commands.Create()) val search = TransactionGraphSearch(storage, listOf(storage.inputTx.tx), TransactionGraphSearch.Query(DummyContract.Commands.Create::class.java)) val expected = listOf(storage.originTx.tx) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt index 592f6bbd59..4d91d996b9 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt @@ -18,7 +18,7 @@ class DeserializeBigDecimalTest : TestBase(KOTLIN) { } @Test - fun `test deserializing big decimal`() { + fun `test deserializing big decimal`() { val bigDecimal = BigDecimalData(BigDecimal.valueOf(VERY_BIG_DECIMAL)) val data = bigDecimal.serialize() @@ -46,4 +46,4 @@ class DeserializeBigDecimalTest : TestBase(KOTLIN) { } @CordaSerializable -data class BigDecimalData(val number: BigDecimal) +data class BigDecimalData(val number: BigDecimal) \ No newline at end of file diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt index 10269358aa..cec80daf48 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt @@ -18,7 +18,7 @@ class DeserializeBigIntegerTest : TestBase(KOTLIN) { } @Test - fun `test deserializing big integer`() { + fun `test deserializing big integer`() { val bigInteger = BigIntegerData(BigInteger.valueOf(VERY_BIG_NUMBER)) val data = bigInteger.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt index 5bcc0432e2..3a1cb6e15c 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeBitSetTest : TestBase(KOTLIN) { @Test - fun `test deserializing bitset`() { + fun `test deserializing bitset`() { val bitSet = BitSet.valueOf(byteArrayOf(0x00, 0x70, 0x55, 0x3A, 0x48, 0x12)) val data = bitSet.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt index d3724b3318..96de396080 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt @@ -50,7 +50,7 @@ class DeserializeCertificatesTest : TestBase(KOTLIN) { } @Test - fun `test deserialize certificate path`() { + fun `test deserialize certificate path`() { val certPath = factory.generateCertPath(listOf(certificate)) val data = certPath.serialize() @@ -75,7 +75,7 @@ class DeserializeCertificatesTest : TestBase(KOTLIN) { } @Test - fun `test deserialize X509 certificate`() { + fun `test deserialize X509 certificate`() { val data = certificate.serialize() sandbox { @@ -99,7 +99,7 @@ class DeserializeCertificatesTest : TestBase(KOTLIN) { } @Test - fun `test X509 CRL`() { + fun `test X509 CRL`() { val caKeyPair = KeyPairGenerator.getInstance("RSA") .generateKeyPair() val signer = JcaContentSignerBuilder("SHA256WithRSAEncryption") diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt index d2919f8066..657a71f1f6 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt @@ -17,7 +17,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeClassTest : TestBase(KOTLIN) { @Test - fun `test deserializing existing class`() { + fun `test deserializing existing class`() { val myClass = ExternalData::class.java val data = myClass.serialize() @@ -36,7 +36,7 @@ class DeserializeClassTest : TestBase(KOTLIN) { } @Test - fun `test deserializing missing class`() { + fun `test deserializing missing class`() { // The DJVM will refuse to find this class because it belongs to net.corda.djvm.**. val myClass = Severity::class.java val data = myClass.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt index 3022db0336..efca075039 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt @@ -18,7 +18,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeCollectionsTest : TestBase(KOTLIN) { @Test - fun `test deserializing string list`() { + fun `test deserializing string list`() { val stringList = StringList(listOf("Hello", "World", "!")) val data = stringList.serialize() @@ -43,7 +43,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing integer set`() { + fun `test deserializing integer set`() { val integerSet = IntegerSet(linkedSetOf(10, 3, 15, 2, 10)) val data = integerSet.serialize() @@ -68,7 +68,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing integer sorted set`() { + fun `test deserializing integer sorted set`() { val integerSortedSet = IntegerSortedSet(sortedSetOf(10, 15, 1000, 3, 2, 10)) val data = integerSortedSet.serialize() @@ -93,7 +93,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing long navigable set`() { + fun `test deserializing long navigable set`() { val longNavigableSet = LongNavigableSet(sortedSetOf(99955L, 10, 15, 1000, 3, 2, 10)) val data = longNavigableSet.serialize() @@ -118,7 +118,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing short collection`() { + fun `test deserializing short collection`() { val shortCollection = ShortCollection(listOf(10, 200, 3000)) val data = shortCollection.serialize() @@ -143,7 +143,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing non-empty string set`() { + fun `test deserializing non-empty string set`() { val nonEmptyStrings = NonEmptyStringSet(NonEmptySet.of("Hello", "World", "!")) val data = nonEmptyStrings.serialize() @@ -168,7 +168,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing enum set`() { + fun `test deserializing enum set`() { val enumSet = HasEnumSet(EnumSet.of(ExternalEnum.DOH)) val data = enumSet.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt index eb9d80dacd..076a5d00d2 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt @@ -33,7 +33,7 @@ class DeserializeComposedCustomDataTest: TestBase(KOTLIN) { val serialization = LocalSerialization(setOf(StringAtomSerializer(), LongAtomSerializer()), emptySet()) @Test - fun `test deserializing composed object`() { + fun `test deserializing composed object`() { val composed = ComposedData(StringAtom(MESSAGE), LongAtom(BIG_NUMBER)) val data = composed.serialize() @@ -59,7 +59,7 @@ class DeserializeComposedCustomDataTest: TestBase(KOTLIN) { } @Test - fun `test deserialization needs custom serializer`() { + fun `test deserialization needs custom serializer`() { val composed = ComposedData(StringAtom(MESSAGE), LongAtom(BIG_NUMBER)) val data = composed.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt index c8bc86fbea..fc747aebce 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt @@ -14,7 +14,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeCurrencyTest : TestBase(KOTLIN) { @Test - fun `test deserializing currency`() { + fun `test deserializing currency`() { val currency = CurrencyData(Currency.getInstance("GBP")) val data = currency.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt index 7e1acff623..0d624edb84 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt @@ -32,7 +32,7 @@ class DeserializeCustomGenericDataTest: TestBase(KOTLIN) { val serialization = LocalSerialization(setOf(CustomSerializer()), emptySet()) @Test - fun `test deserializing custom generic object`() { + fun `test deserializing custom generic object`() { val complex = ComplexGenericData(MESSAGE, BIG_NUMBER) val data = complex.serialize() @@ -54,7 +54,7 @@ class DeserializeCustomGenericDataTest: TestBase(KOTLIN) { } @Test - fun `test deserialization needs custom serializer`() { + fun `test deserialization needs custom serializer`() { val complex = ComplexGenericData(MESSAGE, BIG_NUMBER) val data = complex.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt index 0a2f9e2fd8..cf78125b82 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt @@ -14,7 +14,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeGenericsTest : TestBase(KOTLIN) { @Test - fun `test deserializing generic wrapper with String`() { + fun `test deserializing generic wrapper with String`() { val wrappedString = GenericWrapper(data = "Hello World!") val data = wrappedString.serialize() @@ -33,7 +33,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing generic wrapper with Integer`() { + fun `test deserializing generic wrapper with Integer`() { val wrappedInteger = GenericWrapper(data = 1000) val data = wrappedInteger.serialize() @@ -52,7 +52,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing generic wrapper with array of Integer`() { + fun `test deserializing generic wrapper with array of Integer`() { val wrappedArrayOfInteger = GenericWrapper(arrayOf(1000, 2000, 3000)) val data = wrappedArrayOfInteger.serialize() @@ -72,7 +72,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing generic wrapper with primitive int array`() { + fun `test deserializing generic wrapper with primitive int array`() { val wrappedArrayOfInteger = GenericWrapper(intArrayOf(1000, 2000, 3000)) val data = wrappedArrayOfInteger.serialize() @@ -92,7 +92,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing generic list`() { + fun `test deserializing generic list`() { val wrappedList = GenericWrapper(data = listOf("Hello World!")) val data = wrappedList.serialize() @@ -134,7 +134,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing concrete wrapper`() { + fun `test deserializing concrete wrapper`() { val wrapped = ConcreteWrapper( first = GenericWrapper("Hello World"), second = GenericWrapper('!') diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt index 2194729c27..37af4815c7 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt @@ -18,7 +18,7 @@ class DeserializeInputStreamTest : TestBase(KOTLIN) { } @Test - fun `test deserializing input stream`() { + fun `test deserializing input stream`() { val data = MESSAGE.byteInputStream().serialize() sandbox { diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt index d4ff0aec42..33e7685513 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeInstantTest : TestBase(KOTLIN) { @Test - fun `test deserializing instant`() { + fun `test deserializing instant`() { val instant = Instant.now() val data = instant.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt index a149adcc79..26381f6a34 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeJavaWithMultipleConstructorsTest : TestBase(KOTLIN) { @Test - fun `test deserializing existing class`() { + fun `test deserializing existing class`() { val multiData = MultiConstructorData("Hello World", Long.MAX_VALUE, '!') val data = multiData.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt index c93e016316..bc2c023db2 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt @@ -15,7 +15,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeKotlinAliasTest : TestBase(KOTLIN) { @Test - fun `test deserializing kotlin alias`() { + fun `test deserializing kotlin alias`() { val attachmentId = SecureHash.allOnesHash val data = attachmentId.serialize() @@ -40,7 +40,7 @@ class DeserializeKotlinAliasTest : TestBase(KOTLIN) { } @Test - fun `test deserializing data with kotlin alias`() { + fun `test deserializing data with kotlin alias`() { val attachment = AttachmentData(SecureHash.allOnesHash) val data = attachment.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt index db5b77bfef..efc6c28c6e 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeLocalDateTest : TestBase(KOTLIN) { @Test - fun `test deserializing local date`() { + fun `test deserializing local date`() { val date = LocalDate.now() val data = date.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt index 571e7f8636..04c87136e7 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeLocalDateTimeTest : TestBase(KOTLIN) { @Test - fun `test deserializing local date-time`() { + fun `test deserializing local date-time`() { val dateTime = LocalDateTime.now() val data = dateTime.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt index 343c4c58aa..de5cc7b738 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeLocalTimeTest : TestBase(KOTLIN) { @Test - fun `test deserializing local time`() { + fun `test deserializing local time`() { val time = LocalTime.now() val data = time.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt index 4e22fcccda..9214a79a5f 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt @@ -17,7 +17,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeMapsTest : TestBase(KOTLIN) { @Test - fun `test deserializing map`() { + fun `test deserializing map`() { val stringMap = StringMap(mapOf("Open" to "Hello World", "Close" to "Goodbye, Cruel World")) val data = stringMap.serialize() @@ -42,7 +42,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing sorted map`() { + fun `test deserializing sorted map`() { val sortedMap = StringSortedMap(sortedMapOf( 100 to "Goodbye, Cruel World", 10 to "Hello World", @@ -71,7 +71,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing navigable map`() { + fun `test deserializing navigable map`() { val navigableMap = StringNavigableMap(mapOf( 10000L to "Goodbye, Cruel World", 1000L to "Hello World", @@ -100,7 +100,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing linked hash map`() { + fun `test deserializing linked hash map`() { val linkedHashMap = StringLinkedHashMap(linkedMapOf( "Close" to "Goodbye, Cruel World", "Open" to "Hello World", @@ -130,7 +130,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing tree map`() { + fun `test deserializing tree map`() { val treeMap = StringTreeMap(mapOf( 10000 to "Goodbye, Cruel World", 1000 to "Hello World", @@ -159,7 +159,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { } @Test - fun `test deserializing enum map`() { + fun `test deserializing enum map`() { val enumMap = EnumMap(mapOf( ExampleEnum.ONE to "One!", ExampleEnum.TWO to "Two!" diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt index f3f5cde387..edc4ca56ab 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeMonthDayTest : TestBase(KOTLIN) { @Test - fun `test deserializing month-day`() { + fun `test deserializing month-day`() { val monthDay = MonthDay.now() val data = monthDay.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt index 92fe9c8729..0090ae2535 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt @@ -14,7 +14,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeObjectArraysTest : TestBase(KOTLIN) { @Test - fun `test deserializing string array`() { + fun `test deserializing string array`() { val stringArray = HasStringArray(arrayOf("Hello", "World", "!")) val data = stringArray.serialize() assertEquals("Hello, World, !", ShowStringArray().apply(stringArray)) @@ -40,7 +40,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing character array`() { + fun `test deserializing character array`() { val charArray = HasCharacterArray(arrayOf('H', 'e', 'l', 'l', 'o', '!')) val data = charArray.serialize() assertEquals("Hello!", ShowCharacterArray().apply(charArray)) @@ -66,7 +66,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing long array`() { + fun `test deserializing long array`() { val longArray = HasLongArray(arrayOf(1000, 2000, 3000, 4000, 5000)) val data = longArray.serialize() @@ -91,7 +91,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing integer array`() { + fun `test deserializing integer array`() { val integerArray = HasIntegerArray(arrayOf(100, 200, 300, 400, 500)) val data = integerArray.serialize() @@ -116,7 +116,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing short array`() { + fun `test deserializing short array`() { val shortArray = HasShortArray(arrayOf(100, 200, 300, 400, 500)) val data = shortArray.serialize() @@ -141,7 +141,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing byte array`() { + fun `test deserializing byte array`() { val byteArray = HasByteArray(arrayOf(10, 20, 30, 40, 50)) val data = byteArray.serialize() @@ -166,7 +166,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing double array`() { + fun `test deserializing double array`() { val doubleArray = HasDoubleArray(arrayOf(1000.0, 2000.0, 3000.0, 4000.0, 5000.0)) val data = doubleArray.serialize() @@ -191,7 +191,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing float array`() { + fun `test deserializing float array`() { val floatArray = HasFloatArray(arrayOf(10.0f, 20.0f, 30.0f, 40.0f, 50.0f)) val data = floatArray.serialize() @@ -216,7 +216,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing boolean array`() { + fun `test deserializing boolean array`() { val booleanArray = HasBooleanArray(arrayOf(true, true, true)) val data = booleanArray.serialize() @@ -241,7 +241,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing uuid array`() { + fun `test deserializing uuid array`() { val uuid = UUID.randomUUID() val uuidArray = HasUUIDArray(arrayOf(uuid)) val data = uuidArray.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt index e8b210c81b..d21d135f1c 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeOffsetDateTimeTest : TestBase(KOTLIN) { @Test - fun `test deserializing offset date-time`() { + fun `test deserializing offset date-time`() { val dateTime = OffsetDateTime.now() val data = dateTime.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt index f8cedabc23..5d12059e0e 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeOffsetTimeTest : TestBase(KOTLIN) { @Test - fun `test deserializing instant`() { + fun `test deserializing instant`() { val time = OffsetTime.now() val data = time.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt index 456191706c..ca1041af21 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt @@ -18,7 +18,7 @@ class DeserializeOpaqueBytesSubSequenceTest : TestBase(KOTLIN) { } @Test - fun `test deserializing opaquebytes subsequence`() { + fun `test deserializing opaquebytes subsequence`() { val subSequence = OpaqueBytesSubSequence( bytes = MESSAGE.toByteArray(), offset = OFFSET, diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt index 7f98cb228e..f908ff439e 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeOptionalTest : TestBase(KOTLIN) { @Test - fun `test deserializing optional with object`() { + fun `test deserializing optional with object`() { val optional = Optional.of("Hello World!") val data = optional.serialize() @@ -32,7 +32,7 @@ class DeserializeOptionalTest : TestBase(KOTLIN) { } @Test - fun `test deserializing optional without object`() { + fun `test deserializing optional without object`() { val optional = Optional.empty() val data = optional.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt index 7253009d70..781d74a634 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializePeriodTest : TestBase(KOTLIN) { @Test - fun `test deserializing period`() { + fun `test deserializing period`() { val period = Period.of(1, 2, 3) val data = period.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt index 2b006d79ba..74c7af3e16 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { @Test - fun `test deserializing character array`() { + fun `test deserializing character array`() { val charArray = PrimitiveCharArray(charArrayOf('H', 'e', 'l', 'l', 'o', '!')) val data = charArray.serialize() assertEquals("Hello!", ShowCharArray().apply(charArray)) @@ -39,7 +39,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing integer array`() { + fun `test deserializing integer array`() { val intArray = PrimitiveIntegerArray(intArrayOf(100, 200, 300, 400, 500)) val data = intArray.serialize() @@ -64,7 +64,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing long array`() { + fun `test deserializing long array`() { val longArray = PrimitiveLongArray(longArrayOf(1000, 2000, 3000, 4000, 5000)) val data = longArray.serialize() @@ -89,7 +89,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing short array`() { + fun `test deserializing short array`() { val shortArray = PrimitiveShortArray(shortArrayOf(100, 200, 300, 400, 500)) val data = shortArray.serialize() @@ -114,7 +114,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing byte array`() { + fun `test deserializing byte array`() { val byteArray = PrimitiveByteArray(byteArrayOf(10, 20, 30, 40, 50)) val data = byteArray.serialize() @@ -139,7 +139,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing boolean array`() { + fun `test deserializing boolean array`() { val booleanArray = PrimitiveBooleanArray(booleanArrayOf(true, true)) val data = booleanArray.serialize() @@ -164,7 +164,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing double array`() { + fun `test deserializing double array`() { val doubleArray = PrimitiveDoubleArray(doubleArrayOf(1000.0, 2000.0, 3000.0, 4000.0, 5000.0)) val data = doubleArray.serialize() @@ -189,7 +189,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { } @Test - fun `test deserializing float array`() { + fun `test deserializing float array`() { val floatArray = PrimitiveFloatArray(floatArrayOf(100.0f, 200.0f, 300.0f, 400.0f, 500.0f)) val data = floatArray.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitivesTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitivesTest.kt index afc3b3dedc..00c5fce429 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitivesTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitivesTest.kt @@ -13,7 +13,7 @@ import java.util.UUID @ExtendWith(LocalSerialization::class) class DeserializePrimitivesTest : TestBase(KOTLIN) { @Test - fun `test naked uuid`() { + fun `test naked uuid`() { val uuid = UUID.randomUUID() val data = uuid.serialize() @@ -27,7 +27,7 @@ class DeserializePrimitivesTest : TestBase(KOTLIN) { } @Test - fun `test wrapped uuid`() { + fun `test wrapped uuid`() { val uuid = WrappedUUID(UUID.randomUUID()) val data = uuid.serialize() @@ -41,7 +41,7 @@ class DeserializePrimitivesTest : TestBase(KOTLIN) { } @Test - fun `test naked date`() { + fun `test naked date`() { val now = Date() val data = now.serialize() @@ -55,7 +55,7 @@ class DeserializePrimitivesTest : TestBase(KOTLIN) { } @Test - fun `test wrapped date`() { + fun `test wrapped date`() { val now = WrappedDate(Date()) val data = now.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt index 79a9dae097..579d8b7a16 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt @@ -22,7 +22,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeProtonJTest : TestBase(KOTLIN) { @Test - fun `test deserializing unsigned long`() { + fun `test deserializing unsigned long`() { val protonJ = HasUnsignedLong(UnsignedLong.valueOf(12345678)) val data = protonJ.serialize() @@ -47,7 +47,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing unsigned integer`() { + fun `test deserializing unsigned integer`() { val protonJ = HasUnsignedInteger(UnsignedInteger.valueOf(123456)) val data = protonJ.serialize() @@ -72,7 +72,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing unsigned short`() { + fun `test deserializing unsigned short`() { val protonJ = HasUnsignedShort(UnsignedShort.valueOf(12345)) val data = protonJ.serialize() @@ -97,7 +97,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing unsigned byte`() { + fun `test deserializing unsigned byte`() { val protonJ = HasUnsignedByte(UnsignedByte.valueOf(0x8f.toByte())) val data = protonJ.serialize() @@ -122,7 +122,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing 128 bit decimal`() { + fun `test deserializing 128 bit decimal`() { val protonJ = HasDecimal128(Decimal128(12345678, 98765432)) val data = protonJ.serialize() @@ -147,7 +147,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing 64 bit decimal`() { + fun `test deserializing 64 bit decimal`() { val protonJ = HasDecimal64(Decimal64(98765432)) val data = protonJ.serialize() @@ -171,7 +171,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing 32 bit decimal`() { + fun `test deserializing 32 bit decimal`() { val protonJ = HasDecimal32(Decimal32(123456)) val data = protonJ.serialize() @@ -195,7 +195,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { } @Test - fun `test deserializing symbol`() { + fun `test deserializing symbol`() { val protonJ = HasSymbol(Symbol.valueOf("-my-symbol-value-")) val data = protonJ.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt index 2880fcf493..d952ff10d6 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt @@ -53,7 +53,7 @@ class DeserializePublicKeyTest : TestBase(KOTLIN) { } @Test - fun `test composite public key`() { + fun `test composite public key`() { val key1 = Crypto.generateKeyPair(Crypto.ECDSA_SECP256K1_SHA256).public val key2 = Crypto.generateKeyPair(Crypto.ECDSA_SECP256R1_SHA256).public val key3 = Crypto.generateKeyPair(Crypto.EDDSA_ED25519_SHA512).public diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt index de67313356..35a5f9cfb0 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt @@ -12,7 +12,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeStringBufferTest : TestBase(KOTLIN) { @Test - fun `test deserializing string buffer`() { + fun `test deserializing string buffer`() { val buffer = StringBuffer("Hello World!") val data = buffer.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt index e5970270b9..914ca2f387 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeStringTest : TestBase(KOTLIN) { @Test - fun `test deserializing string`() { + fun `test deserializing string`() { val stringMessage = StringMessage("Hello World!") val data = stringMessage.serialize() @@ -38,7 +38,7 @@ class DeserializeStringTest : TestBase(KOTLIN) { } @Test - fun `test deserializing string list of arrays`() { + fun `test deserializing string list of arrays`() { val stringListArray = StringListOfArray(listOf( arrayOf("Hello"), arrayOf("World"), arrayOf("!")) ) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt index ff7ec49034..36a0a65178 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt @@ -30,7 +30,7 @@ class DeserializeWithCustomSerializerTest: TestBase(KOTLIN) { val serialization = LocalSerialization(setOf(CustomSerializer()), emptySet()) @Test - fun `test deserializing custom object`() { + fun `test deserializing custom object`() { val custom = CustomData(MESSAGE) val data = custom.serialize() @@ -53,7 +53,7 @@ class DeserializeWithCustomSerializerTest: TestBase(KOTLIN) { } @Test - fun `test deserialization needs custom serializer`() { + fun `test deserialization needs custom serializer`() { val custom = CustomData(MESSAGE) val data = custom.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt index 06be0e5d39..2b86b220db 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt @@ -28,7 +28,7 @@ class DeserializeWithObjectCustomSerializerTest: TestBase(KOTLIN) { val serialization = LocalSerialization(setOf(ObjectCustomSerializer), emptySet()) @Test - fun `test deserializing custom object with object serializer`() { + fun `test deserializing custom object with object serializer`() { val custom = CustomData(MESSAGE) val data = custom.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt index 4f8811fba6..8b190fe1b1 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt @@ -31,7 +31,7 @@ class DeserializeWithSerializationWhitelistTest: TestBase(KOTLIN) { val serialization = LocalSerialization(emptySet(), setOf(CustomWhitelist)) @Test - fun `test deserializing custom object`() { + fun `test deserializing custom object`() { val custom = CustomData(MESSAGE) val data = custom.serialize() @@ -54,7 +54,7 @@ class DeserializeWithSerializationWhitelistTest: TestBase(KOTLIN) { } @Test - fun `test deserialization needs whitelisting`() { + fun `test deserialization needs whitelisting`() { val custom = CustomData(MESSAGE) val data = custom.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt index 97b6dfc881..ab03c397d5 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeYearMonthTest : TestBase(KOTLIN) { @Test - fun `test deserializing year-month`() { + fun `test deserializing year-month`() { val yearMonth = YearMonth.now() val data = yearMonth.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt index ed08048074..6d998ce243 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeYearTest : TestBase(KOTLIN) { @Test - fun `test deserializing year`() { + fun `test deserializing year`() { val year = Year.now() val data = year.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt index 0c3f2bce75..4ee3ffda95 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt @@ -13,7 +13,7 @@ import java.util.function.Function @ExtendWith(LocalSerialization::class) class DeserializeZonedDateTimeTest : TestBase(KOTLIN) { @Test - fun `test deserializing zoned date-time`() { + fun `test deserializing zoned date-time`() { val dateTime = ZonedDateTime.now() val data = dateTime.serialize() diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt index 28974395e5..9b55ff4f43 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt @@ -30,7 +30,7 @@ class SafeDeserialisationTest : TestBase(KOTLIN) { } @Test - fun `test deserialising an evil class`() { + fun `test deserialising an evil class`() { val context = (_contextSerializationEnv.get() ?: fail("No serialization environment!")).p2pContext val innocent = InnocentData(MESSAGE, NUMBER) diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt index 0d6ab382d5..fd854c14a0 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt @@ -38,8 +38,8 @@ class ContractAttachmentSerializerTest { mockServices)) } - @Test - fun `write contract attachment and read it back`() { + @Test(timeout=300_000) + fun `write contract attachment and read it back`() { val contractAttachment = ContractAttachment(GeneratedAttachment(EMPTY_BYTE_ARRAY, "test"), DummyContract.PROGRAM_ID) // no token context so will serialize the whole attachment val serialized = contractAttachment.checkpointSerialize() @@ -51,8 +51,8 @@ class ContractAttachmentSerializerTest { assertArrayEquals(contractAttachment.open().readBytes(), deserialized.open().readBytes()) } - @Test - fun `write contract attachment and read it back using token context`() { + @Test(timeout=300_000) + fun `write contract attachment and read it back using token context`() { val attachment = GeneratedAttachment("test".toByteArray(), "test") mockServices.attachments.importAttachment(attachment.open(), "test", null) @@ -67,8 +67,8 @@ class ContractAttachmentSerializerTest { assertArrayEquals(contractAttachment.open().readBytes(), deserialized.open().readBytes()) } - @Test - fun `check only serialize attachment id and contract class name when using token context`() { + @Test(timeout=300_000) + fun `check only serialize attachment id and contract class name when using token context`() { val largeAttachmentSize = 1024 * 1024 val attachment = GeneratedAttachment(ByteArray(largeAttachmentSize), "test") @@ -80,8 +80,8 @@ class ContractAttachmentSerializerTest { assertThat(serialized.size).isLessThan(largeAttachmentSize) } - @Test - fun `throws when missing attachment when using token context`() { + @Test(timeout=300_000) + fun `throws when missing attachment when using token context`() { val attachment = GeneratedAttachment("test".toByteArray(), "test") // don't importAttachment in mockService @@ -93,8 +93,8 @@ class ContractAttachmentSerializerTest { assertThatThrownBy { deserialized.attachment.open() }.isInstanceOf(MissingAttachmentsException::class.java) } - @Test - fun `check attachment in deserialize is lazy loaded when using token context`() { + @Test(timeout=300_000) + fun `check attachment in deserialize is lazy loaded when using token context`() { val attachment = GeneratedAttachment(EMPTY_BYTE_ARRAY, "test") // don't importAttachment in mockService diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt index e4cefe0495..a7945ab61b 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt @@ -120,8 +120,8 @@ class CordaClassResolverTests { private val emptyWhitelistContext: CheckpointSerializationContext = CheckpointSerializationContextImpl(this.javaClass.classLoader, EmptyWhitelist, emptyMap(), true, null) private val allButBlacklistedContext: CheckpointSerializationContext = CheckpointSerializationContextImpl(this.javaClass.classLoader, AllButBlacklisted, emptyMap(), true, null) - @Test - fun `Annotation on enum works for specialised entries`() { + @Test(timeout=300_000) + fun `Annotation on enum works for specialised entries`() { CordaClassResolver(emptyWhitelistContext).getRegistration(Foo.Bar::class.java) } @@ -130,8 +130,8 @@ class CordaClassResolverTests { CordaClassResolver(emptyWhitelistContext).getRegistration(BadFood.Mud::class.java) } - @Test - fun `Annotation on simple enum works`() { + @Test(timeout=300_000) + fun `Annotation on simple enum works`() { CordaClassResolver(emptyWhitelistContext).getRegistration(Simple.Easy::class.java) } @@ -140,8 +140,8 @@ class CordaClassResolverTests { CordaClassResolver(emptyWhitelistContext).getRegistration(BadSimple.Nasty::class.java) } - @Test - fun `Annotation on array element works`() { + @Test(timeout=300_000) + fun `Annotation on array element works`() { val values = arrayOf(Element()) CordaClassResolver(emptyWhitelistContext).getRegistration(values.javaClass) } @@ -152,18 +152,18 @@ class CordaClassResolverTests { CordaClassResolver(emptyWhitelistContext).getRegistration(values.javaClass) } - @Test - fun `Annotation not needed on abstract class`() { + @Test(timeout=300_000) + fun `Annotation not needed on abstract class`() { CordaClassResolver(emptyWhitelistContext).getRegistration(AbstractClass::class.java) } - @Test - fun `Annotation not needed on interface`() { + @Test(timeout=300_000) + fun `Annotation not needed on interface`() { CordaClassResolver(emptyWhitelistContext).getRegistration(Interface::class.java) } - @Test - fun `Calling register method on modified Kryo does not consult the whitelist`() { + @Test(timeout=300_000) + fun `Calling register method on modified Kryo does not consult the whitelist`() { val kryo = CordaKryo(CordaClassResolver(emptyWhitelistContext)) kryo.register(NotSerializable::class.java) } @@ -179,19 +179,19 @@ class CordaClassResolverTests { CordaClassResolver(emptyWhitelistContext).getRegistration(NotSerializable::class.java) } - @Test - fun `Annotation is not needed with whitelisting`() { + @Test(timeout=300_000) + fun `Annotation is not needed with whitelisting`() { val resolver = CordaClassResolver(emptyWhitelistContext.withWhitelisted(NotSerializable::class.java)) resolver.getRegistration(NotSerializable::class.java) } - @Test - fun `Annotation not needed on Object`() { + @Test(timeout=300_000) + fun `Annotation not needed on Object`() { CordaClassResolver(emptyWhitelistContext).getRegistration(Object::class.java) } - @Test - fun `Annotation not needed on primitive`() { + @Test(timeout=300_000) + fun `Annotation not needed on primitive`() { CordaClassResolver(emptyWhitelistContext).getRegistration(Integer.TYPE) } @@ -227,14 +227,14 @@ class CordaClassResolverTests { CordaClassResolver(emptyWhitelistContext).getRegistration(attachedClass) } - @Test - fun `Annotation is inherited from interfaces`() { + @Test(timeout=300_000) + fun `Annotation is inherited from interfaces`() { CordaClassResolver(emptyWhitelistContext).getRegistration(SerializableViaInterface::class.java) CordaClassResolver(emptyWhitelistContext).getRegistration(SerializableViaSubInterface::class.java) } - @Test - fun `Annotation is inherited from superclass`() { + @Test(timeout=300_000) + fun `Annotation is inherited from superclass`() { CordaClassResolver(emptyWhitelistContext).getRegistration(SubElement::class.java) CordaClassResolver(emptyWhitelistContext).getRegistration(SubSubElement::class.java) CordaClassResolver(emptyWhitelistContext).getRegistration(SerializableViaSuperSubInterface::class.java) @@ -244,8 +244,8 @@ class CordaClassResolverTests { @get:Rule val expectedEx = ExpectedException.none()!! - @Test - fun `Check blacklisted class`() { + @Test(timeout=300_000) + fun `Check blacklisted class`() { expectedEx.expect(IllegalStateException::class.java) expectedEx.expectMessage("Class java.util.HashSet is blacklisted, so it cannot be used in serialization.") val resolver = CordaClassResolver(allButBlacklistedContext) @@ -253,14 +253,14 @@ class CordaClassResolverTests { resolver.getRegistration(HashSet::class.java) } - @Test - fun `Kotlin EmptyList not registered`() { + @Test(timeout=300_000) + fun `Kotlin EmptyList not registered`() { val resolver = CordaClassResolver(allButBlacklistedContext) assertNull(resolver.getRegistration(emptyListClass)) } - @Test - fun `Kotlin EmptyList registers as Java emptyList`() { + @Test(timeout=300_000) + fun `Kotlin EmptyList registers as Java emptyList`() { val javaEmptyListClass = Collections.emptyList().javaClass val kryo = rigorousMock() val resolver = CordaClassResolver(allButBlacklistedContext).apply { setKryo(kryo) } @@ -275,14 +275,14 @@ class CordaClassResolverTests { assertEquals(registration, resolver.getRegistration(emptyListClass)) } - @Test - fun `Kotlin EmptySet not registered`() { + @Test(timeout=300_000) + fun `Kotlin EmptySet not registered`() { val resolver = CordaClassResolver(allButBlacklistedContext) assertNull(resolver.getRegistration(emptySetClass)) } - @Test - fun `Kotlin EmptySet registers as Java emptySet`() { + @Test(timeout=300_000) + fun `Kotlin EmptySet registers as Java emptySet`() { val javaEmptySetClass = Collections.emptySet().javaClass val kryo = rigorousMock() val resolver = CordaClassResolver(allButBlacklistedContext).apply { setKryo(kryo) } @@ -297,14 +297,14 @@ class CordaClassResolverTests { assertEquals(registration, resolver.getRegistration(emptySetClass)) } - @Test - fun `Kotlin EmptyMap not registered`() { + @Test(timeout=300_000) + fun `Kotlin EmptyMap not registered`() { val resolver = CordaClassResolver(allButBlacklistedContext) assertNull(resolver.getRegistration(emptyMapClass)) } - @Test - fun `Kotlin EmptyMap registers as Java emptyMap`() { + @Test(timeout=300_000) + fun `Kotlin EmptyMap registers as Java emptyMap`() { val javaEmptyMapClass = Collections.emptyMap().javaClass val kryo = rigorousMock() val resolver = CordaClassResolver(allButBlacklistedContext).apply { setKryo(kryo) } @@ -321,8 +321,8 @@ class CordaClassResolverTests { open class SubHashSet : HashSet() - @Test - fun `Check blacklisted subclass`() { + @Test(timeout=300_000) + fun `Check blacklisted subclass`() { expectedEx.expect(IllegalStateException::class.java) expectedEx.expectMessage("The superclass java.util.HashSet of net.corda.serialization.internal.CordaClassResolverTests\$SubHashSet is blacklisted, so it cannot be used in serialization.") val resolver = CordaClassResolver(allButBlacklistedContext) @@ -332,8 +332,8 @@ class CordaClassResolverTests { class SubSubHashSet : SubHashSet() - @Test - fun `Check blacklisted subsubclass`() { + @Test(timeout=300_000) + fun `Check blacklisted subsubclass`() { expectedEx.expect(IllegalStateException::class.java) expectedEx.expectMessage("The superclass java.util.HashSet of net.corda.serialization.internal.CordaClassResolverTests\$SubSubHashSet is blacklisted, so it cannot be used in serialization.") val resolver = CordaClassResolver(allButBlacklistedContext) @@ -343,8 +343,8 @@ class CordaClassResolverTests { class ConnectionImpl(private val connection: Connection) : Connection by connection - @Test - fun `Check blacklisted interface impl`() { + @Test(timeout=300_000) + fun `Check blacklisted interface impl`() { expectedEx.expect(IllegalStateException::class.java) expectedEx.expectMessage("The superinterface java.sql.Connection of net.corda.serialization.internal.CordaClassResolverTests\$ConnectionImpl is blacklisted, so it cannot be used in serialization.") val resolver = CordaClassResolver(allButBlacklistedContext) @@ -355,8 +355,8 @@ class CordaClassResolverTests { interface SubConnection : Connection class SubConnectionImpl(private val subConnection: SubConnection) : SubConnection by subConnection - @Test - fun `Check blacklisted super-interface impl`() { + @Test(timeout=300_000) + fun `Check blacklisted super-interface impl`() { expectedEx.expect(IllegalStateException::class.java) expectedEx.expectMessage("The superinterface java.sql.Connection of net.corda.serialization.internal.CordaClassResolverTests\$SubConnectionImpl is blacklisted, so it cannot be used in serialization.") val resolver = CordaClassResolver(allButBlacklistedContext) @@ -364,8 +364,8 @@ class CordaClassResolverTests { resolver.getRegistration(SubConnectionImpl::class.java) } - @Test - fun `Check forcibly allowed`() { + @Test(timeout=300_000) + fun `Check forcibly allowed`() { val resolver = CordaClassResolver(allButBlacklistedContext) // LinkedHashSet is allowed for serialization. resolver.getRegistration(LinkedHashSet::class.java) @@ -374,8 +374,8 @@ class CordaClassResolverTests { @CordaSerializable class CordaSerializableHashSet : HashSet() - @Test - fun `Check blacklist precedes CordaSerializable`() { + @Test(timeout=300_000) + fun `Check blacklist precedes CordaSerializable`() { expectedEx.expect(IllegalStateException::class.java) expectedEx.expectMessage("The superclass java.util.HashSet of net.corda.serialization.internal.CordaClassResolverTests\$CordaSerializableHashSet is blacklisted, so it cannot be used in serialization.") val resolver = CordaClassResolver(allButBlacklistedContext) diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt index 55c0254095..4dc26f1cb7 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt @@ -37,15 +37,15 @@ class ListsSerializationTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `check list can be serialized as root of serialization graph`() { + @Test(timeout=300_000) + fun `check list can be serialized as root of serialization graph`() { assertEqualAfterRoundTripSerialization(emptyList()) assertEqualAfterRoundTripSerialization(listOf(1)) assertEqualAfterRoundTripSerialization(listOf(1, 2)) } - @Test - fun `check list can be serialized as part of SessionData`() { + @Test(timeout=300_000) + fun `check list can be serialized as part of SessionData`() { run { val sessionData = DataSessionMessage(listOf(1).serialize()) assertEqualAfterRoundTripSerialization(sessionData) @@ -63,8 +63,8 @@ class ListsSerializationTest { } } - @Test - fun `check empty list serialises as Java emptyList`() = kryoSpecific("Kryo specific test") { + @Test(timeout=300_000) + fun `check empty list serialises as Java emptyList`() = kryoSpecific("Kryo specific test") { val nameID = 0 val serializedForm = emptyList().serialize() val output = ByteArrayOutputStream().apply { @@ -81,8 +81,8 @@ class ListsSerializationTest { @CordaSerializable data class WrongPayloadType(val payload: ArrayList) - @Test - fun `check throws for forbidden declared type`() = amqpSpecific("Such exceptions are not expected in Kryo mode.") { + @Test(timeout=300_000) + fun `check throws for forbidden declared type`() = amqpSpecific("Such exceptions are not expected in Kryo mode.") { val payload = ArrayList() payload.add(1) payload.add(2) @@ -99,8 +99,8 @@ class ListsSerializationTest { @CordaSerializable data class CovariantContainer(val payload: List) - @Test - fun `check covariance`() { + @Test(timeout=300_000) + fun `check covariance`() { val payload = ArrayList() payload.add(Child(1)) payload.add(Child(2)) diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt index e96a1e0c31..5e5ee8a606 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt @@ -29,18 +29,18 @@ class MapsSerializationTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `check EmptyMap serialization`() = amqpSpecific("kotlin.collections.EmptyMap is not enabled for Kryo serialization") { + @Test(timeout=300_000) + fun `check EmptyMap serialization`() = amqpSpecific("kotlin.collections.EmptyMap is not enabled for Kryo serialization") { assertEqualAfterRoundTripSerialization(emptyMap()) } - @Test - fun `check Map can be root of serialization graph`() { + @Test(timeout=300_000) + fun `check Map can be root of serialization graph`() { assertEqualAfterRoundTripSerialization(smallMap) } - @Test - fun `check list can be serialized as part of SessionData`() { + @Test(timeout=300_000) + fun `check list can be serialized as part of SessionData`() { val sessionData = DataSessionMessage(smallMap.serialize()) assertEqualAfterRoundTripSerialization(sessionData) assertEquals(smallMap, sessionData.payload.deserialize()) @@ -49,8 +49,8 @@ class MapsSerializationTest { @CordaSerializable data class WrongPayloadType(val payload: HashMap) - @Test - fun `check throws for forbidden declared type`() = amqpSpecific("Such exceptions are not expected in Kryo mode.") { + @Test(timeout=300_000) + fun `check throws for forbidden declared type`() = amqpSpecific("Such exceptions are not expected in Kryo mode.") { val payload = HashMap(smallMap) val wrongPayloadType = WrongPayloadType(payload) assertThatThrownBy { wrongPayloadType.serialize() } @@ -64,16 +64,16 @@ class MapsSerializationTest { @CordaSerializable data class MyValue(val valueContent: CordaX500Name) - @Test - fun `check map serialization works with custom types`() { + @Test(timeout=300_000) + fun `check map serialization works with custom types`() { val myMap = mapOf( MyKey(1.0) to MyValue(CordaX500Name("OOO", "LLL", "CC")), MyKey(10.0) to MyValue(CordaX500Name("OO", "LL", "CC"))) assertEqualAfterRoundTripSerialization(myMap) } - @Test - fun `check empty map serialises as Java emptyMap`() { + @Test(timeout=300_000) + fun `check empty map serialises as Java emptyMap`() { kryoSpecific("Specifically checks Kryo serialization") { val nameID = 0 val serializedForm = emptyMap().serialize() diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/PrivateKeySerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/PrivateKeySerializationTest.kt index bdd5b672ef..31812104a4 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/PrivateKeySerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/PrivateKeySerializationTest.kt @@ -32,14 +32,14 @@ class PrivateKeySerializationTest(private val privateKey: PrivateKey, private va @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `passed with expected UseCases`() { + @Test(timeout=300_000) + fun `passed with expected UseCases`() { assertTrue { privateKey.serialize(context = SerializationDefaults.STORAGE_CONTEXT).bytes.isNotEmpty() } assertTrue { privateKey.checkpointSerialize(context = CheckpointSerializationDefaults.CHECKPOINT_CONTEXT).bytes.isNotEmpty() } } - @Test - fun `failed with wrong UseCase`() { + @Test(timeout=300_000) + fun `failed with wrong UseCase`() { assertThatThrownBy { privateKey.serialize(context = SerializationDefaults.P2P_CONTEXT) } .isInstanceOf(IllegalStateException::class.java) .hasMessageContaining("UseCase '$P2P' is not 'Storage") diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt index 49e5d1f2ed..1533d3d6a4 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt @@ -46,8 +46,8 @@ class SerializationTokenTest { } private fun serializeAsTokenContext(toBeTokenized: Any) = CheckpointSerializeAsTokenContextImpl(toBeTokenized, testCheckpointSerialization.checkpointSerializer, context, rigorousMock()) - @Test - fun `write token and read tokenizable`() { + @Test(timeout=300_000) + fun `write token and read tokenizable`() { val tokenizableBefore = LargeTokenizable() val context = serializeAsTokenContext(tokenizableBefore) val testContext = this.context.withTokenContext(context) @@ -60,8 +60,8 @@ class SerializationTokenTest { private class UnitSerializeAsToken : SingletonSerializeAsToken() - @Test - fun `write and read singleton`() { + @Test(timeout=300_000) + fun `write and read singleton`() { val tokenizableBefore = UnitSerializeAsToken() val context = serializeAsTokenContext(tokenizableBefore) val testContext = this.context.withTokenContext(context) diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt index daa9cbe1ce..b0f9bac9d9 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt @@ -25,15 +25,15 @@ class SetsSerializationTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun `check set can be serialized as root of serialization graph`() { + @Test(timeout=300_000) + fun `check set can be serialized as root of serialization graph`() { assertEqualAfterRoundTripSerialization(emptySet()) assertEqualAfterRoundTripSerialization(setOf(1)) assertEqualAfterRoundTripSerialization(setOf(1, 2)) } - @Test - fun `check set can be serialized as part of DataSessionMessage`() { + @Test(timeout=300_000) + fun `check set can be serialized as part of DataSessionMessage`() { run { val sessionData = DataSessionMessage(setOf(1).serialize()) assertEqualAfterRoundTripSerialization(sessionData) @@ -51,8 +51,8 @@ class SetsSerializationTest { } } - @Test - fun `check empty set serialises as Java emptySet`() = kryoSpecific("Checks Kryo header properties") { + @Test(timeout=300_000) + fun `check empty set serialises as Java emptySet`() = kryoSpecific("Checks Kryo header properties") { val nameID = 0 val serializedForm = emptySet().serialize() val output = ByteArrayOutputStream().apply { @@ -83,8 +83,8 @@ class SetsSerializationTest { We now check only for compatibility of the erased classes, so the call to propertyDescriptors() below should now succeed, returning the property descriptor for "p". */ - @Test - fun `type variance on setter getter pair does not fail validation`() { + @Test(timeout=300_000) + fun `type variance on setter getter pair does not fail validation`() { assertThat(VarOfP::class.java.accessPropertyDescriptors()).containsKey("p") } diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPRemoteTypeModelTests.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPRemoteTypeModelTests.kt index 3e27e166a6..2b6617d555 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPRemoteTypeModelTests.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPRemoteTypeModelTests.kt @@ -40,8 +40,8 @@ class AMQPRemoteTypeModelTests { class SimpleClass(val a: Int, val b: Double, val c: Short?, val d: ByteArray, val e: ByteArray?) - @Test - fun `round-trip some types through AMQP serialisations`() { + @Test(timeout=300_000) + fun `round-trip some types through AMQP serialisations`() { arrayOf("").assertRemoteType("String[]") listOf(1).assertRemoteType("List") arrayOf(listOf(1)).assertRemoteType("List[]") diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt index c2c38d5ea8..79438f3b60 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt @@ -22,8 +22,8 @@ class AbstractAMQPSerializationSchemeTest { private val serializationEnvironment = createTestSerializationEnv() - @Test - fun `number of cached factories must be bounded by maxFactories`() { + @Test(timeout=300_000) + fun `number of cached factories must be bounded by maxFactories`() { val genesisContext = SerializationContextImpl( ByteSequence.of(byteArrayOf('c'.toByte(), 'o'.toByte(), 'r'.toByte(), 'd'.toByte(), 'a'.toByte(), 0.toByte(), 0.toByte(), 1.toByte())), ClassLoader.getSystemClassLoader(), diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/CustomSerializerRegistryTests.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/CustomSerializerRegistryTests.kt index d1df8a73f8..5b62e41bd2 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/CustomSerializerRegistryTests.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/CustomSerializerRegistryTests.kt @@ -37,8 +37,8 @@ class CustomSerializerRegistryTests { } } - @Test - fun `a custom serializer cannot register to serialize a type already annotated with CordaSerializable`() { + @Test(timeout=300_000) + fun `a custom serializer cannot register to serialize a type already annotated with CordaSerializable`() { val serializerForEverything = TestCustomSerializer("a") { true } unit.register(serializerForEverything) @@ -55,8 +55,8 @@ class CustomSerializerRegistryTests { } } - @Test - fun `exception types can have custom serializers`() { + @Test(timeout=300_000) + fun `exception types can have custom serializers`() { @CordaSerializable class MyCustomException : CordaException("Custom exception annotated with @CordaSerializable") @@ -68,8 +68,8 @@ class CustomSerializerRegistryTests { unit.find(MyCustomException::class.java)) } - @Test - fun `two custom serializers cannot register to serialize the same type`() { + @Test(timeout=300_000) + fun `two custom serializers cannot register to serialize the same type`() { val weSerializeCash = TestCustomSerializer("a") { type -> type == Cash::class.java } val weMaliciouslySerializeCash = TestCustomSerializer("b") { type -> type == Cash::class.java } @@ -83,8 +83,8 @@ class CustomSerializerRegistryTests { } } - @Test - fun `primitive types cannot have custom serializers`() { + @Test(timeout=300_000) + fun `primitive types cannot have custom serializers`() { unit.register(TestCustomSerializer("a") { type -> type == Float::class.java }) assertFailsWith { diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt index 901fcccf88..c37ebc6e1b 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt @@ -44,8 +44,8 @@ class DeserializeQueryableStateTest { /** * https://r3-cev.atlassian.net/browse/CORDA-2330 */ - @Test - fun `should deserialize subclass of QueryableState that is not present in the class loader`() { + @Test(timeout=300_000) + fun `should deserialize subclass of QueryableState that is not present in the class loader`() { val testParty = TestIdentity(DUMMY_BANK_A_NAME).identity.party val instance = TestState(listOf(testParty)) diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt index ef50cea6a5..d13502075f 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt @@ -255,8 +255,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi return desObj } - @Test - fun isPrimitive() { + @Test(timeout=300_000) + fun isPrimitive() { assertTrue(AMQPTypeIdentifiers.isPrimitive(Character::class.java)) assertTrue(AMQPTypeIdentifiers.isPrimitive(Boolean::class.java)) assertTrue(AMQPTypeIdentifiers.isPrimitive(Byte::class.java)) @@ -280,44 +280,44 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertTrue(AMQPTypeIdentifiers.isPrimitive(Symbol::class.java)) } - @Test - fun `test foo`() { + @Test(timeout=300_000) + fun `test foo`() { val obj = Foo("Hello World!", 123) serdes(obj) } - @Test - fun `test float`() { + @Test(timeout=300_000) + fun `test float`() { val obj = testFloat(10.0F) serdes(obj) } - @Test - fun `test double`() { + @Test(timeout=300_000) + fun `test double`() { val obj = testDouble(10.0) serdes(obj) } - @Test - fun `test short`() { + @Test(timeout=300_000) + fun `test short`() { val obj = testShort(1) serdes(obj) } - @Test - fun `test bool`() { + @Test(timeout=300_000) + fun `test bool`() { val obj = testBoolean(true) serdes(obj) } - @Test - fun `test foo implements`() { + @Test(timeout=300_000) + fun `test foo implements`() { val obj = FooImplements("Hello World!", 123) serdes(obj) } - @Test - fun `test foo implements and list`() { + @Test(timeout=300_000) + fun `test foo implements and list`() { val obj = FooImplementsAndList("Hello World!", 123, listOf("Fred", "Ginger")) serdes(obj) } @@ -328,38 +328,38 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj) } - @Test - fun `test string array`() { + @Test(timeout=300_000) + fun `test string array`() { val obj = arrayOf("Fred", "Ginger") serdes(obj) } - @Test - fun `test foo array`() { + @Test(timeout=300_000) + fun `test foo array`() { val obj = arrayOf(Foo("Fred", 1), Foo("Ginger", 2)) serdes(obj) } - @Test - fun `test top level list array`() { + @Test(timeout=300_000) + fun `test top level list array`() { val obj = arrayOf(listOf("Fred", "Ginger"), listOf("Rogers", "Hammerstein")) serdes(obj) } - @Test - fun `test foo list array`() { + @Test(timeout=300_000) + fun `test foo list array`() { val obj = WrapFooListArray(arrayOf(listOf(Foo("Fred", 1), Foo("Ginger", 2)), listOf(Foo("Rogers", 3), Foo("Hammerstein", 4)))) serdes(obj) } - @Test - fun `test not all properties in constructor`() { + @Test(timeout=300_000) + fun `test not all properties in constructor`() { val obj = Woo(2) serdes(obj) } - @Test - fun `test annotated constructor`() { + @Test(timeout=300_000) + fun `test annotated constructor`() { val obj = Woo2(3) serdes(obj) } @@ -372,8 +372,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi )) } - @Test - fun `test annotation whitelisting`() { + @Test(timeout=300_000) + fun `test annotation whitelisting`() { val obj = AnnotatedWoo(5) serdes(obj, SerializerFactoryBuilder.build(EmptyWhitelist, ClassCarpenterImpl(EmptyWhitelist, ClassLoader.getSystemClassLoader()) @@ -386,73 +386,73 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj) } - @Test - fun `test generic foo`() { + @Test(timeout=300_000) + fun `test generic foo`() { val obj = GenericFoo("Fred", "Ginger") serdes(obj) } - @Test - fun `test generic foo as property`() { + @Test(timeout=300_000) + fun `test generic foo as property`() { val obj = ContainsGenericFoo(GenericFoo("Fred", "Ginger")) serdes(obj) } - @Test - fun `test nested generic foo as property`() { + @Test(timeout=300_000) + fun `test nested generic foo as property`() { val obj = ContainsNestedGenericFoo(NestedGenericFoo(GenericFoo("Fred", "Ginger"))) serdes(obj) } // TODO: Generic interfaces / superclasses - @Test - fun `test extends generic`() { + @Test(timeout=300_000) + fun `test extends generic`() { val obj = ExtendsGeneric(1, "Ginger") serdes(obj) } - @Test - fun `test implements generic`() { + @Test(timeout=300_000) + fun `test implements generic`() { val obj = ImplementsGenericString(1, "Ginger") serdes(obj) } - @Test - fun `test implements generic captured`() { + @Test(timeout=300_000) + fun `test implements generic captured`() { val obj = CapturesGenericX(ImplementsGenericX(1, "Ginger")) serdes(obj) } - @Test - fun `test inherits generic captured`() { + @Test(timeout=300_000) + fun `test inherits generic captured`() { val obj = CapturesGenericX(InheritGenericX(1.0, "Ginger")) serdes(obj) } - @Test - fun `test TreeMap`() { + @Test(timeout=300_000) + fun `test TreeMap`() { val obj = TreeMap() obj[456] = Foo("Fred", 123) serdes(obj) } - @Test - fun `test TreeMap property`() { + @Test(timeout=300_000) + fun `test TreeMap property`() { val obj = TreeMapWrapper(TreeMap()) obj.tree[456] = Foo("Fred", 123) serdes(obj) } - @Test - fun `test NavigableMap property`() { + @Test(timeout=300_000) + fun `test NavigableMap property`() { val obj = NavigableMapWrapper(TreeMap()) obj.tree[456] = Foo("Fred", 123) serdes(obj) } - @Test - fun `test SortedSet property`() { + @Test(timeout=300_000) + fun `test SortedSet property`() { val obj = SortedSetWrapper(TreeSet()) obj.set += 456 serdes(obj) @@ -470,8 +470,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj) } - @Test - fun `class constructor is invoked on deserialisation`() { + @Test(timeout=300_000) + fun `class constructor is invoked on deserialisation`() { compression == null || return // Manipulation of serialized bytes is invalid if they're compressed. val serializerFactory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) @@ -499,8 +499,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi }.withStackTraceContaining("Zero not allowed") } - @Test - fun `test custom serializers on public key`() { + @Test(timeout=300_000) + fun `test custom serializers on public key`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -513,24 +513,24 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test annotation is inherited`() { + @Test(timeout=300_000) + fun `test annotation is inherited`() { val obj = InheritAnnotation("blah") serdes(obj, SerializerFactoryBuilder.build(EmptyWhitelist, ClassCarpenterImpl(EmptyWhitelist, ClassLoader.getSystemClassLoader()) )) } - @Test - fun `generics from java are supported`() { + @Test(timeout=300_000) + fun `generics from java are supported`() { val obj = DummyOptional("YES") serdes(obj, SerializerFactoryBuilder.build(EmptyWhitelist, ClassCarpenterImpl(EmptyWhitelist, ClassLoader.getSystemClassLoader()) )) } - @Test - fun `test throwables serialize`() { + @Test(timeout=300_000) + fun `test throwables serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -552,8 +552,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi return SerializationFactory.defaultFactory.asCurrent { withCurrentContext(newContext) { serdes(t, factory, factory2, expectedEqual) } } } - @Test - fun `test complex throwables serialize`() { + @Test(timeout=300_000) + fun `test complex throwables serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -586,8 +586,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi } } - @Test - fun `test suppressed throwables serialize`() { + @Test(timeout=300_000) + fun `test suppressed throwables serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -612,8 +612,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi } } - @Test - fun `test flow corda exception subclasses serialize`() { + @Test(timeout=300_000) + fun `test flow corda exception subclasses serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -628,8 +628,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdesThrowableWithInternalInfo(obj, factory, factory2) } - @Test - fun `test RPC corda exception subclasses serialize`() { + @Test(timeout=300_000) + fun `test RPC corda exception subclasses serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -644,20 +644,20 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdesThrowableWithInternalInfo(obj, factory, factory2) } - @Test - fun `test polymorphic property`() { + @Test(timeout=300_000) + fun `test polymorphic property`() { val obj = PolymorphicProperty(FooImplements("Ginger", 12)) serdes(obj) } - @Test - fun `test null polymorphic property`() { + @Test(timeout=300_000) + fun `test null polymorphic property`() { val obj = PolymorphicProperty(null) serdes(obj) } - @Test - fun `test kotlin object`() { + @Test(timeout=300_000) + fun `test kotlin object`() { serdes(KotlinObject) } @@ -666,13 +666,13 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi } } - @Test - fun `test custom object`() { + @Test(timeout=300_000) + fun `test custom object`() { serdes(FooContract) } - @Test - @Ignore("Cannot serialize due to known Kotlin/serialization limitation") + @Test(timeout=300_000) +@Ignore("Cannot serialize due to known Kotlin/serialization limitation") fun `test custom anonymous object`() { val anonymous: Contract = object : Contract { override fun verify(tx: LedgerTransaction) { @@ -687,8 +687,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi override val participants: List = emptyList() } - @Test - fun `test transaction state`() { + @Test(timeout=300_000) + fun `test transaction state`() { val state = TransactionState(FooState(), FOO_PROGRAM_ID, MEGA_CORP) val scheme = AMQPServerSerializationScheme(emptyList()) @@ -714,8 +714,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertTrue(desState.encumbrance == state.encumbrance) } - @Test - fun `test currencies serialize`() { + @Test(timeout=300_000) + fun `test currencies serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -730,8 +730,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test big decimals serialize`() { + @Test(timeout=300_000) + fun `test big decimals serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -746,8 +746,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test instants serialize`() { + @Test(timeout=300_000) + fun `test instants serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -762,8 +762,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test durations serialize`() { + @Test(timeout=300_000) + fun `test durations serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -778,8 +778,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test local date serialize`() { + @Test(timeout=300_000) + fun `test local date serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -794,8 +794,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test local time serialize`() { + @Test(timeout=300_000) + fun `test local time serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -810,8 +810,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test local date time serialize`() { + @Test(timeout=300_000) + fun `test local date time serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -826,8 +826,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test zoned date time serialize`() { + @Test(timeout=300_000) + fun `test zoned date time serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -842,8 +842,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test offset time serialize`() { + @Test(timeout=300_000) + fun `test offset time serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -858,8 +858,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test offset date time serialize`() { + @Test(timeout=300_000) + fun `test offset date time serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -874,8 +874,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test year serialize`() { + @Test(timeout=300_000) + fun `test year serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -890,8 +890,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test year month serialize`() { + @Test(timeout=300_000) + fun `test year month serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -906,8 +906,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test month day serialize`() { + @Test(timeout=300_000) + fun `test month day serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -922,8 +922,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test period serialize`() { + @Test(timeout=300_000) + fun `test period serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -938,26 +938,26 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test month serialize`() { + @Test(timeout=300_000) + fun `test month serialize`() { val obj = Month.APRIL serdes(obj) } - @Test - fun `test day of week serialize`() { + @Test(timeout=300_000) + fun `test day of week serialize`() { val obj = DayOfWeek.FRIDAY serdes(obj) } - @Test - fun `test privacy salt serialize`() { + @Test(timeout=300_000) + fun `test privacy salt serialize`() { serdes(PrivacySalt()) serdes(PrivacySalt(secureRandomBytes(32))) } - @Test - fun `test X509 certificate serialize`() { + @Test(timeout=300_000) + fun `test X509 certificate serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -972,8 +972,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test cert path serialize`() { + @Test(timeout=300_000) + fun `test cert path serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -997,14 +997,14 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi override fun hashCode(): Int = javaClass.hashCode() } - @Test - fun `test generic in constructor serialize`() { + @Test(timeout=300_000) + fun `test generic in constructor serialize`() { val obj = GenericSubclass(OtherGeneric()) serdes(obj) } - @Test - fun `test StateRef serialize`() { + @Test(timeout=300_000) + fun `test StateRef serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1023,8 +1023,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi data class ParentContainer(val left: SimpleContainer, val right: Container) - @Test - fun `test object referenced multiple times`() { + @Test(timeout=300_000) + fun `test object referenced multiple times`() { val simple = SimpleContainer("Fred", "Ginger") val parentContainer = ParentContainer(simple, simple) assertSame(parentContainer.left, parentContainer.right) @@ -1035,8 +1035,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi data class TestNode(val content: String, val children: MutableCollection = ArrayList()) - @Test - @Ignore("Ignored due to cyclic graphs not currently supported by AMQP serialization") + @Test(timeout=300_000) +@Ignore("Ignored due to cyclic graphs not currently supported by AMQP serialization") fun `test serialization of cyclic graph`() { val nodeA = TestNode("A") val nodeB = TestNode("B", ArrayList(Arrays.asList(nodeA))) @@ -1051,8 +1051,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi data class Bob(val byteArrays: List) - @Test - fun `test list of byte arrays`() { + @Test(timeout=300_000) + fun `test list of byte arrays`() { val a = ByteArray(1) val b = ByteArray(2) val obj = Bob(listOf(a, b, a)) @@ -1070,8 +1070,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi data class Vic(val a: List, val b: List) - @Test - fun `test generics ignored from graph logic`() { + @Test(timeout=300_000) + fun `test generics ignored from graph logic`() { val a = listOf("a", "b") val obj = Vic(a, a) @@ -1092,8 +1092,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi override fun hashCode(): Int = a.hashCode() } - @Test - fun `test private constructor`() { + @Test(timeout=300_000) + fun `test private constructor`() { val obj = Spike() val factory = SerializerFactoryBuilder.build(AllWhitelist, @@ -1107,8 +1107,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi data class BigDecimals(val a: BigDecimal, val b: BigDecimal) - @Test - fun `test toString custom serializer`() { + @Test(timeout=300_000) + fun `test toString custom serializer`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1126,8 +1126,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi data class BigIntegers(val a: BigInteger, val b: BigInteger) - @Test - fun `test BigInteger custom serializer`() { + @Test(timeout=300_000) + fun `test BigInteger custom serializer`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1150,8 +1150,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi return JcaX509CRLConverter().setProvider(provider).getCRL(crlHolder) } - @Test - fun `test X509CRL custom serializer`() { + @Test(timeout=300_000) + fun `test X509CRL custom serializer`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1168,8 +1168,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi class ByteArrays(val a: ByteArray, val b: ByteArray) - @Test - fun `test byte arrays not reference counted`() { + @Test(timeout=300_000) + fun `test byte arrays not reference counted`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1186,8 +1186,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertNotSame(objCopy.a, objCopy.b) } - @Test - fun `test StringBuffer serialize`() { + @Test(timeout=300_000) + fun `test StringBuffer serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1203,8 +1203,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertEquals(obj.toString(), obj2.toString()) } - @Test - fun `test SimpleString serialize`() { + @Test(timeout=300_000) + fun `test SimpleString serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1219,20 +1219,20 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test kotlin Unit serialize`() { + @Test(timeout=300_000) + fun `test kotlin Unit serialize`() { val obj = Unit serdes(obj) } - @Test - fun `test kotlin Pair serialize`() { + @Test(timeout=300_000) + fun `test kotlin Pair serialize`() { val obj = Pair("a", 3) serdes(obj) } - @Test - fun `test InputStream serialize`() { + @Test(timeout=300_000) + fun `test InputStream serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1250,8 +1250,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertEquals(obj3.read(), obj2.read()) } - @Test - fun `test EnumSet serialize`() { + @Test(timeout=300_000) + fun `test EnumSet serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1266,8 +1266,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test BitSet serialize`() { + @Test(timeout=300_000) + fun `test BitSet serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1282,16 +1282,16 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi serdes(obj, factory, factory2) } - @Test - fun `test EnumMap serialize`() { + @Test(timeout=300_000) + fun `test EnumMap serialize`() { val obj = EnumMap(Month::class.java) obj[Month.APRIL] = Month.APRIL.value obj[Month.AUGUST] = Month.AUGUST.value serdes(obj) } - @Test - fun `test contract attachment serialize`() { + @Test(timeout=300_000) + fun `test contract attachment serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1310,8 +1310,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertArrayEquals(obj.open().readBytes(), obj2.open().readBytes()) } - @Test - fun `test contract attachment throws if missing attachment`() { + @Test(timeout=300_000) + fun `test contract attachment throws if missing attachment`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -1347,8 +1347,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi // properties, just taking the first one it found with with the most applicable type, and the reflection // ordering of the methods was random, thus occasionally we select the wrong one // - @Test - fun reproduceWrongNumberOfArguments() { + @Test(timeout=300_000) + fun reproduceWrongNumberOfArguments() { data class C(val a: Amount) val factory = testDefaultFactoryNoEvolution() @@ -1361,8 +1361,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi SerializationOutput(factory).serialize(c, compression) } - @Test - fun `compression has the desired effect`() { + @Test(timeout=300_000) + fun `compression has the desired effect`() { compression ?: return val factory = defaultFactory() val data = ByteArray(12345).also { Random(0).nextBytes(it) }.let { it + it } @@ -1371,8 +1371,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi assertArrayEquals(data, DeserializationInput(factory).deserialize(compressed, testSerializationContext.withEncodingWhitelist(encodingWhitelist))) } - @Test - fun `a particular encoding can be banned for deserialization`() { + @Test(timeout=300_000) + fun `a particular encoding can be banned for deserialization`() { compression ?: return val factory = defaultFactory() doReturn(false).whenever(encodingWhitelist).acceptEncoding(compression) @@ -1384,20 +1384,20 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi } } - @Test - fun nestedObjects() { + @Test(timeout=300_000) + fun nestedObjects() { // The "test" is that this doesn't throw, anything else is a success AckWrapper.serialize() } - @Test - fun privateNestedObjects() { + @Test(timeout=300_000) + fun privateNestedObjects() { // The "test" is that this doesn't throw, anything else is a success PrivateAckWrapper.serialize() } - @Test - fun throwable() { + @Test(timeout=300_000) + fun throwable() { class TestException(message: String?, cause: Throwable?) : CordaException(message, cause) val testExcp = TestException("hello", Throwable().apply { stackTrace = Thread.currentThread().stackTrace }) @@ -1405,8 +1405,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi SerializationOutput(factory).serialize(testExcp) } - @Test - fun nestedInner() { + @Test(timeout=300_000) + fun nestedInner() { class C(val a: Int) { inner class D(val b: Int) @@ -1423,8 +1423,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi }.withMessageContaining("has synthetic fields and is likely a nested inner class") } - @Test - fun nestedNestedInner() { + @Test(timeout=300_000) + fun nestedNestedInner() { class C(val a: Int) { inner class D(val b: Int) { inner class E(val c: Int) @@ -1456,8 +1456,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi }.withMessageContaining("has synthetic fields and is likely a nested inner class") } - @Test - fun multiNestedInner() { + @Test(timeout=300_000) + fun multiNestedInner() { class C(val a: Int) { inner class D(val b: Int) inner class E(val c: Int) @@ -1488,8 +1488,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi val v: V } - @Test - fun dataClassBy() { + @Test(timeout=300_000) + fun dataClassBy() { data class C(val s: String) : DataClassByInterface { override val v: String = "-- $s" } @@ -1509,8 +1509,8 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi } } - @Test - fun `compression reduces number of bytes significantly`() { + @Test(timeout=300_000) + fun `compression reduces number of bytes significantly`() { val ser = SerializationOutput(SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) )) diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/carpenter/SerDeserCarpentryTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/carpenter/SerDeserCarpentryTest.kt index fe4c06dfb9..b5f9c7b6ed 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/carpenter/SerDeserCarpentryTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/carpenter/SerDeserCarpentryTest.kt @@ -15,8 +15,8 @@ class SerDeserCarpentryTest { @JvmField val testSerialization = SerializationEnvironmentRule() - @Test - fun implementingGenericInterface() { + @Test(timeout=300_000) + fun implementingGenericInterface() { // Original class that was serialised // data class GenericData(val a: Int) : GenericInterface // writeTestResource(GenericData(123).serialize()) @@ -25,8 +25,8 @@ class SerDeserCarpentryTest { assertThat(data.javaClass.getMethod("getA").invoke(data)).isEqualTo(123) } - @Test - fun lenientCarpenter() { + @Test(timeout=300_000) + fun lenientCarpenter() { // Original class that was serialised // data class Data(val b: Int) : AInterface { // override val a: Int get() = b diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/SerializationCompatibilityTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/SerializationCompatibilityTests.kt index af4fbeebaa..f27d877774 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/SerializationCompatibilityTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/SerializationCompatibilityTests.kt @@ -6,8 +6,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.Test class SerializationCompatibilityTests { - @Test - fun `fingerprint is stable`() { + @Test(timeout=300_000) + fun `fingerprint is stable`() { val factory = testDefaultFactoryNoEvolution().apply { register(ThrowableSerializer(this)) } assertThat(factory.get(Exception::class.java).typeDescriptor.toString()).isEqualTo("net.corda:ApZ2a/36VVskaoDZMbiZ8A==") } diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPExceptionsTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPExceptionsTests.kt index e39c558a33..549c2c455c 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPExceptionsTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPExceptionsTests.kt @@ -66,8 +66,8 @@ class AMQPExceptionsTests { // if the exception is a normal not serializable exception we'll have manipulated the // message - @Test - fun catchNotSerializable() { + @Test(timeout=300_000) + fun catchNotSerializable() { fun catchAssert(msg: String, f: () -> Unit) { Assertions.assertThatThrownBy { f() } .isInstanceOf(NotSerializableException::class.java) @@ -93,8 +93,8 @@ class AMQPExceptionsTests { // However, if its a shiny new AMQPNotSerializable one, we have cool new toys, so // lets make sure those are set - @Test - fun catchAMQPNotSerializable() { + @Test(timeout=300_000) + fun catchAMQPNotSerializable() { fun catchAssert(stack: List, f: () -> Unit): AMQPNotSerializableException { try { f() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPTypeIdentifierParserTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPTypeIdentifierParserTests.kt index 52f4005131..b4bdbad2e1 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPTypeIdentifierParserTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/AMQPTypeIdentifierParserTests.kt @@ -14,8 +14,8 @@ import net.corda.serialization.internal.MAX_TYPE_PARAM_DEPTH class AMQPTypeIdentifierParserTests { - @Test - fun `primitives and arrays`() { + @Test(timeout=300_000) + fun `primitives and arrays`() { assertParseResult("int") assertParseResult("int[p]") assertParseResult>("int[]") @@ -34,8 +34,8 @@ class AMQPTypeIdentifierParserTests { } } - @Test - fun `unparameterised types`() { + @Test(timeout=300_000) + fun `unparameterised types`() { assertParseResult("java.time.LocalDateTime") assertParseResult>("java.time.LocalDateTime[]") assertParseResult>>("java.time.LocalDateTime[][]") @@ -50,8 +50,8 @@ class AMQPTypeIdentifierParserTests { val q: WithParameter> } - @Test - fun `parameterised types, nested, with arrays`() { + @Test(timeout=300_000) + fun `parameterised types, nested, with arrays`() { assertParsesTo>, UUID>>>>>( "WithParameters[]>>" ) @@ -62,8 +62,8 @@ class AMQPTypeIdentifierParserTests { } } - @Test - fun `compatibility test`() { + @Test(timeout=300_000) + fun `compatibility test`() { assertParsesCompatibly() assertParsesCompatibly() assertParsesCompatibly>() @@ -75,28 +75,28 @@ class AMQPTypeIdentifierParserTests { } // Old tests for DeserializedParameterizedType - @Test - fun `test nested`() { + @Test(timeout=300_000) + fun `test nested`() { verify(" java.util.Map < java.util.Map< java.lang.String, java.lang.Integer >, java.util.Map < java.lang.Long , java.lang.String > >") } - @Test - fun `test simple`() { + @Test(timeout=300_000) + fun `test simple`() { verify("java.util.List") } - @Test - fun `test multiple args`() { + @Test(timeout=300_000) + fun `test multiple args`() { verify("java.util.Map") } - @Test - fun `test trailing whitespace`() { + @Test(timeout=300_000) + fun `test trailing whitespace`() { verify("java.util.Map ") } - @Test - fun `test list of commands`() { + @Test(timeout=300_000) + fun `test list of commands`() { verify("java.util.List>>") } @@ -145,8 +145,8 @@ class AMQPTypeIdentifierParserTests { verify("java.util.List") } - @Test - fun `test no parameters`() { + @Test(timeout=300_000) + fun `test no parameters`() { verify("java.lang.String") } diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/CorDappSerializerTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/CorDappSerializerTests.kt index d8c263d113..79df331e0e 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/CorDappSerializerTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/CorDappSerializerTests.kt @@ -46,8 +46,8 @@ class CorDappSerializerTests { } } - @Test - fun `type uses proxy`() { + @Test(timeout=300_000) + fun `type uses proxy`() { val internalProxyFactory = testDefaultFactory() val proxyFactory = testDefaultFactory() val defaultFactory = testDefaultFactory() @@ -72,8 +72,8 @@ class CorDappSerializerTests { assertEquals(msg, objFromProxy.obj.a) } - @Test - fun proxiedTypeIsNested() { + @Test(timeout=300_000) + fun proxiedTypeIsNested() { data class A(val a: Int, val b: NeedsProxy) val factory = testDefaultFactory() @@ -89,8 +89,8 @@ class CorDappSerializerTests { assertEquals(tv2, objFromDefault.obj.b.a) } - @Test - fun testWithWhitelistNotAllowed() { + @Test(timeout=300_000) + fun testWithWhitelistNotAllowed() { data class A(val a: Int, val b: NeedsProxy) class WL : ClassWhitelist { @@ -112,8 +112,8 @@ class CorDappSerializerTests { }.isInstanceOf(NotSerializableException::class.java) } - @Test - fun testWithWhitelistAllowed() { + @Test(timeout=300_000) + fun testWithWhitelistAllowed() { data class A(val a: Int, val b: NeedsProxy) class WL : ClassWhitelist { @@ -141,8 +141,8 @@ class CorDappSerializerTests { // The custom type not being whitelisted won't matter here because the act of adding a // custom serializer bypasses the whitelist - @Test - fun testWithWhitelistAllowedOuterOnly() { + @Test(timeout=300_000) + fun testWithWhitelistAllowedOuterOnly() { data class A(val a: Int, val b: NeedsProxy) class WL : ClassWhitelist { @@ -178,8 +178,8 @@ class CorDappSerializerTests { } // Tests CORDA-1747 - @Test - fun proxiedGeneric() { + @Test(timeout=300_000) + fun proxiedGeneric() { val proxyFactory = proxyFactory(listOf(NeedsProxyGenProxySerializer())) val msg = "help" @@ -227,8 +227,8 @@ class CorDappSerializerTests { } // Tests CORDA-1747 - Finally the actual bound generics test, on failure it will throw - @Test - fun proxiedBoundedGeneric() { + @Test(timeout=300_000) + fun proxiedBoundedGeneric() { val proxyFactory = proxyFactory(listOf(NeedsProxyGenBoundedProxySerializer(), HasWibbleProxy())) val blob = SerializationOutput(proxyFactory).serialize(NeedsProxyGenBounded(HasWibble("A"))) @@ -249,8 +249,8 @@ class CorDappSerializerTests { } // Tests CORDA-1747 - @Test - fun proxiedGenericContainer() { + @Test(timeout=300_000) + fun proxiedGenericContainer() { val proxyFactory = proxyFactory(listOf(NeedsProxyGenContainerProxySerializer())) val blob1 = SerializationOutput(proxyFactory).serialize(NeedsProxyGenContainer(listOf(1, 2, 3))) @@ -289,8 +289,8 @@ class CorDappSerializerTests { } // Tests CORDA-1747 - @Test - fun proxiedInheritableGenerics() { + @Test(timeout=300_000) + fun proxiedInheritableGenerics() { val proxyFactory = proxyFactory(listOf(BaseProxy(), DerivedProxy())) val blob1 = SerializationOutput(proxyFactory).serialize(Base(100L)) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeAndReturnEnvelopeTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeAndReturnEnvelopeTests.kt index e14aede81e..a9c7969e97 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeAndReturnEnvelopeTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeAndReturnEnvelopeTests.kt @@ -18,8 +18,8 @@ class DeserializeAndReturnEnvelopeTests { val factory = testDefaultFactoryNoEvolution() - @Test - fun oneType() { + @Test(timeout=300_000) + fun oneType() { data class A(val a: Int, val b: String) val a = A(10, "20") @@ -32,8 +32,8 @@ class DeserializeAndReturnEnvelopeTests { assertEquals(classTestName("A"), obj.envelope.schema.types.first().name) } - @Test - fun twoTypes() { + @Test(timeout=300_000) + fun twoTypes() { data class A(val a: Int, val b: String) data class B(val a: A, val b: Float) @@ -48,8 +48,8 @@ class DeserializeAndReturnEnvelopeTests { assertNotEquals(null, obj.envelope.schema.types.find { it.name == classTestName("B") }) } - @Test - fun unannotatedInterfaceIsNotInSchema() { + @Test(timeout=300_000) + fun unannotatedInterfaceIsNotInSchema() { @CordaSerializable data class Foo(val bar: Int) : Comparable { override fun compareTo(other: Foo): Int = bar.compareTo(other.bar) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeMapTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeMapTests.kt index 2bc81707c3..431c438de3 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeMapTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeMapTests.kt @@ -18,8 +18,8 @@ class DeserializeMapTests { private val sf = testDefaultFactoryNoEvolution() - @Test - fun mapTest() { + @Test(timeout=300_000) + fun mapTest() { data class C(val c: Map) val c = C(mapOf("A" to 1, "B" to 2)) @@ -48,8 +48,8 @@ class DeserializeMapTests { DeserializationInput(sf).deserialize(serialisedBytes) } - @Test - fun sortedMapTest() { + @Test(timeout=300_000) + fun sortedMapTest() { data class C(val c: SortedMap) val c = C(sortedMapOf("A" to 1, "B" to 2)) @@ -57,8 +57,8 @@ class DeserializeMapTests { DeserializationInput(sf).deserialize(serialisedBytes) } - @Test - fun navigableMapTest() { + @Test(timeout=300_000) + fun navigableMapTest() { data class C(val c: NavigableMap) val c = C(TreeMap(mapOf("A" to 1, "B" to 2)).descendingMap()) @@ -67,8 +67,8 @@ class DeserializeMapTests { DeserializationInput(sf).deserialize(serialisedBytes) } - @Test - fun dictionaryTest() { + @Test(timeout=300_000) + fun dictionaryTest() { data class C(val c: Dictionary) val v: Hashtable = Hashtable() @@ -81,8 +81,8 @@ class DeserializeMapTests { .isInstanceOf(IllegalArgumentException::class.java).hasMessageContaining("Unable to serialise deprecated type class java.util.Dictionary.") } - @Test - fun hashtableTest() { + @Test(timeout=300_000) + fun hashtableTest() { data class C(val c: Hashtable) val v: Hashtable = Hashtable() @@ -95,8 +95,8 @@ class DeserializeMapTests { .isInstanceOf(IllegalArgumentException::class.java).hasMessageContaining("Unable to serialise deprecated type class java.util.Hashtable. Suggested fix: prefer java.util.map implementations") } - @Test - fun hashMapTest() { + @Test(timeout=300_000) + fun hashMapTest() { data class C(val c: HashMap) val c = C(HashMap(mapOf("A" to 1, "B" to 2))) @@ -106,8 +106,8 @@ class DeserializeMapTests { .isInstanceOf(IllegalArgumentException::class.java).hasMessageContaining("Map type class java.util.HashMap is unstable under iteration. Suggested fix: use java.util.LinkedHashMap instead.") } - @Test - fun weakHashMapTest() { + @Test(timeout=300_000) + fun weakHashMapTest() { data class C(val c: WeakHashMap) val c = C(WeakHashMap(mapOf("A" to 1, "B" to 2))) @@ -116,8 +116,8 @@ class DeserializeMapTests { .isInstanceOf(IllegalArgumentException::class.java).hasMessageContaining("Weak references with map types not supported. Suggested fix: use java.util.LinkedHashMap instead.") } - @Test - fun concreteTreeMapTest() { + @Test(timeout=300_000) + fun concreteTreeMapTest() { data class C(val c: TreeMap) val c = C(TreeMap(mapOf("A" to 1, "B" to 3))) @@ -126,8 +126,8 @@ class DeserializeMapTests { DeserializationInput(sf).deserialize(serialisedBytes) } - @Test - fun concreteLinkedHashMapTest() { + @Test(timeout=300_000) + fun concreteLinkedHashMapTest() { data class C(val c: LinkedHashMap) val c = C(LinkedHashMap(mapOf("A" to 1, "B" to 2))) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryOfEnumsTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryOfEnumsTest.kt index 7fc19130e5..6f29d0bf9d 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryOfEnumsTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryOfEnumsTest.kt @@ -14,8 +14,8 @@ class DeserializeNeedingCarpentryOfEnumsTest : AmqpCarpenterBase(AllWhitelist) { private const val VERBOSE = false } - @Test - fun singleEnum() { + @Test(timeout=300_000) + fun singleEnum() { // // Setup the test // @@ -53,8 +53,8 @@ class DeserializeNeedingCarpentryOfEnumsTest : AmqpCarpenterBase(AllWhitelist) { (deserializedObj::class.java.getMethod("getA").invoke(deserializedObj) as Enum<*>).name) } - @Test - fun compositeIncludingEnums() { + @Test(timeout=300_000) + fun compositeIncludingEnums() { // // Setup the test // diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentrySimpleTypesTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentrySimpleTypesTest.kt index 5b00c4bf30..c12c0fe82d 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentrySimpleTypesTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentrySimpleTypesTest.kt @@ -21,8 +21,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis private val sf = testDefaultFactoryNoEvolution() private val sf2 = testDefaultFactoryNoEvolution() - @Test - fun singleInt() { + @Test(timeout=300_000) + fun singleInt() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "int" to NonNullableField(Integer::class.javaPrimitiveType!!) ))) @@ -41,8 +41,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(1, db2::class.java.getMethod("getInt").invoke(db2)) } - @Test - fun singleIntNullable() { + @Test(timeout=300_000) + fun singleIntNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "int" to NullableField(Integer::class.java) ))) @@ -57,8 +57,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(1, db2::class.java.getMethod("getInt").invoke(db2)) } - @Test - fun singleIntNullableNull() { + @Test(timeout=300_000) + fun singleIntNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "int" to NullableField(Integer::class.java) ))) @@ -73,8 +73,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db2::class.java.getMethod("getInt").invoke(db2)) } - @Test - fun singleChar() { + @Test(timeout=300_000) + fun singleChar() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "char" to NonNullableField(Character::class.javaPrimitiveType!!) ))) @@ -86,8 +86,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals('a', db::class.java.getMethod("getChar").invoke(db)) } - @Test - fun singleCharNullable() { + @Test(timeout=300_000) + fun singleCharNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "char" to NullableField(Character::class.javaObjectType) ))) @@ -99,8 +99,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals('a', db::class.java.getMethod("getChar").invoke(db)) } - @Test - fun singleCharNullableNull() { + @Test(timeout=300_000) + fun singleCharNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "char" to NullableField(java.lang.Character::class.java) ))) @@ -112,8 +112,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db::class.java.getMethod("getChar").invoke(db)) } - @Test - fun singleLong() { + @Test(timeout=300_000) + fun singleLong() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "long" to NonNullableField(Long::class.javaPrimitiveType!!) ))) @@ -126,8 +126,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(l, (db::class.java.getMethod("getLong").invoke(db))) } - @Test - fun singleLongNullable() { + @Test(timeout=300_000) + fun singleLongNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "long" to NullableField(Long::class.javaObjectType) ))) @@ -140,8 +140,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(l, (db::class.java.getMethod("getLong").invoke(db))) } - @Test - fun singleLongNullableNull() { + @Test(timeout=300_000) + fun singleLongNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "long" to NullableField(Long::class.javaObjectType) ))) @@ -153,8 +153,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, (db::class.java.getMethod("getLong").invoke(db))) } - @Test - fun singleBoolean() { + @Test(timeout=300_000) + fun singleBoolean() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "boolean" to NonNullableField(Boolean::class.javaPrimitiveType!!) ))) @@ -166,8 +166,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(true, db::class.java.getMethod("getBoolean").invoke(db)) } - @Test - fun singleBooleanNullable() { + @Test(timeout=300_000) + fun singleBooleanNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "boolean" to NullableField(Boolean::class.javaObjectType) ))) @@ -179,8 +179,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(true, db::class.java.getMethod("getBoolean").invoke(db)) } - @Test - fun singleBooleanNullableNull() { + @Test(timeout=300_000) + fun singleBooleanNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "boolean" to NullableField(Boolean::class.javaObjectType) ))) @@ -192,8 +192,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db::class.java.getMethod("getBoolean").invoke(db)) } - @Test - fun singleDouble() { + @Test(timeout=300_000) + fun singleDouble() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "double" to NonNullableField(Double::class.javaPrimitiveType!!) ))) @@ -205,8 +205,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(10.0, db::class.java.getMethod("getDouble").invoke(db)) } - @Test - fun singleDoubleNullable() { + @Test(timeout=300_000) + fun singleDoubleNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "double" to NullableField(Double::class.javaObjectType) ))) @@ -218,8 +218,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(10.0, db::class.java.getMethod("getDouble").invoke(db)) } - @Test - fun singleDoubleNullableNull() { + @Test(timeout=300_000) + fun singleDoubleNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "double" to NullableField(Double::class.javaObjectType) ))) @@ -231,8 +231,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db::class.java.getMethod("getDouble").invoke(db)) } - @Test - fun singleShort() { + @Test(timeout=300_000) + fun singleShort() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "short" to NonNullableField(Short::class.javaPrimitiveType!!) ))) @@ -244,8 +244,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(3.toShort(), db::class.java.getMethod("getShort").invoke(db)) } - @Test - fun singleShortNullable() { + @Test(timeout=300_000) + fun singleShortNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "short" to NullableField(Short::class.javaObjectType) ))) @@ -257,8 +257,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(3.toShort(), db::class.java.getMethod("getShort").invoke(db)) } - @Test - fun singleShortNullableNull() { + @Test(timeout=300_000) + fun singleShortNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "short" to NullableField(Short::class.javaObjectType) ))) @@ -270,8 +270,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db::class.java.getMethod("getShort").invoke(db)) } - @Test - fun singleFloat() { + @Test(timeout=300_000) + fun singleFloat() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "float" to NonNullableField(Float::class.javaPrimitiveType!!) ))) @@ -283,8 +283,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(10.0F, db::class.java.getMethod("getFloat").invoke(db)) } - @Test - fun singleFloatNullable() { + @Test(timeout=300_000) + fun singleFloatNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "float" to NullableField(Float::class.javaObjectType) ))) @@ -296,8 +296,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(10.0F, db::class.java.getMethod("getFloat").invoke(db)) } - @Test - fun singleFloatNullableNull() { + @Test(timeout=300_000) + fun singleFloatNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "float" to NullableField(Float::class.javaObjectType) ))) @@ -309,8 +309,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db::class.java.getMethod("getFloat").invoke(db)) } - @Test - fun singleByte() { + @Test(timeout=300_000) + fun singleByte() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "byte" to NonNullableField(Byte::class.javaPrimitiveType!!) ))) @@ -324,8 +324,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(0b0101, (db::class.java.getMethod("getByte").invoke(db) as Byte)) } - @Test - fun singleByteNullable() { + @Test(timeout=300_000) + fun singleByteNullable() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "byte" to NullableField(Byte::class.javaObjectType) ))) @@ -339,8 +339,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(0b0101, (db::class.java.getMethod("getByte").invoke(db) as Byte)) } - @Test - fun singleByteNullableNull() { + @Test(timeout=300_000) + fun singleByteNullableNull() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "byte" to NullableField(Byte::class.javaObjectType) ))) @@ -352,8 +352,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(null, db::class.java.getMethod("getByte").invoke(db)) } - @Test - fun simpleTypeKnownInterface() { + @Test(timeout=300_000) + fun simpleTypeKnownInterface() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema( testName(), mapOf("name" to NonNullableField(String::class.java)), interfaces = listOf(I::class.java))) @@ -367,8 +367,8 @@ class DeserializeNeedingCarpentrySimpleTypesTest : AmqpCarpenterBase(AllWhitelis assertEquals(testVal, (deserializedObj as I).getName()) } - @Test - fun manyTypes() { + @Test(timeout=300_000) + fun manyTypes() { val manyClass = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "intA" to NonNullableField(Int::class.java), "intB" to NullableField(Integer::class.java), diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryTests.kt index 0d5fbec240..cf824157c4 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeNeedingCarpentryTests.kt @@ -50,8 +50,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { return deserialize(bytes, T::class.java, context ?: testSerializationContext) } - @Test - fun verySimpleType() { + @Test(timeout=300_000) + fun verySimpleType() { val testVal = 10 val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf("a" to NonNullableField(Int::class.java)))) @@ -83,8 +83,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(testVal, deserializedObj4::class.java.getMethod("getA").invoke(deserializedObj4)) } - @Test - fun repeatedTypesAreRecognised() { + @Test(timeout=300_000) + fun repeatedTypesAreRecognised() { val testValA = 10 val testValB = 20 val testValC = 20 @@ -121,8 +121,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { assertNotEquals(deserialisedB::class.java, deserialisedC::class.java) } - @Test - fun simpleTypeKnownInterface() { + @Test(timeout=300_000) + fun simpleTypeKnownInterface() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema( testName(), mapOf("name" to NonNullableField(String::class.java)), interfaces = listOf(I::class.java))) @@ -136,8 +136,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(testVal, (deserializedObj as I).getName()) } - @Test - fun arrayOfTypes() { + @Test(timeout=300_000) + fun arrayOfTypes() { val clazz = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf("a" to NonNullableField(Int::class.java)))) @@ -171,8 +171,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { deserializedObj.a[2]::class.java.getMethod("getA").invoke(deserializedObj.a[2])) } - @Test - fun reusedClasses() { + @Test(timeout=300_000) + fun reusedClasses() { val cc = ClassCarpenterImpl(whitelist = AllWhitelist) val innerType = cc.build(ClassSchema("${testName()}.inner", mapOf("a" to NonNullableField(Int::class.java)))) @@ -190,8 +190,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { (deserialisedO::class.java.getMethod("getA").invoke(deserialisedO))::class.java) } - @Test - fun nestedTypes() { + @Test(timeout=300_000) + fun nestedTypes() { val cc = ClassCarpenterImpl(whitelist = AllWhitelist) val nestedClass = cc.build(ClassSchema("nestedType", mapOf("name" to NonNullableField(String::class.java)))) @@ -207,8 +207,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { assertEquals("name", inner::class.java.getMethod("getName").invoke(inner)) } - @Test - fun repeatedNestedTypes() { + @Test(timeout=300_000) + fun repeatedNestedTypes() { val cc = ClassCarpenterImpl(whitelist = AllWhitelist) val nestedClass = cc.build(ClassSchema("nestedType", mapOf("name" to NonNullableField(String::class.java)))) @@ -227,8 +227,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { assertEquals("bar", deserializedObj.b::class.java.getMethod("getName").invoke(deserializedObj.b)) } - @Test - fun listOfType() { + @Test(timeout=300_000) + fun listOfType() { val unknownClass = ClassCarpenterImpl(whitelist = AllWhitelist).build(ClassSchema(testName(), mapOf( "v1" to NonNullableField(Int::class.java), "v2" to NonNullableField(Int::class.java)))) @@ -252,8 +252,8 @@ class DeserializeNeedingCarpentryTests : AmqpCarpenterBase(AllWhitelist) { } } - @Test - fun unknownInterface() { + @Test(timeout=300_000) + fun unknownInterface() { val cc = ClassCarpenterImpl(whitelist = AllWhitelist) val interfaceClass = cc.build(InterfaceSchema( diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeSimpleTypesTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeSimpleTypesTests.kt index fe4779a247..eecd5d4f63 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeSimpleTypesTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeSimpleTypesTests.kt @@ -23,8 +23,8 @@ class DeserializeSimpleTypesTests { val sf1 = testDefaultFactoryNoEvolution() val sf2 = testDefaultFactoryNoEvolution() - @Test - fun testChar() { + @Test(timeout=300_000) + fun testChar() { data class C(val c: Char) var deserializedC = DeserializationInput(sf1).deserialize(SerializationOutput(sf1).serialize(C('c'))) @@ -48,8 +48,8 @@ class DeserializeSimpleTypesTests { } @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") - @Test - fun testCharacter() { + @Test(timeout=300_000) + fun testCharacter() { data class C(val c: Char) val c = C(valueOf('c')) @@ -59,8 +59,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c, deserializedC.c) } - @Test - fun testNullCharacter() { + @Test(timeout=300_000) + fun testNullCharacter() { data class C(val c: Char?) val c = C(null) @@ -70,8 +70,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c, deserializedC.c) } - @Test - fun testArrayOfInt() { + @Test(timeout=300_000) + fun testArrayOfInt() { class IA(val ia: Array) val ia = IA(arrayOf(1, 2, 3)) @@ -89,8 +89,8 @@ class DeserializeSimpleTypesTests { } @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") - @Test - fun testArrayOfInteger() { + @Test(timeout=300_000) + fun testArrayOfInteger() { class IA(val ia: Array) val ia = IA(arrayOf(Integer.valueOf(1), Integer.valueOf(2), Integer.valueOf(3))) @@ -110,8 +110,8 @@ class DeserializeSimpleTypesTests { /** * Test unboxed primitives */ - @Test - fun testIntArray() { + @Test(timeout=300_000) + fun testIntArray() { class IA(val ia: IntArray) val v = IntArray(3) @@ -130,8 +130,8 @@ class DeserializeSimpleTypesTests { assertEquals(ia.ia[2], deserializedIA.ia[2]) } - @Test - fun testArrayOfChars() { + @Test(timeout=300_000) + fun testArrayOfChars() { class C(val c: Array) val c = C(arrayOf('a', 'b', 'c')) @@ -148,8 +148,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testCharArray() { + @Test(timeout=300_000) + fun testCharArray() { class C(val c: CharArray) val v = CharArray(3) @@ -179,8 +179,8 @@ class DeserializeSimpleTypesTests { assertEquals(c2.c[2], deserializedC.c[2]) } - @Test - fun testArrayOfBoolean() { + @Test(timeout=300_000) + fun testArrayOfBoolean() { class C(val c: Array) val c = C(arrayOf(true, false, false, true)) @@ -198,8 +198,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[3], deserializedC.c[3]) } - @Test - fun testBooleanArray() { + @Test(timeout=300_000) + fun testBooleanArray() { class C(val c: BooleanArray) val c = C(BooleanArray(4)) @@ -218,8 +218,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[3], deserializedC.c[3]) } - @Test - fun testArrayOfByte() { + @Test(timeout=300_000) + fun testArrayOfByte() { class C(val c: Array) val c = C(arrayOf(0b0001, 0b0101, 0b1111)) @@ -236,8 +236,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testByteArray() { + @Test(timeout=300_000) + fun testByteArray() { class C(val c: ByteArray) val c = C(ByteArray(3)) @@ -263,8 +263,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC2.c[2]) } - @Test - fun testArrayOfShort() { + @Test(timeout=300_000) + fun testArrayOfShort() { class C(val c: Array) val c = C(arrayOf(1, 2, 3)) @@ -281,8 +281,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testShortArray() { + @Test(timeout=300_000) + fun testShortArray() { class C(val c: ShortArray) val c = C(ShortArray(3)) @@ -300,8 +300,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testArrayOfLong() { + @Test(timeout=300_000) + fun testArrayOfLong() { class C(val c: Array) val c = C(arrayOf(2147483650, -2147483800, 10)) @@ -318,8 +318,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testLongArray() { + @Test(timeout=300_000) + fun testLongArray() { class C(val c: LongArray) val c = C(LongArray(3)) @@ -337,8 +337,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testArrayOfFloat() { + @Test(timeout=300_000) + fun testArrayOfFloat() { class C(val c: Array) val c = C(arrayOf(10F, 100.023232F, -1455.433400F)) @@ -355,8 +355,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testFloatArray() { + @Test(timeout=300_000) + fun testFloatArray() { class C(val c: FloatArray) val c = C(FloatArray(3)) @@ -374,8 +374,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testArrayOfDouble() { + @Test(timeout=300_000) + fun testArrayOfDouble() { class C(val c: Array) val c = C(arrayOf(10.0, 100.2, -1455.2)) @@ -392,8 +392,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun testDoubleArray() { + @Test(timeout=300_000) + fun testDoubleArray() { class C(val c: DoubleArray) val c = C(DoubleArray(3)) @@ -411,8 +411,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[2], deserializedC.c[2]) } - @Test - fun arrayOfArrayOfInt() { + @Test(timeout=300_000) + fun arrayOfArrayOfInt() { class C(val c: Array>) val c = C(arrayOf(arrayOf(1, 2, 3), arrayOf(4, 5, 6))) @@ -431,8 +431,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[1][2], deserializedC.c[1][2]) } - @Test - fun arrayOfIntArray() { + @Test(timeout=300_000) + fun arrayOfIntArray() { class C(val c: Array) val c = C(arrayOf(IntArray(3), IntArray(3))) @@ -453,8 +453,8 @@ class DeserializeSimpleTypesTests { assertEquals(c.c[1][2], deserializedC.c[1][2]) } - @Test - fun arrayOfArrayOfIntArray() { + @Test(timeout=300_000) + fun arrayOfArrayOfIntArray() { class C(val c: Array>) val c = C(arrayOf(arrayOf(IntArray(3), IntArray(3), IntArray(3)), @@ -481,8 +481,8 @@ class DeserializeSimpleTypesTests { } } - @Test - fun nestedRepeatedTypes() { + @Test(timeout=300_000) + fun nestedRepeatedTypes() { class A(val a: A?, val b: Int) var a = A(A(A(A(A(null, 1), 2), 3), 4), 5) @@ -505,8 +505,8 @@ class DeserializeSimpleTypesTests { } // Replicates CORDA-1545 - @Test - fun arrayOfByteArray() { + @Test(timeout=300_000) + fun arrayOfByteArray() { class A(val a : Array) val ba1 = ByteArray(3) @@ -545,8 +545,8 @@ class DeserializeSimpleTypesTests { class PropertyWithoutCordaSerializable(val value: Int) - @Test - fun classHasNoPublicConstructor() { + @Test(timeout=300_000) + fun classHasNoPublicConstructor() { assertFailsWithMessage( """Unable to create an object serializer for type class ${Garbo::class.java.name}: Mandatory constructor parameters [value] are missing from the readable properties [] @@ -560,8 +560,8 @@ No custom serializers registered. } } - @Test - fun propertyClassHasNoPublicConstructor() { + @Test(timeout=300_000) + fun propertyClassHasNoPublicConstructor() { assertFailsWithMessage( """Unable to create an object serializer for type class ${Greta::class.java.name}: Has properties [garbo] of types that are not serializable: @@ -576,8 +576,8 @@ No custom serializers registered. } } - @Test - fun notWhitelistedError() { + @Test(timeout=300_000) + fun notWhitelistedError() { val factory = testDefaultFactoryWithWhitelist() assertFailsWithMessage( "Class \"class ${PropertyWithoutCordaSerializable::class.java.name}\" " + @@ -586,8 +586,8 @@ No custom serializers registered. } } - @Test - fun propertyClassNotWhitelistedError() { + @Test(timeout=300_000) + fun propertyClassNotWhitelistedError() { val factory = testDefaultFactoryWithWhitelist() assertFailsWithMessage( "Class \"class ${PropertyWithoutCordaSerializable::class.java.name}\" " + @@ -597,8 +597,8 @@ No custom serializers registered. } // See CORDA-2782 - @Test - @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") + @Test(timeout=300_000) +@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") fun comparableNotWhitelistedOk() { @CordaSerializable class Ok(val value: String) : java.lang.Comparable { diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolvabilityTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolvabilityTests.kt index b7b0c7acfd..b24b2ee9cb 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolvabilityTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolvabilityTests.kt @@ -47,8 +47,8 @@ class EnumEvolvabilityTests { A, B, C, E } - @Test - fun noAnnotation() { + @Test(timeout=300_000) + fun noAnnotation() { data class C(val n: NotAnnotated) val sf = testDefaultFactory() @@ -63,8 +63,8 @@ class EnumEvolvabilityTests { A, B, C, D } - @Test - fun missingDefaults() { + @Test(timeout=300_000) + fun missingDefaults() { data class C(val m: MissingDefaults) val sf = testDefaultFactory() @@ -74,8 +74,8 @@ class EnumEvolvabilityTests { assertEquals(0, bAndS.transformsSchema.types.size) } - @Test - fun missingRenames() { + @Test(timeout=300_000) + fun missingRenames() { data class C(val m: MissingRenames) val sf = testDefaultFactory() @@ -86,8 +86,8 @@ class EnumEvolvabilityTests { } - @Test - fun defaultAnnotationIsAddedToEnvelope() { + @Test(timeout=300_000) + fun defaultAnnotationIsAddedToEnvelope() { data class C(val annotatedEnum: AnnotatedEnumOnce) val sf = testDefaultFactory() @@ -108,8 +108,8 @@ class EnumEvolvabilityTests { assertEquals("A", (schema[TransformTypes.EnumDefault]!![0] as EnumDefaultSchemaTransform).old) } - @Test - fun doubleDefaultAnnotationIsAddedToEnvelope() { + @Test(timeout=300_000) + fun doubleDefaultAnnotationIsAddedToEnvelope() { data class C(val annotatedEnum: AnnotatedEnumTwice) val sf = testDefaultFactory() @@ -132,8 +132,8 @@ class EnumEvolvabilityTests { assertEquals("A", (schema[TransformTypes.EnumDefault]!![1] as EnumDefaultSchemaTransform).old) } - @Test - fun defaultAnnotationIsAddedToEnvelopeAndDeserialised() { + @Test(timeout=300_000) + fun defaultAnnotationIsAddedToEnvelopeAndDeserialised() { data class C(val annotatedEnum: AnnotatedEnumOnce) val sf = testDefaultFactory() @@ -161,8 +161,8 @@ class EnumEvolvabilityTests { assertEquals("A", (schema[TransformTypes.EnumDefault]!![0] as EnumDefaultSchemaTransform).old) } - @Test - fun doubleDefaultAnnotationIsAddedToEnvelopeAndDeserialised() { + @Test(timeout=300_000) + fun doubleDefaultAnnotationIsAddedToEnvelopeAndDeserialised() { data class C(val annotatedEnum: AnnotatedEnumTwice) val sf = testDefaultFactory() @@ -188,8 +188,8 @@ class EnumEvolvabilityTests { assertEquals("A", (enumDefaults[1] as EnumDefaultSchemaTransform).old) } - @Test - fun renameAnnotationIsAdded() { + @Test(timeout=300_000) + fun renameAnnotationIsAdded() { data class C(val annotatedEnum: RenameEnumOnce) val sf = testDefaultFactory() @@ -232,8 +232,8 @@ class EnumEvolvabilityTests { A, B, E, F } - @Test - fun doubleRenameAnnotationIsAdded() { + @Test(timeout=300_000) + fun doubleRenameAnnotationIsAdded() { data class C(val annotatedEnum: RenameEnumTwice) val sf = testDefaultFactory() @@ -279,8 +279,8 @@ class EnumEvolvabilityTests { X, B, C, D, E } - @Test - fun bothAnnotationTypes() { + @Test(timeout=300_000) + fun bothAnnotationTypes() { data class C(val annotatedEnum: RenameAndExtendEnum) val sf = testDefaultFactory() @@ -316,8 +316,8 @@ class EnumEvolvabilityTests { A, B, C, D, E } - @Test - fun repeatedAnnotation() { + @Test(timeout=300_000) + fun repeatedAnnotation() { data class C(val a: RepeatedAnnotation) val sf = testDefaultFactory() @@ -344,8 +344,8 @@ class EnumEvolvabilityTests { A, B, C, D } - @Test - fun multiEnums() { + @Test(timeout=300_000) + fun multiEnums() { data class A(val a: E1, val b: E2) data class B(val a: E3, val b: A, val c: E1) data class C(val a: B, val b: E2, val c: E3) @@ -384,8 +384,8 @@ class EnumEvolvabilityTests { assertEquals(1, e3S[TransformTypes.EnumDefault]!!.size) } - @Test - fun testCache() { + @Test(timeout=300_000) + fun testCache() { data class C2(val annotatedEnum: AnnotatedEnumOnce) data class C1(val annotatedEnum: AnnotatedEnumOnce) @@ -409,8 +409,8 @@ class EnumEvolvabilityTests { // To regenerate the types for this test uncomment UnknownTransformAnnotation from SupportedTransforms.kt and it's // entry in the supportedTransforms list and the UnknownTest enum value in TransformTypes.kt // ALSO: remember to re-annotate the enum WithUnkownTest above - @Test - fun testUnknownTransform() { + @Test(timeout=300_000) + fun testUnknownTransform() { val resource = "EnumEvolvabilityTests.testUnknownTransform" val sf = testDefaultFactory() @@ -434,8 +434,8 @@ class EnumEvolvabilityTests { ) enum class AcceptMultipleRename { C } - @Test - fun acceptMultipleRename() { + @Test(timeout=300_000) + fun acceptMultipleRename() { data class C(val e: AcceptMultipleRename) val sf = testDefaultFactory() @@ -452,8 +452,8 @@ class EnumEvolvabilityTests { ) enum class RejectMultipleRenameTo { A, B, C } - @Test - fun rejectMultipleRenameTo() { + @Test(timeout=300_000) + fun rejectMultipleRenameTo() { data class C(val e: RejectMultipleRenameTo) val sf = testDefaultFactory() @@ -475,8 +475,8 @@ class EnumEvolvabilityTests { ) enum class RejectMultipleRenameFrom { A, B, C } - @Test - fun rejectMultipleRenameFrom() { + @Test(timeout=300_000) + fun rejectMultipleRenameFrom() { data class C(val e: RejectMultipleRenameFrom) val sf = testDefaultFactory() @@ -504,8 +504,8 @@ class EnumEvolvabilityTests { ) enum class RejectCyclicRename { A, B, C } - @Test - fun rejectCyclicRename() { + @Test(timeout=300_000) + fun rejectCyclicRename() { data class C(val e: RejectCyclicRename) val sf = testDefaultFactory() @@ -523,8 +523,8 @@ class EnumEvolvabilityTests { ) enum class RejectCyclicRenameRedux { A, B, C } - @Test - fun rejectCyclicRenameRedux() { + @Test(timeout=300_000) + fun rejectCyclicRenameRedux() { data class C(val e: RejectCyclicRenameRedux) val sf = testDefaultFactory() @@ -536,8 +536,8 @@ class EnumEvolvabilityTests { @CordaSerializationTransformEnumDefault(new = "D", old = "X") enum class RejectBadDefault { A, B, C, D } - @Test - fun rejectBadDefault() { + @Test(timeout=300_000) + fun rejectBadDefault() { data class C(val e: RejectBadDefault) val sf = testDefaultFactory() @@ -549,8 +549,8 @@ class EnumEvolvabilityTests { @CordaSerializationTransformEnumDefault(new = "D", old = "D") enum class RejectBadDefaultToSelf { A, B, C, D } - @Test - fun rejectBadDefaultToSelf() { + @Test(timeout=300_000) + fun rejectBadDefaultToSelf() { data class C(val e: RejectBadDefaultToSelf) val sf = testDefaultFactory() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolveTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolveTests.kt index b9009925b1..fa0a5654a6 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolveTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumEvolveTests.kt @@ -34,8 +34,8 @@ class EnumEvolveTests { // Version of the class as it's used in the test enum class DeserializeNewerSetToUnknown { A, B, C } - @Test - fun deserialiseNewerSetToUnknown() { + @Test(timeout=300_000) + fun deserialiseNewerSetToUnknown() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -62,8 +62,8 @@ class EnumEvolveTests { // Version of the class as it's used in the test enum class DeserializeNewerSetToUnknown2 { A, B, C } - @Test - fun deserialiseNewerSetToUnknown2() { + @Test(timeout=300_000) + fun deserialiseNewerSetToUnknown2() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -102,8 +102,8 @@ class EnumEvolveTests { enum class DeserializeNewerWithNoRule { A, B, C } // Lets test to see if they forgot to provide an upgrade rule - @Test - fun deserialiseNewerWithNoRule() { + @Test(timeout=300_000) + fun deserialiseNewerWithNoRule() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -150,8 +150,8 @@ class EnumEvolveTests { // Finally, the version we're using to test with enum class DeserializeWithRename { A, B, C } - @Test - fun deserializeWithRename() { + @Test(timeout=300_000) + fun deserializeWithRename() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -272,8 +272,8 @@ class EnumEvolveTests { // Finally, the original version of teh class that we're going to be testing with enum class MultiOperations { A, B, C } - @Test - fun multiOperations() { + @Test(timeout=300_000) + fun multiOperations() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -371,8 +371,8 @@ class EnumEvolveTests { @CordaSerializationTransformEnumDefault(old = "A", new = "F") enum class BadNewValue { A, B, C, D } - @Test - fun badNewValue() { + @Test(timeout=300_000) + fun badNewValue() { val sf = testDefaultFactory() data class C(val e: BadNewValue) @@ -388,8 +388,8 @@ class EnumEvolveTests { ) enum class OutOfOrder { A, B, C, D, E } - @Test - fun outOfOrder() { + @Test(timeout=300_000) + fun outOfOrder() { val sf = testDefaultFactory() data class C(val e: OutOfOrder) @@ -407,8 +407,8 @@ class EnumEvolveTests { @CordaSerializationTransformEnumDefault("D", "A") enum class ChangedOrdinality { A, B, D, C } - @Test - fun changedOrdinality() { + @Test(timeout=300_000) + fun changedOrdinality() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -436,8 +436,8 @@ class EnumEvolveTests { enum class ExtendedEnum { A, B, C, D, E} // See https://r3-cev.atlassian.net/browse/CORDA-2264. - @Test - fun extendEnum() { + @Test(timeout=300_000) + fun extendEnum() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTests.kt index badb31c2cd..51f58c614c 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTests.kt @@ -73,8 +73,8 @@ class EnumTests { private val sf1 = testDefaultFactoryNoEvolution() - @Test - fun serialiseSimpleTest() { + @Test(timeout=300_000) + fun serialiseSimpleTest() { data class C(val c: Bras) val schema = TestSerializationOutput(VERBOSE, sf1).serializeAndReturnSchema(C(Bras.UNDERWIRE)).schema @@ -97,8 +97,8 @@ class EnumTests { } } - @Test - fun deserialiseSimpleTest() { + @Test(timeout=300_000) + fun deserialiseSimpleTest() { data class C(val c: Bras) val objAndEnvelope = DeserializationInput(sf1).deserializeAndReturnEnvelope( @@ -125,8 +125,8 @@ class EnumTests { assertEquals(obj.c, Bras.UNDERWIRE) } - @Test - fun multiEnum() { + @Test(timeout=300_000) + fun multiEnum() { data class Support(val top: Bras, val day: DayOfWeek) data class WeeklySupport(val tops: List) @@ -145,8 +145,8 @@ class EnumTests { assertEquals(week.tops[2].day, obj.tops[2].day) } - @Test - fun enumWithInit() { + @Test(timeout=300_000) + fun enumWithInit() { data class C(val c: BrasWithInit) val c = C(BrasWithInit.PUSHUP) @@ -196,8 +196,8 @@ class EnumTests { DeserializationInput(sf1).deserialize(SerializedBytes(sc2)) } - @Test - fun enumNotWhitelistedFails() { + @Test(timeout=300_000) + fun enumNotWhitelistedFails() { data class C(val c: Bras) class WL(val allowed: String) : ClassWhitelist { @@ -216,8 +216,8 @@ class EnumTests { }.isInstanceOf(NotSerializableException::class.java) } - @Test - fun enumWhitelisted() { + @Test(timeout=300_000) + fun enumWhitelisted() { data class C(val c: Bras) class WL : ClassWhitelist { @@ -236,8 +236,8 @@ class EnumTests { TestSerializationOutput(VERBOSE, factory).serialize(C(Bras.UNDERWIRE)) } - @Test - fun enumAnnotated() { + @Test(timeout=300_000) + fun enumAnnotated() { @CordaSerializable data class C(val c: AnnotatedBras) class WL : ClassWhitelist { @@ -253,8 +253,8 @@ class EnumTests { TestSerializationOutput(VERBOSE, factory).serialize(C(AnnotatedBras.UNDERWIRE)) } - @Test - fun deserializeNonWhitlistedEnum() { + @Test(timeout=300_000) + fun deserializeNonWhitlistedEnum() { data class C(val c: Bras) class WL(val allowed: List) : ClassWhitelist { diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTransformationTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTransformationTests.kt index 272ad11958..f4c4ac329f 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTransformationTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EnumTransformationTests.kt @@ -23,8 +23,8 @@ class EnumTransformationTests { enum class MultiOperations { A, B, C, D, BOB } // See https://r3-cev.atlassian.net/browse/CORDA-1497 - @Test - fun defaultAndRename() { + @Test(timeout=300_000) + fun defaultAndRename() { val transforms = EnumTransforms.build( TransformsAnnotationProcessor.getTransformsSchema(MultiOperations::class.java), MultiOperations::class.java.constants) @@ -42,8 +42,8 @@ class EnumTransformationTests { ) enum class RenameCycle { A, B, C, D, E} - @Test - fun cycleDetection() { + @Test(timeout=300_000) + fun cycleDetection() { assertFailsWith { EnumTransforms.build( TransformsAnnotationProcessor.getTransformsSchema(RenameCycle::class.java), @@ -57,8 +57,8 @@ class EnumTransformationTests { ) enum class DanglingRenames { A, B, C } - @Test - fun renameCycleDoesNotTerminateInConstant() { + @Test(timeout=300_000) + fun renameCycleDoesNotTerminateInConstant() { assertFailsWith { EnumTransforms.build( TransformsAnnotationProcessor.getTransformsSchema(DanglingRenames::class.java), @@ -72,8 +72,8 @@ class EnumTransformationTests { ) enum class RenamesExisting { Q, R, S } - @Test - fun renamesRenameExistingConstant() { + @Test(timeout=300_000) + fun renamesRenameExistingConstant() { assertFailsWith { EnumTransforms.build( TransformsAnnotationProcessor.getTransformsSchema(RenamesExisting::class.java), diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/ErrorMessagesTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/ErrorMessagesTests.kt index f1e053cc43..1c85c6097f 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/ErrorMessagesTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/ErrorMessagesTests.kt @@ -19,8 +19,8 @@ class ErrorMessagesTests { // Java allows this to be set at the class level yet Kotlin doesn't for some reason @Ignore("Current behaviour allows for the serialization of objects with private members, this will be disallowed at some point in the future") - @Test - fun privateProperty() { + @Test(timeout=300_000) + fun privateProperty() { data class C(private val a: Int) val sf = testDefaultFactory() @@ -34,8 +34,8 @@ class ErrorMessagesTests { // Java allows this to be set at the class level yet Kotlin doesn't for some reason @Ignore("Current behaviour allows for the serialization of objects with private members, this will be disallowed at some point in the future") - @Test - fun privateProperty2() { + @Test(timeout=300_000) + fun privateProperty2() { data class C(val a: Int, private val b: Int) val sf = testDefaultFactory() @@ -49,8 +49,8 @@ class ErrorMessagesTests { // Java allows this to be set at the class level yet Kotlin doesn't for some reason @Ignore("Current behaviour allows for the serialization of objects with private members, this will be disallowed at some point in the future") - @Test - fun privateProperty3() { + @Test(timeout=300_000) + fun privateProperty3() { // despite b being private, the getter we've added is public and thus allows for the serialisation // of the object data class C(val a: Int, private val b: Int) { @@ -66,8 +66,8 @@ class ErrorMessagesTests { // Java allows this to be set at the class level yet Kotlin doesn't for some reason @Ignore("Current behaviour allows for the serialization of objects with private members, this will be disallowed at some point in the future") - @Test - fun protectedProperty() { + @Test(timeout=300_000) + fun protectedProperty() { open class C(@Suppress("unused") protected val a: Int) val sf = testDefaultFactory() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolutionSerializerFactoryTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolutionSerializerFactoryTests.kt index 5571be00df..3659d86aef 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolutionSerializerFactoryTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolutionSerializerFactoryTests.kt @@ -32,8 +32,8 @@ class EvolutionSerializerFactoryTests { // Version of the class as it's used in the test data class C(val a: Int) - @Test - fun preservesDataWhenFlagSet() { + @Test(timeout=300_000) + fun preservesDataWhenFlagSet() { val resource = "${javaClass.simpleName}.${testName()}" val withNullResource = "${resource}_with_null" diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt index 289f1ff8ad..39d76fa62f 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt @@ -48,8 +48,8 @@ class EvolvabilityTests { private val DUMMY_NOTARY_PARTY = Party(DUMMY_NOTARY_NAME, Crypto.deriveKeyPairFromEntropy(Crypto.DEFAULT_SIGNATURE_SCHEME, BigInteger.valueOf(20)).public) } - @Test - fun simpleOrderSwapSameType() { + @Test(timeout=300_000) + fun simpleOrderSwapSameType() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.simpleOrderSwapSameType" @@ -71,8 +71,8 @@ class EvolvabilityTests { assertEquals(B, deserializedC.b) } - @Test - fun simpleOrderSwapDifferentType() { + @Test(timeout=300_000) + fun simpleOrderSwapDifferentType() { val sf = testDefaultFactory() val A = 1 val B = "two" @@ -93,8 +93,8 @@ class EvolvabilityTests { assertEquals(B, deserializedC.b) } - @Test - fun addAdditionalParamNotMandatory() { + @Test(timeout=300_000) + fun addAdditionalParamNotMandatory() { val sf = testDefaultFactory() val A = 1 val resource = "EvolvabilityTests.addAdditionalParamNotMandatory" @@ -139,8 +139,8 @@ class EvolvabilityTests { } @Suppress("UNUSED_VARIABLE") - @Test - fun removeParameters() { + @Test(timeout=300_000) + fun removeParameters() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.removeParameters" val A = 1 @@ -163,8 +163,8 @@ class EvolvabilityTests { } @Suppress("UNUSED_VARIABLE") - @Test - fun removeParameterWithCalculatedParameter() { + @Test(timeout=300_000) + fun removeParameterWithCalculatedParameter() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.removeParameterWithCalculatedParameter" @@ -191,8 +191,8 @@ class EvolvabilityTests { } @Suppress("UNUSED_VARIABLE") - @Test - fun addAndRemoveParameters() { + @Test(timeout=300_000) + fun addAndRemoveParameters() { val sf = testDefaultFactory() val A = 1 val B = "two" @@ -217,8 +217,8 @@ class EvolvabilityTests { assertEquals(D, deserializedCC.d) } - @Test - fun addMandatoryFieldWithAltConstructor() { + @Test(timeout=300_000) + fun addMandatoryFieldWithAltConstructor() { val sf = testDefaultFactory() val A = 1 val resource = "EvolvabilityTests.addMandatoryFieldWithAltConstructor" @@ -241,8 +241,8 @@ class EvolvabilityTests { assertEquals("hello", deserializedCC.b) } - @Test - fun addMandatoryFieldWithAltConstructorForceReorder() { + @Test(timeout=300_000) + fun addMandatoryFieldWithAltConstructorForceReorder() { val sf = testDefaultFactory() val z = 30 val y = 20 @@ -266,8 +266,8 @@ class EvolvabilityTests { assertEquals(z, deserializedCC.z) } - @Test - fun moreComplexNonNullWithReorder() { + @Test(timeout=300_000) + fun moreComplexNonNullWithReorder() { val resource = "${javaClass.simpleName}.${testName()}" data class NetworkParametersExample( @@ -347,8 +347,8 @@ class EvolvabilityTests { DeserializationInput(sf).deserialize(SerializedBytes(url.readBytes())) } - @Test - fun addMandatoryFieldWithAltReorderedConstructor() { + @Test(timeout=300_000) + fun addMandatoryFieldWithAltReorderedConstructor() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.addMandatoryFieldWithAltReorderedConstructor" val A = 1 @@ -377,8 +377,8 @@ class EvolvabilityTests { assertEquals("wibble", deserializedCC.d) } - @Test - fun addMandatoryFieldWithAltReorderedConstructorAndRemoval() { + @Test(timeout=300_000) + fun addMandatoryFieldWithAltReorderedConstructorAndRemoval() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.addMandatoryFieldWithAltReorderedConstructorAndRemoval" val A = 1 @@ -408,8 +408,8 @@ class EvolvabilityTests { assertEquals("wibble", deserializedCC.d) } - @Test - fun multiVersion() { + @Test(timeout=300_000) + fun multiVersion() { val sf = testDefaultFactory() val resource1 = "EvolvabilityTests.multiVersion.1" val resource2 = "EvolvabilityTests.multiVersion.2" @@ -478,8 +478,8 @@ class EvolvabilityTests { assertEquals(-1, db3.e) } - @Test - fun changeSubType() { + @Test(timeout=300_000) + fun changeSubType() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.changeSubType" val oa = 100 @@ -515,8 +515,8 @@ class EvolvabilityTests { assertEquals("new value", newOuter.b.b) } - @Test - fun multiVersionWithRemoval() { + @Test(timeout=300_000) + fun multiVersionWithRemoval() { val sf = testDefaultFactory() val resource1 = "EvolvabilityTests.multiVersionWithRemoval.1" @@ -607,8 +607,8 @@ class EvolvabilityTests { // to regenerate at a specific version add that test to a checkout at the desired sha then take // the resulting file and add to the repo, changing the filename as appropriate // - @Test - @Ignore("Test fails after moving NetworkParameters and NotaryInfo into core from node-api") + @Test(timeout=300_000) +@Ignore("Test fails after moving NetworkParameters and NotaryInfo into core from node-api") fun readBrokenNetworkParameters() { val sf = testDefaultFactory() sf.register(net.corda.serialization.internal.amqp.custom.InstantSerializer(sf)) @@ -638,8 +638,8 @@ class EvolvabilityTests { // This test created a serialized and signed set of Network Parameters to test whether we // can still deserialize them // - @Test - @Ignore("This test simply regenerates the test file used for readBrokenNetworkParameters") + @Test(timeout=300_000) +@Ignore("This test simply regenerates the test file used for readBrokenNetworkParameters") fun `regenerate broken network parameters`() { // note: 6a6b6f256 is the sha that generates the file val resource = "networkParams.." @@ -661,8 +661,8 @@ class EvolvabilityTests { } @Suppress("UNCHECKED_CAST") - @Test - fun getterSetterEvolver1() { + @Test(timeout=300_000) + fun getterSetterEvolver1() { val resource = "EvolvabilityTests.getterSetterEvolver1" val sf = testDefaultFactory() @@ -708,8 +708,8 @@ class EvolvabilityTests { // Class before evolution data class Evolved(val fnord: String) - @Test - fun evolutionWithCarpentry() { + @Test(timeout=300_000) + fun evolutionWithCarpentry() { val resource = "EvolvabilityTests.evolutionWithCarpentry" val sf = testDefaultFactory() // Uncomment to recreate @@ -735,8 +735,8 @@ class EvolvabilityTests { data class Parameterized(val a: A, val b: Set) : ForceEvolution // See CORDA-2742 - @Test - fun evolutionWithPrimitives() { + @Test(timeout=300_000) + fun evolutionWithPrimitives() { val resource = "EvolvabilityTests.evolutionWithPrimitives" val sf = testDefaultFactory() // Uncomment to recreate @@ -750,8 +750,8 @@ class EvolvabilityTests { assertEquals(10, deserialized.parameterized?.a) } - @Test - fun addMandatoryFieldWithAltConstructorAndMakeExistingIntFieldNullable() { + @Test(timeout=300_000) + fun addMandatoryFieldWithAltConstructorAndMakeExistingIntFieldNullable() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.addMandatoryFieldWithAltConstructorAndMakeExistingIntFieldNullable" @@ -773,8 +773,8 @@ class EvolvabilityTests { assertEquals(42, deserializedCC.b) } - @Test - fun addMandatoryFieldWithAltConstructorAndMakeExistingNullableIntFieldMandatory() { + @Test(timeout=300_000) + fun addMandatoryFieldWithAltConstructorAndMakeExistingNullableIntFieldMandatory() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.addMandatoryFieldWithAltConstructorAndMakeExistingNullableIntFieldMandatory" @@ -796,8 +796,8 @@ class EvolvabilityTests { assertEquals(42, deserializedCC.b) } - @Test - fun addMandatoryFieldAndRemoveExistingNullableIntField() { + @Test(timeout=300_000) + fun addMandatoryFieldAndRemoveExistingNullableIntField() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.addMandatoryFieldAndRemoveExistingNullableIntField" @@ -819,8 +819,8 @@ class EvolvabilityTests { assertEquals("", deserializedCC.b) } - @Test - fun removeExistingNullableIntFieldWithAltConstructor() { + @Test(timeout=300_000) + fun removeExistingNullableIntFieldWithAltConstructor() { val sf = testDefaultFactory() val resource = "EvolvabilityTests.removeExistingNullableIntFieldWithAltConstructor" diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/FingerPrinterTesting.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/FingerPrinterTesting.kt index cad38afa53..f6ee434645 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/FingerPrinterTesting.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/FingerPrinterTesting.kt @@ -29,8 +29,8 @@ class FingerPrinterTestingTests { const val VERBOSE = true } - @Test - fun testingTest() { + @Test(timeout=300_000) + fun testingTest() { val fpt = FingerPrinterTesting() val descriptorBasedSerializerRegistry = DefaultDescriptorBasedSerializerRegistry() val customSerializerRegistry: CustomSerializerRegistry = CachingCustomSerializerRegistry(descriptorBasedSerializerRegistry) @@ -42,8 +42,8 @@ class FingerPrinterTestingTests { assertEquals("1", fpt.fingerprint(typeModel.inspect(String::class.java))) } - @Test - fun worksAsReplacement() { + @Test(timeout=300_000) + fun worksAsReplacement() { data class C(val a: Int, val b: Long) val factory = SerializerFactoryBuilder.build(AllWhitelist, diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/GenericsTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/GenericsTests.kt index 0e5abb3fa5..eab3d31494 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/GenericsTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/GenericsTests.kt @@ -43,8 +43,8 @@ class GenericsTests { private fun BytesAndSchemas.printSchema() = if (VERBOSE) println("${this.schema}\n") else Unit - @Test - fun twoDifferentTypesSameParameterizedOuter() { + @Test(timeout=300_000) + fun twoDifferentTypesSameParameterizedOuter() { data class G(val a: A) val factory = testDefaultFactoryNoEvolution() @@ -59,8 +59,8 @@ class GenericsTests { } } - @Test - fun doWeIgnoreMultipleParams() { + @Test(timeout=300_000) + fun doWeIgnoreMultipleParams() { data class G1(val a: T) data class G2(val a: T) data class Wrapper(val a: Int, val b: G1, val c: G2) @@ -73,8 +73,8 @@ class GenericsTests { DeserializationInput(factory2).deserialize(bytes.obj) } - @Test - fun nestedSerializationOfGenerics() { + @Test(timeout=300_000) + fun nestedSerializationOfGenerics() { data class G(val a: T) data class Wrapper(val a: Int, val b: G) @@ -102,8 +102,8 @@ class GenericsTests { } } - @Test - fun nestedGenericsReferencesByteArrayViaSerializedBytes() { + @Test(timeout=300_000) + fun nestedGenericsReferencesByteArrayViaSerializedBytes() { data class G(val a: Int) data class Wrapper(val a: Int, val b: SerializedBytes) @@ -128,8 +128,8 @@ class GenericsTests { } } - @Test - fun nestedSerializationInMultipleContextsDoesntColideGenericTypes() { + @Test(timeout=300_000) + fun nestedSerializationInMultipleContextsDoesntColideGenericTypes() { data class InnerA(val a_a: Int) data class InnerB(val a_b: Int) data class InnerC(val a_c: String) @@ -163,8 +163,8 @@ class GenericsTests { } } - @Test - fun nestedSerializationWhereGenericDoesntImpactFingerprint() { + @Test(timeout=300_000) + fun nestedSerializationWhereGenericDoesntImpactFingerprint() { data class Inner(val a: Int) data class Container(val b: Inner) data class Wrapper(val c: Container) @@ -231,14 +231,14 @@ class GenericsTests { DeserializationInput(factory).deserialize(bytes as SerializedBytes>) } - @Test - fun forceWildcard() { + @Test(timeout=300_000) + fun forceWildcard() { forceWildcardDeserializeString(forceWildcardSerialize(ForceWildcard("hello"))) forceWildcardDeserializeDouble(forceWildcardSerialize(ForceWildcard(3.0))) } - @Test - fun forceWildcardSharedFactory() { + @Test(timeout=300_000) + fun forceWildcardSharedFactory() { val f = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -246,15 +246,15 @@ class GenericsTests { forceWildcardDeserializeDouble(forceWildcardSerialize(ForceWildcard(3.0), f), f) } - @Test - fun forceWildcardDeserialize() { + @Test(timeout=300_000) + fun forceWildcardDeserialize() { forceWildcardDeserialize(forceWildcardSerialize(ForceWildcard("hello"))) forceWildcardDeserialize(forceWildcardSerialize(ForceWildcard(10))) forceWildcardDeserialize(forceWildcardSerialize(ForceWildcard(20.0))) } - @Test - fun forceWildcardDeserializeSharedFactory() { + @Test(timeout=300_000) + fun forceWildcardDeserializeSharedFactory() { val f = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) @@ -263,8 +263,8 @@ class GenericsTests { forceWildcardDeserialize(forceWildcardSerialize(ForceWildcard(20.0), f), f) } - @Test - fun loadGenericFromFile() { + @Test(timeout=300_000) + fun loadGenericFromFile() { val resource = "${javaClass.simpleName}.${testName()}" val sf = testDefaultFactory() @@ -313,8 +313,8 @@ class GenericsTests { DeserializationInput(factory4).deserializeAndReturnEnvelope(ser2.obj) } - @Test - fun fingerprintingDiffers() { + @Test(timeout=300_000) + fun fingerprintingDiffers() { val state = TransactionState( TestContractState(listOf(MINI_CORP_PARTY)), "wibble",MINI_CORP_PARTY, @@ -326,8 +326,8 @@ class GenericsTests { fingerprintingDiffersStrip(sas) } - @Test - fun fingerprintingDiffersList() { + @Test(timeout=300_000) + fun fingerprintingDiffersList() { val state = TransactionState( TestContractState(listOf(MINI_CORP_PARTY)), "wibble", MINI_CORP_PARTY, @@ -343,8 +343,8 @@ class GenericsTests { // // Force object to be serialised as Example and deserialized as Example // - @Test - fun fingerprintingDiffersListLoaded() { + @Test(timeout=300_000) + fun fingerprintingDiffersListLoaded() { // // using this wrapper class we force the object to be serialised as // net.corda.core.contracts.TransactionState @@ -373,8 +373,8 @@ class GenericsTests { assertEquals(sas.ref, des1.obj.o.firstOrNull()?.ref ?: "WILL NOT MATCH") } - @Test - fun nestedGenericsWithBound() { + @Test(timeout=300_000) + fun nestedGenericsWithBound() { open class BaseState(val a : Int) class DState(a: Int) : BaseState(a) data class LTransactionState constructor(val data: T) @@ -394,8 +394,8 @@ class GenericsTests { assertEquals(state.data.a, des1.obj.state.data.a) } - @Test - fun nestedMultiGenericsWithBound() { + @Test(timeout=300_000) + fun nestedMultiGenericsWithBound() { open class BaseState(val a : Int) class DState(a: Int) : BaseState(a) class EState(a: Int, val msg: String) : BaseState(a) @@ -418,8 +418,8 @@ class GenericsTests { assertEquals(state.context.a, des1.obj.state.context.a) } - @Test - fun nestedMultiGenericsNoBound() { + @Test(timeout=300_000) + fun nestedMultiGenericsNoBound() { open class BaseState(val a : Int) class DState(a: Int) : BaseState(a) class EState(a: Int, val msg: String) : BaseState(a) @@ -443,8 +443,8 @@ class GenericsTests { assertEquals(state.context.msg, des1.obj.state.context.msg) } - @Test - fun baseClassInheritedButNotOverriden() { + @Test(timeout=300_000) + fun baseClassInheritedButNotOverriden() { val factory1 = testDefaultFactoryNoEvolution() val factory2 = testDefaultFactory() @@ -469,8 +469,8 @@ class GenericsTests { assertEquals(state2.c, des2.obj.c) } - @Test - fun baseClassInheritedButNotOverridenBounded() { + @Test(timeout=300_000) + fun baseClassInheritedButNotOverridenBounded() { val factory1 = testDefaultFactoryNoEvolution() val factory2 = testDefaultFactory() @@ -486,8 +486,8 @@ class GenericsTests { assertEquals(state.a.a, des1.obj.a.a) } - @Test - fun nestedMultiGenericsAtBottomWithBound() { + @Test(timeout=300_000) + fun nestedMultiGenericsAtBottomWithBound() { open class BaseState(val a : T1, val b: T2) class DState(a: T1, b: T2) : BaseState(a, b) class EState(a: T1, b: T2, val c: Long) : BaseState(a, b) @@ -525,8 +525,8 @@ class GenericsTests { val a: T } - @Test - fun implemntsGenericInterface() { + @Test(timeout=300_000) + fun implemntsGenericInterface() { class D(override val a: String) : implementsGenericInterfaceI val factory = testDefaultFactoryNoEvolution() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OptionalSerializationTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OptionalSerializationTests.kt index cf12f740a8..6a6264b900 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OptionalSerializationTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OptionalSerializationTests.kt @@ -14,10 +14,10 @@ import java.util.* class OptionalSerializationTests { - @Test - fun setupEnclosedSerializationTest() { - @Test - fun `java optionals should serialize`() { + @Test(timeout=300_000) + fun setupEnclosedSerializationTest() { + @Test(timeout=300_000) + fun `java optionals should serialize`() { val factory = SerializerFactoryBuilder.build(AllWhitelist, ClassCarpenterImpl(AllWhitelist, ClassLoader.getSystemClassLoader()) ) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OverridePKSerializerTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OverridePKSerializerTest.kt index 202e9fef40..8d125f27eb 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OverridePKSerializerTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/OverridePKSerializerTest.kt @@ -56,8 +56,8 @@ class OverridePKSerializerTest { } } - @Test - fun `test publicKeySerializer is overridden`() { + @Test(timeout=300_000) + fun `test publicKeySerializer is overridden`() { val scheme = AMQPTestSerializationScheme() val key = TestPublicKey() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/PrivatePropertyTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/PrivatePropertyTests.kt index 43c248c360..9c457217f0 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/PrivatePropertyTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/PrivatePropertyTests.kt @@ -18,8 +18,8 @@ class PrivatePropertyTests { private val factory = testDefaultFactoryNoEvolution(registry) val typeModel = ConfigurableLocalTypeModel(WhitelistBasedTypeModelConfiguration(factory.whitelist, factory)) - @Test - fun testWithOnePrivateProperty() { + @Test(timeout=300_000) + fun testWithOnePrivateProperty() { data class C(private val b: String) val c1 = C("Pants are comfortable sometimes") @@ -27,8 +27,8 @@ class PrivatePropertyTests { assertEquals(c1, c2) } - @Test - fun testWithOnePrivatePropertyBoolean() { + @Test(timeout=300_000) + fun testWithOnePrivatePropertyBoolean() { data class C(private val b: Boolean) C(false).apply { @@ -36,8 +36,8 @@ class PrivatePropertyTests { } } - @Test - fun testWithOnePrivatePropertyNullableNotNull() { + @Test(timeout=300_000) + fun testWithOnePrivatePropertyNullableNotNull() { data class C(private val b: String?) val c1 = C("Pants are comfortable sometimes") @@ -45,8 +45,8 @@ class PrivatePropertyTests { assertEquals(c1, c2) } - @Test - fun testWithOnePrivatePropertyNullableNull() { + @Test(timeout=300_000) + fun testWithOnePrivatePropertyNullableNull() { data class C(private val b: String?) val c1 = C(null) @@ -54,8 +54,8 @@ class PrivatePropertyTests { assertEquals(c1, c2) } - @Test - fun testWithOnePublicOnePrivateProperty() { + @Test(timeout=300_000) + fun testWithOnePublicOnePrivateProperty() { data class C(val a: Int, private val b: Int) val c1 = C(1, 2) @@ -63,8 +63,8 @@ class PrivatePropertyTests { assertEquals(c1, c2) } - @Test - fun testWithInheritance() { + @Test(timeout=300_000) + fun testWithInheritance() { open class B(val a: String, protected val b: String) class D (a: String, b: String) : B (a, b) { override fun equals(other: Any?): Boolean = when (other) { @@ -80,8 +80,8 @@ class PrivatePropertyTests { assertEquals(d1, d2) } - @Test - fun testMultiArgSetter() { + @Test(timeout=300_000) + fun testMultiArgSetter() { @Suppress("UNUSED") data class C(private var a: Int, var b: Int) { // This will force the serialization engine to use getter / setter @@ -99,8 +99,8 @@ class PrivatePropertyTests { assertEquals(44, c2.b) } - @Test - fun testBadTypeArgSetter() { + @Test(timeout=300_000) + fun testBadTypeArgSetter() { @Suppress("UNUSED") data class C(private var a: Int, val b: Int) { @ConstructorForDeserialization @@ -118,8 +118,8 @@ class PrivatePropertyTests { "yet underlying type is int") } - @Test - fun testWithOnePublicOnePrivateProperty2() { + @Test(timeout=300_000) + fun testWithOnePublicOnePrivateProperty2() { data class C(val a: Int, private val b: Int) val c1 = C(1, 2) @@ -135,8 +135,8 @@ class PrivatePropertyTests { assertTrue(typeInformation.properties["b"] is LocalPropertyInformation.PrivateConstructorPairedProperty) } - @Test - fun testGetterMakesAPublicReader() { + @Test(timeout=300_000) + fun testGetterMakesAPublicReader() { data class C(val a: Int, private val b: Int) { @Suppress("UNUSED") fun getB() = b @@ -157,8 +157,8 @@ class PrivatePropertyTests { } @Suppress("UNCHECKED_CAST") - @Test - fun testNested() { + @Test(timeout=300_000) + fun testNested() { data class Inner(private val a: Int) data class Outer(private val i: Inner) @@ -179,8 +179,8 @@ class PrivatePropertyTests { // Reproduces CORDA-1134 // @Suppress("UNCHECKED_CAST") - @Test - fun allCapsProprtyNotPrivate() { + @Test(timeout=300_000) + fun allCapsProprtyNotPrivate() { data class C (val CCC: String) val typeInformation = typeModel.inspect(C::class.java) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/RoundTripTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/RoundTripTests.kt index 07e63e5783..8fb8827bee 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/RoundTripTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/RoundTripTests.kt @@ -23,8 +23,8 @@ import kotlin.test.assertEquals class RoundTripTests { - @Test - fun mutableBecomesImmutable() { + @Test(timeout=300_000) + fun mutableBecomesImmutable() { data class C(val l: MutableList) val factory = testDefaultFactoryNoEvolution() @@ -36,8 +36,8 @@ class RoundTripTests { }.isInstanceOf(UnsupportedOperationException::class.java) } - @Test - fun mutableStillMutable() { + @Test(timeout=300_000) + fun mutableStillMutable() { class C(l: MutableList) { val l: MutableList = l.toMutableList() } @@ -50,8 +50,8 @@ class RoundTripTests { assertThat(newC.l).containsExactly("a", "b", "c", "d") } - @Test - fun mutableStillMutable2() { + @Test(timeout=300_000) + fun mutableStillMutable2() { data class C(val l: MutableList) { @ConstructorForDeserialization @Suppress("Unused") @@ -66,8 +66,8 @@ class RoundTripTests { assertThat(newC.l).containsExactly("a", "b", "c", "d") } - @Test - fun mutableBecomesImmutable4() { + @Test(timeout=300_000) + fun mutableBecomesImmutable4() { data class C(val l: List) val factory = testDefaultFactoryNoEvolution() @@ -76,8 +76,8 @@ class RoundTripTests { newC.copy(l = (newC.l + "d")) } - @Test - fun calculatedValues() { + @Test(timeout=300_000) + fun calculatedValues() { data class C(val i: Int) { @get:SerializableCalculatedProperty val squared = i * i @@ -89,8 +89,8 @@ class RoundTripTests { assertThat(deserialized.squared).isEqualTo(4) } - @Test - fun calculatedFunction() { + @Test(timeout=300_000) + fun calculatedFunction() { class C { var i: Int = 0 @SerializableCalculatedProperty @@ -109,8 +109,8 @@ class RoundTripTests { val squared: Int } - @Test - fun inheritedCalculatedFunction() { + @Test(timeout=300_000) + fun inheritedCalculatedFunction() { class C: I { var i: Int = 0 override val squared get() = i * i @@ -123,8 +123,8 @@ class RoundTripTests { assertThat(deserialized.squared).isEqualTo(4) } - @Test - fun inheritedCalculatedFunctionIsNotCalculated() { + @Test(timeout=300_000) + fun inheritedCalculatedFunctionIsNotCalculated() { class C(override val squared: Int): I val instance = C(2) @@ -141,8 +141,8 @@ class RoundTripTests { data class OnMembershipChanged(val changedMembership : StateAndRef>) - @Test - fun canSerializeClassesWithUntypedProperties() { + @Test(timeout=300_000) + fun canSerializeClassesWithUntypedProperties() { val data = MembershipState(mapOf("foo" to "bar")) val party = Party( CordaX500Name(organisation = "Test Corp", locality = "Madrid", country = "ES"), @@ -170,8 +170,8 @@ class RoundTripTests { data class C(override val t: B) : I2 - @Test - fun recursiveTypeVariableResolution() { + @Test(timeout=300_000) + fun recursiveTypeVariableResolution() { val factory = testDefaultFactoryNoEvolution() val instance = C, List>(emptyList()) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationPropertyOrdering.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationPropertyOrdering.kt index 5ffcfe2c90..24d7422a93 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationPropertyOrdering.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationPropertyOrdering.kt @@ -21,8 +21,8 @@ class SerializationPropertyOrdering { // this test shows (not now it's fixed) a bug whereby deserializing objects // would break where refferenced objects were accessed before they'd been // processed thanks to the way the blob was deserialized - @Test - fun refferenceOrdering() { + @Test(timeout=300_000) + fun refferenceOrdering() { data class Reffed(val c: String, val b: String, val a: String) data class User(val b: List, val a: List) @@ -35,8 +35,8 @@ class SerializationPropertyOrdering { DeserializationInput(sf).deserialize(output.obj) } - @Test - fun randomOrder() { + @Test(timeout=300_000) + fun randomOrder() { data class C(val c: Int, val d: Int, val b: Int, val e: Int, val a: Int) val c = C(3,4,2,5,1) @@ -65,8 +65,8 @@ class SerializationPropertyOrdering { } @Suppress("UNCHECKED_CAST") - @Test - fun randomOrderSetter() { + @Test(timeout=300_000) + fun randomOrderSetter() { data class C(var c: Int, var d: Int, var b: Int, var e: Int, var a: Int) { // This will force the serialization engine to use getter / setter // instantiation for the object rather than construction diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializeAndReturnSchemaTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializeAndReturnSchemaTest.kt index adf8e53d4d..281112db1c 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializeAndReturnSchemaTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/SerializeAndReturnSchemaTest.kt @@ -19,8 +19,8 @@ class SerializeAndReturnSchemaTest { // indeed give us the correct schema back. This is more useful in support of other // tests rather than by itself but for those to be reliable this also needs // testing - @Test - fun getSchema() { + @Test(timeout=300_000) + fun getSchema() { data class C(val a: Int, val b: Int) val a = 1 diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StaticInitialisationOfSerializedObjectTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StaticInitialisationOfSerializedObjectTest.kt index ab13ffa712..0d1b2d9cdc 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StaticInitialisationOfSerializedObjectTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StaticInitialisationOfSerializedObjectTest.kt @@ -46,8 +46,8 @@ class StaticInitialisationOfSerializedObjectTest { } @Ignore("Suppressing this, as it depends on obtaining internal access to serialiser cache") - @Test - fun kotlinObjectWithCompanionObject() { + @Test(timeout=300_000) + fun kotlinObjectWithCompanionObject() { data class D(val c: C) val sf = SerializerFactoryBuilder.build(AllWhitelist, @@ -72,8 +72,8 @@ class StaticInitialisationOfSerializedObjectTest { assertEquals(2, serialisersByType.size) } - @Test - fun deserializeTest() { + @Test(timeout=300_000) + fun deserializeTest() { data class D(val c: C2) val url = EvolvabilityTests::class.java.getResource("StaticInitialisationOfSerializedObjectTest.deserializeTest") @@ -108,8 +108,8 @@ class StaticInitialisationOfSerializedObjectTest { SerializerFactoryBuilder.build(wl1, ClassCarpenterImpl(wl2, ClassLoader.getSystemClassLoader())) // This time have the serialization factory and the carpenter use different whitelists - @Test - fun deserializeTest2() { + @Test(timeout=300_000) + fun deserializeTest2() { data class D(val c: C2) val url = EvolvabilityTests::class.java.getResource("StaticInitialisationOfSerializedObjectTest.deserializeTest2") diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StreamTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StreamTests.kt index 4ac37e433b..166056de34 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StreamTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/StreamTests.kt @@ -13,8 +13,8 @@ class StreamTests { private class WrapperStream(input: InputStream) : FilterInputStream(input) - @Test - fun inputStream() { + @Test(timeout=300_000) + fun inputStream() { val attachment = InputStreamAndHash.createInMemoryTestZip(2116, 1) val id : InputStream = WrapperStream(attachment.inputStream) @@ -32,8 +32,8 @@ class StreamTests { DeserializationInput(deserializerFactory).deserialize(bytes) } - @Test - fun listInputStream() { + @Test(timeout=300_000) + fun listInputStream() { val attachment = InputStreamAndHash.createInMemoryTestZip(2116, 1) val id /* : List */= listOf(WrapperStream(attachment.inputStream)) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/TypeModellingFingerPrinterTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/TypeModellingFingerPrinterTests.kt index 5f737c993b..362972afc7 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/TypeModellingFingerPrinterTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/TypeModellingFingerPrinterTests.kt @@ -15,8 +15,8 @@ class TypeModellingFingerPrinterTests { val fingerprinter = TypeModellingFingerPrinter(customRegistry, true) // See https://r3-cev.atlassian.net/browse/CORDA-2266 - @Test - fun `Object and wildcard are fingerprinted differently`() { + @Test(timeout=300_000) + fun `Object and wildcard are fingerprinted differently`() { val objectType = LocalTypeInformation.Top val anyType = LocalTypeInformation.Unknown @@ -30,8 +30,8 @@ class TypeModellingFingerPrinterTests { data class SuppliesTypeParameter(val value: HasTypeParameter) // See https://r3-cev.atlassian.net/browse/CORDA-2848 - @Test - fun `can fingerprint type with non-serializable type parameter`() { + @Test(timeout=300_000) + fun `can fingerprint type with non-serializable type parameter`() { val typeModel = ConfigurableLocalTypeModel(WhitelistBasedTypeModelConfiguration(AllWhitelist, customRegistry)) val typeInfo = typeModel.inspect(SuppliesTypeParameter::class.java) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/custom/OptionalSerializerTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/custom/OptionalSerializerTest.kt index 8812cd63d1..5692c31b37 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/custom/OptionalSerializerTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/custom/OptionalSerializerTest.kt @@ -9,29 +9,29 @@ import org.mockito.Mockito import java.util.* class OptionalSerializerTest { - @Test - fun `should convert optional with item to proxy`() { + @Test(timeout=300_000) + fun `should convert optional with item to proxy`() { val opt = Optional.of("GenericTestString") val proxy = OptionalSerializer(Mockito.mock(SerializerFactory::class.java)).toProxy(opt) assertThat(proxy.item, `is`("GenericTestString")) } - @Test - fun `should convert optional without item to empty proxy`() { + @Test(timeout=300_000) + fun `should convert optional without item to empty proxy`() { val opt = Optional.ofNullable(null) val proxy = OptionalSerializer(Mockito.mock(SerializerFactory::class.java)).toProxy(opt) assertThat(proxy.item, `is`(nullValue())) } - @Test - fun `should convert proxy without item to empty optional `() { + @Test(timeout=300_000) + fun `should convert proxy without item to empty optional `() { val proxy = OptionalSerializer.OptionalProxy(null) val opt = OptionalSerializer(Mockito.mock(SerializerFactory::class.java)).fromProxy(proxy) assertThat(opt.isPresent, `is`(false)) } - @Test - fun `should convert proxy with item to empty optional `() { + @Test(timeout=300_000) + fun `should convert proxy with item to empty optional `() { val proxy = OptionalSerializer.OptionalProxy("GenericTestString") val opt = OptionalSerializer(Mockito.mock(SerializerFactory::class.java)).fromProxy(proxy) assertThat(opt.get(), `is`("GenericTestString")) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CarpenterExceptionTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CarpenterExceptionTests.kt index fd1e737e5a..84870f5ffc 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CarpenterExceptionTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CarpenterExceptionTests.kt @@ -40,8 +40,8 @@ class CarpenterExceptionTests { val VERBOSE: Boolean get() = false } - @Test - fun checkClassComparison() { + @Test(timeout=300_000) + fun checkClassComparison() { class CLA : ClassLoader() { override fun loadClass(name: String, resolve: Boolean): Class<*> { println("CLA::loadClass $name") @@ -71,8 +71,8 @@ class CarpenterExceptionTests { assertEquals(a2, a3) } - @Test - fun carpenterExceptionRethrownAsNotSerializableException() { + @Test(timeout=300_000) + fun carpenterExceptionRethrownAsNotSerializableException() { data class C2(val i: Int) : TestInterface { override fun runThing() = 1 } diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterTest.kt index 25420d1f21..84c04c8baf 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterTest.kt @@ -25,8 +25,8 @@ class ClassCarpenterTest { private val Class<*>.nonSyntheticFields: List get() = declaredFields.filterNot { it.isSynthetic } private val Class<*>.nonSyntheticMethods: List get() = declaredMethods.filterNot { it.isSynthetic } - @Test - fun empty() { + @Test(timeout=300_000) + fun empty() { val clazz = cc.build(ClassSchema("gen.EmptyClass", emptyMap())) assertEquals(0, clazz.nonSyntheticFields.size) assertEquals(2, clazz.nonSyntheticMethods.size) // get, toString @@ -34,8 +34,8 @@ class ClassCarpenterTest { clazz.getDeclaredConstructor().newInstance() } - @Test - fun prims() { + @Test(timeout=300_000) + fun prims() { val clazz = cc.build(ClassSchema( "gen.Prims", mapOf( @@ -82,15 +82,15 @@ class ClassCarpenterTest { return Pair(clazz, i) } - @Test - fun objs() { + @Test(timeout=300_000) + fun objs() { val (clazz, i) = genPerson() assertEquals("Mike", clazz.getMethod("getName").invoke(i)) assertEquals("Mike", (i as SimpleFieldAccess)["name"]) } - @Test - fun `generated toString`() { + @Test(timeout=300_000) + fun `generated toString`() { val (_, i) = genPerson() assertEquals("Person{age=32, name=Mike}", i.toString()) } @@ -101,8 +101,8 @@ class ClassCarpenterTest { cc.build(ClassSchema("gen.EmptyClass", emptyMap())) } - @Test - fun `can refer to each other`() { + @Test(timeout=300_000) + fun `can refer to each other`() { val (clazz1, i) = genPerson() val clazz2 = cc.build(ClassSchema("gen.Referee", mapOf( "ref" to NonNullableField(clazz1) @@ -111,8 +111,8 @@ class ClassCarpenterTest { assertEquals(i, (i2 as SimpleFieldAccess)["ref"]) } - @Test - fun superclasses() { + @Test(timeout=300_000) + fun superclasses() { val schema1 = ClassSchema( "gen.A", mapOf("a" to NonNullableField(String::class.java))) @@ -132,8 +132,8 @@ class ClassCarpenterTest { /** * Tests the fix for [Corda-1945](https://r3-cev.atlassian.net/secure/RapidBoard.jspa?rapidView=83&modal=detail&selectedIssue=CORDA-1945) */ - @Test - fun `superclasses with double-size primitive constructor parameters`() { + @Test(timeout=300_000) + fun `superclasses with double-size primitive constructor parameters`() { val schema1 = ClassSchema( "gen.A", mapOf("a" to NonNullableField(Long::class.javaPrimitiveType!!))) @@ -150,8 +150,8 @@ class ClassCarpenterTest { assertEquals("B{a=1, b=xb}", i.toString()) } - @Test - fun interfaces() { + @Test(timeout=300_000) + fun interfaces() { val schema1 = ClassSchema( "gen.A", mapOf("a" to NonNullableField(String::class.java))) @@ -167,8 +167,8 @@ class ClassCarpenterTest { assertEquals(1, i.b) } - @Test - fun `unimplemented interface method with lenient = false`() { + @Test(timeout=300_000) + fun `unimplemented interface method with lenient = false`() { val schemaA = ClassSchema( "gen.A", mapOf("a" to NonNullableField(String::class.java))) @@ -182,8 +182,8 @@ class ClassCarpenterTest { assertThatExceptionOfType(InterfaceMismatchException::class.java).isThrownBy { cc.build(schemaB) } } - @Test - fun `unimplemented interface method with lenient = true`() { + @Test(timeout=300_000) + fun `unimplemented interface method with lenient = true`() { val cc = ClassCarpenterImpl(whitelist = AllWhitelist, lenient = true) val schemaA = ClassSchema( @@ -203,8 +203,8 @@ class ClassCarpenterTest { assertThatExceptionOfType(AbstractMethodError::class.java).isThrownBy { b.b } } - @Test - fun `generate interface`() { + @Test(timeout=300_000) + fun `generate interface`() { val schema1 = InterfaceSchema( "gen.Interface", mapOf("a" to NonNullableField(Int::class.java))) @@ -228,8 +228,8 @@ class ClassCarpenterTest { assertEquals(testA, i["a"]) } - @Test - fun `generate multiple interfaces`() { + @Test(timeout=300_000) + fun `generate multiple interfaces`() { val iFace1 = InterfaceSchema( "gen.Interface1", mapOf( @@ -264,8 +264,8 @@ class ClassCarpenterTest { assertEquals(testD, i["d"]) } - @Test - fun `interface implementing interface`() { + @Test(timeout=300_000) + fun `interface implementing interface`() { val iFace1 = InterfaceSchema( "gen.Interface1", mapOf( @@ -323,8 +323,8 @@ class ClassCarpenterTest { cc.build(schema) } - @Test - fun `nullable parameter integer`() { + @Test(timeout=300_000) + fun `nullable parameter integer`() { val className = "iEnjoyWibble" val schema = ClassSchema( "gen.$className", @@ -338,8 +338,8 @@ class ClassCarpenterTest { clazz.constructors[0].newInstance(a2) } - @Test - fun `non nullable parameter integer with non null`() { + @Test(timeout=300_000) + fun `non nullable parameter integer with non null`() { val className = "iEnjoyWibble" val schema = ClassSchema( "gen.$className", @@ -364,8 +364,8 @@ class ClassCarpenterTest { clazz.constructors[0].newInstance(a) } - @Test - fun `int array`() { + @Test(timeout=300_000) + fun `int array`() { val className = "iEnjoyPotato" val schema = ClassSchema( "gen.$className", @@ -396,8 +396,8 @@ class ClassCarpenterTest { clazz.constructors[0].newInstance(a) } - @Test - fun `integer array`() { + @Test(timeout=300_000) + fun `integer array`() { val className = "iEnjoyFlan" val schema = ClassSchema( "gen.$className", @@ -414,8 +414,8 @@ class ClassCarpenterTest { assertEquals("$className{a=[1, 2, 3]}", i.toString()) } - @Test - fun `int array with ints`() { + @Test(timeout=300_000) + fun `int array with ints`() { val className = "iEnjoyCrumble" val schema = ClassSchema( "gen.$className", mapOf( @@ -433,8 +433,8 @@ class ClassCarpenterTest { assertEquals("$className{a=2, b=[4, 8], c=16}", i.toString()) } - @Test - fun `multiple int arrays`() { + @Test(timeout=300_000) + fun `multiple int arrays`() { val className = "iEnjoyJam" val schema = ClassSchema( "gen.$className", mapOf( @@ -454,8 +454,8 @@ class ClassCarpenterTest { assertEquals("$className{a=[1, 2], b=3, c=[4, 5, 6]}", i.toString()) } - @Test - fun `string array`() { + @Test(timeout=300_000) + fun `string array`() { val className = "iEnjoyToast" val schema = ClassSchema( "gen.$className", @@ -471,8 +471,8 @@ class ClassCarpenterTest { assertEquals("jam", arr[2]) } - @Test - fun `string arrays`() { + @Test(timeout=300_000) + fun `string arrays`() { val className = "iEnjoyToast" val schema = ClassSchema( "gen.$className", @@ -499,8 +499,8 @@ class ClassCarpenterTest { assertEquals("some fries", arr2[1]) } - @Test - fun `nullable sets annotations`() { + @Test(timeout=300_000) + fun `nullable sets annotations`() { val className = "iEnjoyJam" val schema = ClassSchema( "gen.$className", @@ -520,8 +520,8 @@ class ClassCarpenterTest { assertEquals(Nonnull::class.java, clazz.getMethod("getB").annotations[0].annotationClass.java) } - @Test - fun beanTest() { + @Test(timeout=300_000) + fun beanTest() { val schema = ClassSchema( "pantsPantsPants", mapOf("a" to NonNullableField(Integer::class.java))) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterWhitelistTest.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterWhitelistTest.kt index 756e4790c5..05990c78f3 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterWhitelistTest.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenterWhitelistTest.kt @@ -11,8 +11,8 @@ class ClassCarpenterWhitelistTest { // whitelisting a class on the class path will mean we will carpente up a class that // contains it as a member - @Test - fun whitelisted() { + @Test(timeout=300_000) + fun whitelisted() { data class A(val a: Int) class WL : ClassWhitelist { @@ -31,8 +31,8 @@ class ClassCarpenterWhitelistTest { cc.build(ClassSchema("thing", mapOf("a" to NonNullableField(A::class.java)))) } - @Test - @Ignore("Currently the carpenter doesn't inspect it's whitelist so will carpent anything" + + @Test(timeout=300_000) +@Ignore("Currently the carpenter doesn't inspect it's whitelist so will carpent anything" + "it's asked relying on the serializer factory to not ask for anything") fun notWhitelisted() { data class A(val a: Int) @@ -51,8 +51,8 @@ class ClassCarpenterWhitelistTest { // despite now being whitelisted and on the class path, we will carpent this because // it's marked as CordaSerializable - @Test - fun notWhitelistedButAnnotated() { + @Test(timeout=300_000) + fun notWhitelistedButAnnotated() { @CordaSerializable data class A(val a: Int) @@ -68,8 +68,8 @@ class ClassCarpenterWhitelistTest { cc.build(ClassSchema("thing", mapOf("a" to NonNullableField(A::class.java)))) } - @Test - @Ignore("Currently the carpenter doesn't inspect it's whitelist so will carpent anything" + + @Test(timeout=300_000) +@Ignore("Currently the carpenter doesn't inspect it's whitelist so will carpent anything" + "it's asked relying on the serializer factory to not ask for anything") fun notWhitelistedButCarpented() { // just have the white list reject *Everything* except ints diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CompositeMemberCompositeSchemaToClassCarpenterTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CompositeMemberCompositeSchemaToClassCarpenterTests.kt index 4b5bbe94b2..1c8e1bc7d2 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CompositeMemberCompositeSchemaToClassCarpenterTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/CompositeMemberCompositeSchemaToClassCarpenterTests.kt @@ -16,8 +16,8 @@ interface I_ { class CompositeMembers : AmqpCarpenterBase(AllWhitelist) { - @Test - fun parentIsUnknown() { + @Test(timeout=300_000) + fun parentIsUnknown() { @CordaSerializable data class A(val a: Int) @@ -30,8 +30,8 @@ class CompositeMembers : AmqpCarpenterBase(AllWhitelist) { assertCanLoadAll(testSerializationContext, envelope.getMangled()) } - @Test - fun bothAreUnknown() { + @Test(timeout=300_000) + fun bothAreUnknown() { @CordaSerializable data class A(override val a: Int) : I_ @@ -46,8 +46,8 @@ class CompositeMembers : AmqpCarpenterBase(AllWhitelist) { envelope.getMangled().mangle(), envelope.getMangled()) } - @Test - fun oneIsUnknown() { + @Test(timeout=300_000) + fun oneIsUnknown() { @CordaSerializable data class A(override val a: Int) : I_ @@ -63,8 +63,8 @@ class CompositeMembers : AmqpCarpenterBase(AllWhitelist) { } // See https://github.com/corda/corda/issues/4107 - @Test - fun withUUID() { + @Test(timeout=300_000) + fun withUUID() { @CordaSerializable data class IOUStateData( val value: Int, @@ -79,8 +79,8 @@ class CompositeMembers : AmqpCarpenterBase(AllWhitelist) { assertEquals(uuid, instance.get("ref")) } - @Test - fun mapWithUnknown() { + @Test(timeout=300_000) + fun mapWithUnknown() { data class C(val a: Int) data class D(val m: Map) val (_, envelope) = D(mapOf("c" to C(1))).roundTrip() @@ -96,8 +96,8 @@ class CompositeMembers : AmqpCarpenterBase(AllWhitelist) { assertCanLoadAll(testSerializationContext, infoForD, mangledMap, mangledC) } - @Test - fun parameterisedNonCollectionWithUnknown() { + @Test(timeout=300_000) + fun parameterisedNonCollectionWithUnknown() { data class C(val a: Int) data class NotAMap(val key: K, val value: V) data class D(val m: NotAMap) diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/EnumClassTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/EnumClassTests.kt index be1ba6fb7b..02092e6416 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/EnumClassTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/EnumClassTests.kt @@ -7,8 +7,8 @@ import kotlin.test.assertTrue class EnumClassTests : AmqpCarpenterBase(AllWhitelist) { - @Test - fun oneValue() { + @Test(timeout=300_000) + fun oneValue() { val enumConstants = mapOf("A" to EnumField()) val schema = EnumSchema("gen.enum", enumConstants) @@ -16,8 +16,8 @@ class EnumClassTests : AmqpCarpenterBase(AllWhitelist) { assertTrue(cc.build(schema).isEnum) } - @Test - fun oneValueInstantiate() { + @Test(timeout=300_000) + fun oneValueInstantiate() { val enumConstants = mapOf("A" to EnumField()) val schema = EnumSchema("gen.enum", enumConstants) val clazz = cc.build(schema) @@ -29,8 +29,8 @@ class EnumClassTests : AmqpCarpenterBase(AllWhitelist) { assertEquals("A", (clazz.enumConstants.first() as Enum<*>).name) } - @Test - fun twoValuesInstantiate() { + @Test(timeout=300_000) + fun twoValuesInstantiate() { val enumConstants = mapOf("left" to EnumField(), "right" to EnumField()) val schema = EnumSchema("gen.enum", enumConstants) val clazz = cc.build(schema) @@ -47,8 +47,8 @@ class EnumClassTests : AmqpCarpenterBase(AllWhitelist) { assertEquals("right", right.name) } - @Test - fun manyValues() { + @Test(timeout=300_000) + fun manyValues() { val enumConstants = listOf("AAA", "BBB", "CCC", "DDD", "EEE", "FFF", "GGG", "HHH", "III", "JJJ").associateBy({ it }, { EnumField() }) val schema = EnumSchema("gen.enum", enumConstants) @@ -65,8 +65,8 @@ class EnumClassTests : AmqpCarpenterBase(AllWhitelist) { } } - @Test - fun assignment() { + @Test(timeout=300_000) + fun assignment() { val enumConstants = listOf("AAA", "BBB", "CCC", "DDD", "EEE", "FFF").associateBy({ it }, { EnumField() }) val schema = EnumSchema("gen.enum", enumConstants) val clazz = cc.build(schema) @@ -83,8 +83,8 @@ class EnumClassTests : AmqpCarpenterBase(AllWhitelist) { // if anything goes wrong with this test it's going to end up throwing *some* // exception, hence the lack of asserts - @Test - fun assignAndTest() { + @Test(timeout=300_000) + fun assignAndTest() { val cc2 = ClassCarpenterImpl(whitelist = AllWhitelist) val schema1 = EnumSchema("gen.enum", diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/InheritanceSchemaToClassCarpenterTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/InheritanceSchemaToClassCarpenterTests.kt index d066315340..89dd6ccb1f 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/InheritanceSchemaToClassCarpenterTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/InheritanceSchemaToClassCarpenterTests.kt @@ -35,8 +35,8 @@ interface IIII { } class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { - @Test - fun interfaceParent1() { + @Test(timeout=300_000) + fun interfaceParent1() { class A(override val j: Int) : J val (_, env) = A(20).roundTrip() @@ -51,8 +51,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(20, asJ.j) } - @Test - fun interfaceParent2() { + @Test(timeout=300_000) + fun interfaceParent2() { @Suppress("UNUSED") class A(override val j: Int, val jj: Int) : J @@ -67,8 +67,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(23, asJ.j) } - @Test - fun multipleInterfaces() { + @Test(timeout=300_000) + fun multipleInterfaces() { class A(override val i: Int, override val ii: Int) : I, II val (_, env) = A(23, 42).roundTrip() @@ -85,8 +85,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(42, ii.ii) } - @Test - fun nestedInterfaces() { + @Test(timeout=300_000) + fun nestedInterfaces() { class A(override val i: Int, override val iii: Int) : III val (_, env) = A(23, 42).roundTrip() @@ -104,8 +104,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(42, iii.iii) } - @Test - fun memberInterface() { + @Test(timeout=300_000) + fun memberInterface() { class A(override val i: Int) : I class B(override val i: I, override val iiii: Int) : IIII @@ -121,8 +121,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { assertEquals(42, iiii.iiii) } - @Test - fun memberInterface2() { + @Test(timeout=300_000) + fun memberInterface2() { class A(override val i: Int) : I val (_, env) = A(23).roundTrip() @@ -134,8 +134,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { env.getMangled().mangle()) } } - @Test - fun interfaceAndImplementation() { + @Test(timeout=300_000) + fun interfaceAndImplementation() { class A(override val i: Int) : I val (_, env) = A(23).roundTrip() @@ -144,8 +144,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { assertCanLoadAll(testSerializationContext, env.getMangled().mangle(), env.getMangled()) } - @Test - fun twoInterfacesAndImplementation() { + @Test(timeout=300_000) + fun twoInterfacesAndImplementation() { class A(override val i: Int, override val ii: Int) : I, II val (_, env) = A(23, 42).roundTrip() @@ -157,8 +157,8 @@ class InheritanceSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { ) } - @Test - fun nestedInterfacesAndImplementation() { + @Test(timeout=300_000) + fun nestedInterfacesAndImplementation() { class A(override val i: Int, override val iii: Int) : III val (_, env) = A(23, 42).roundTrip() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/MultiMemberCompositeSchemaToClassCarpenterTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/MultiMemberCompositeSchemaToClassCarpenterTests.kt index 7174c6a04a..8c271e99fd 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/MultiMemberCompositeSchemaToClassCarpenterTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/carpenter/MultiMemberCompositeSchemaToClassCarpenterTests.kt @@ -10,8 +10,8 @@ import kotlin.test.assertNotEquals class MultiMemberCompositeSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhitelist) { - @Test - fun anIntAndALong() { + @Test(timeout=300_000) + fun anIntAndALong() { @CordaSerializable data class A(val a: Int, val b: Long) @@ -22,8 +22,8 @@ class MultiMemberCompositeSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhi assertEquals(42L, carpentedInstance.get("b")) } - @Test - fun intAndStr() { + @Test(timeout=300_000) + fun intAndStr() { @CordaSerializable data class A(val a: Int, val b: String) @@ -39,8 +39,8 @@ class MultiMemberCompositeSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhi val doubled: Int } - @Test - fun calculatedValues() { + @Test(timeout=300_000) + fun calculatedValues() { data class C(val i: Int): Parent { @get:SerializableCalculatedProperty val squared = (i * i).toString() @@ -73,8 +73,8 @@ class MultiMemberCompositeSchemaToClassCarpenterTests : AmqpCarpenterBase(AllWhi assertEquals(upcast.doubled, amqpObj.doubled) } - @Test - fun implementingClassDoesNotCalculateValue() { + @Test(timeout=300_000) + fun implementingClassDoesNotCalculateValue() { class C(override val doubled: Int): Parent val (_, env) = C(5).roundTrip() diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/model/ClassCarpentingTypeLoaderTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/model/ClassCarpentingTypeLoaderTests.kt index 4a2ca6c208..ea6b881317 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/model/ClassCarpentingTypeLoaderTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/model/ClassCarpentingTypeLoaderTests.kt @@ -16,8 +16,8 @@ class ClassCarpentingTypeLoaderTests { private val remoteTypeCarpenter = SchemaBuildingRemoteTypeCarpenter(carpenter) private val typeLoader = ClassCarpentingTypeLoader(remoteTypeCarpenter, carpenter.classloader) - @Test - fun `carpent some related classes`() { + @Test(timeout=300_000) + fun `carpent some related classes`() { val addressInformation = RemoteTypeInformation.Composable( "address", typeIdentifierOf("net.corda.test.Address"), diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/model/LocalTypeModelTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/model/LocalTypeModelTests.kt index 99cad64f21..a1ecbe6799 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/model/LocalTypeModelTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/model/LocalTypeModelTests.kt @@ -44,8 +44,8 @@ class LocalTypeModelTests { @Suppress("unused") class NonComposableNested(val collectionHolder: StringKeyedCollectionHolder?, @Suppress("UNUSED_PARAMETER") intArray: IntArray) - @Test - fun `Primitives and collections`() { + @Test(timeout=300_000) + fun `Primitives and collections`() { assertInformation>("CollectionHolder") assertInformation>(""" @@ -87,8 +87,8 @@ class LocalTypeModelTests { class Concrete(a: Array, b: Double, override val c: List>, val d: Int) : Abstract(a, b) - @Test - fun `interfaces and superclasses`() { + @Test(timeout=300_000) + fun `interfaces and superclasses`() { assertInformation>("SuperSuper") assertInformation>("Super: SuperSuper") assertInformation>(""" @@ -118,8 +118,8 @@ class LocalTypeModelTests { override val c: String = a.toString() + b } - @Test - fun `getter setter and calculated properties`() { + @Test(timeout=300_000) + fun `getter setter and calculated properties`() { assertInformation(""" OldStylePojoImpl(): OldStylePojo a (optional): int[] @@ -130,8 +130,8 @@ class LocalTypeModelTests { class AliasingOldStylePojoImpl(override var a: String?, override var b: String, override val c: String): OldStylePojo - @Test - fun `calculated properties aliased by fields in implementing classes`() { + @Test(timeout=300_000) + fun `calculated properties aliased by fields in implementing classes`() { assertInformation(""" AliasingOldStylePojoImpl(a: String?, b: String, c: String): OldStylePojo a (optional): String @@ -151,8 +151,8 @@ class LocalTypeModelTests { class OneMoreTransitivelyNonComposable(val h: String, val i: Exception) class MissingConstructorParameter(val a: String, @Suppress("UNUSED_PARAMETER") b: Exception) - @Test - fun `no unique deserialization constructor creates non-composable type`() { + @Test(timeout=300_000) + fun `no unique deserialization constructor creates non-composable type`() { modelWithoutOpacity.inspect(typeOf()).let { typeInformation -> assertTrue(typeInformation is LocalTypeInformation.NonComposable) typeInformation as LocalTypeInformation.NonComposable @@ -167,8 +167,8 @@ class LocalTypeModelTests { } } - @Test - fun `missing constructor parameters creates non-composable type`() { + @Test(timeout=300_000) + fun `missing constructor parameters creates non-composable type`() { modelWithoutOpacity.inspect(typeOf()).let { typeInformation -> assertTrue(typeInformation is LocalTypeInformation.NonComposable) typeInformation as LocalTypeInformation.NonComposable @@ -183,8 +183,8 @@ class LocalTypeModelTests { } } - @Test - fun `transitive types are non-composable creates non-composable type`() { + @Test(timeout=300_000) + fun `transitive types are non-composable creates non-composable type`() { modelWithoutOpacity.inspect(typeOf()).let { typeInformation -> assertTrue(typeInformation is LocalTypeInformation.NonComposable) typeInformation as LocalTypeInformation.NonComposable diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/model/TypeIdentifierTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/model/TypeIdentifierTests.kt index f4bc6b3f3a..9792b5416f 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/model/TypeIdentifierTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/model/TypeIdentifierTests.kt @@ -8,22 +8,22 @@ import kotlin.test.assertEquals class TypeIdentifierTests { - @Test - fun `primitive types and arrays`() { + @Test(timeout=300_000) + fun `primitive types and arrays`() { assertIdentified(Int::class.javaPrimitiveType!!, "int") assertIdentified("Integer") assertIdentified("int[]") assertIdentified>("Integer[]") } - @Test - fun `erased and unerased`() { + @Test(timeout=300_000) + fun `erased and unerased`() { assertIdentified(List::class.java, "List (erased)") assertIdentified>("List") } - @Test - fun `nested parameterised`() { + @Test(timeout=300_000) + fun `nested parameterised`() { assertIdentified>>("List>") } @@ -33,8 +33,8 @@ class TypeIdentifierTests { class HasStringArray(override val array: Array>): HasArray - @Test - fun `resolved against an owning type`() { + @Test(timeout=300_000) + fun `resolved against an owning type`() { val fieldType = HasArray::class.java.getDeclaredMethod("getArray").genericReturnType assertIdentified(fieldType, "List<*>[]") @@ -43,8 +43,8 @@ class TypeIdentifierTests { TypeIdentifier.forGenericType(fieldType, HasStringArray::class.java).prettyPrint()) } - @Test - fun `roundtrip`() { + @Test(timeout=300_000) + fun `roundtrip`() { assertRoundtrips(Int::class.javaPrimitiveType!!) assertRoundtrips() assertRoundtrips() diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt index fb68e45e90..05a4cfbba2 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt @@ -50,8 +50,8 @@ class DriverTests { } } - @Test - fun `simple node startup and shutdown`() { + @Test(timeout=300_000) + fun `simple node startup and shutdown`() { val handle = driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = DUMMY_REGULATOR_NAME) nodeMustBeUp(node) @@ -59,8 +59,8 @@ class DriverTests { nodeMustBeDown(handle) } - @Test - fun `starting with default notary`() { + @Test(timeout=300_000) + fun `starting with default notary`() { driver { // Make sure the default is a single-node notary val notary = defaultNotaryNode.getOrThrow() @@ -75,8 +75,8 @@ class DriverTests { } } - @Test - fun `default notary is visible when the startNode future completes`() { + @Test(timeout=300_000) + fun `default notary is visible when the startNode future completes`() { // Based on local testing, running this 3 times gives us a high confidence that we'll spot if the feature is not working repeat(3) { driver(DriverParameters(startNodesInProcess = true)) { @@ -86,8 +86,8 @@ class DriverTests { } } - @Test - fun `debug mode enables debug logging level`() { + @Test(timeout=300_000) + fun `debug mode enables debug logging level`() { // Make sure we're using the log4j2 config which writes to the log file val logConfigFile = projectRootDir / "config" / "dev" / "log4j2.xml" assertThat(logConfigFile).isRegularFile() @@ -103,8 +103,8 @@ class DriverTests { } } - @Test - fun `monitoring mode enables jolokia exporting of JMX metrics via HTTP JSON`() { + @Test(timeout=300_000) + fun `monitoring mode enables jolokia exporting of JMX metrics via HTTP JSON`() { driver(DriverParameters(jmxPolicy = JmxPolicy.defaultEnabled(), startNodesInProcess = false, notarySpecs = emptyList())) { val node = startNode(providedName = DUMMY_REGULATOR_NAME).getOrThrow() // request access to some JMX metrics via Jolokia HTTP/JSON @@ -114,8 +114,8 @@ class DriverTests { } } - @Test - fun `started node, which is not waited for in the driver, is shutdown when the driver exits`() { + @Test(timeout=300_000) + fun `started node, which is not waited for in the driver, is shutdown when the driver exits`() { // First check that the process-id file is created by the node on startup, so that we can be sure our check that // it's deleted on shutdown isn't a false-positive. val baseDirectory = driver { @@ -128,8 +128,8 @@ class DriverTests { assertThat(NodeStartup().isNodeRunningAt(baseDirectory)).isTrue() } - @Test - fun `driver rejects multiple nodes with the same name parallel`() { + @Test(timeout=300_000) + fun `driver rejects multiple nodes with the same name parallel`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { val nodes = listOf(newNode(DUMMY_BANK_A_NAME), newNode(DUMMY_BANK_B_NAME), newNode(DUMMY_BANK_A_NAME)) assertThatIllegalArgumentException().isThrownBy { @@ -138,8 +138,8 @@ class DriverTests { } } - @Test - fun `driver rejects multiple nodes with the same organisation name`() { + @Test(timeout=300_000) + fun `driver rejects multiple nodes with the same organisation name`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { newNode(CordaX500Name(commonName = "Notary", organisation = "R3CEV", locality = "New York", country = "US"))().getOrThrow() assertThatIllegalArgumentException().isThrownBy { @@ -148,8 +148,8 @@ class DriverTests { } } - @Test - fun `driver allows reusing names of nodes that have been stopped`() { + @Test(timeout=300_000) + fun `driver allows reusing names of nodes that have been stopped`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList())) { val nodeA = newNode(DUMMY_BANK_A_NAME)().getOrThrow() nodeA.stop() @@ -158,8 +158,8 @@ class DriverTests { } - @Test - fun `driver waits for in-process nodes to finish`() { + @Test(timeout=300_000) + fun `driver waits for in-process nodes to finish`() { fun NodeHandle.stopQuietly() = try { stop() } catch (e: Exception) { diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/FlowStackSnapshotTest.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/FlowStackSnapshotTest.kt index 4ca5c81980..3dc7dce4d5 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/FlowStackSnapshotTest.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/FlowStackSnapshotTest.kt @@ -224,8 +224,8 @@ fun assertFrame(expectedMethod: String, expectedEmpty: Boolean, frame: StackSnap "criteria (specifically: extra objects are introduced to the quasar stack by th Jacoco agent). You can however " + "run these tests via an IDE.") class FlowStackSnapshotTest { - @Test - fun `flowStackSnapshot contains full frames when methods with side effects are called`() { + @Test(timeout=300_000) + fun `flowStackSnapshot contains full frames when methods with side effects are called`() { driver(DriverParameters(startNodesInProcess = true)) { val a = startNode(rpcUsers = listOf(User(Constants.USER, Constants.PASSWORD, setOf(startFlow())))).get() CordaRPCClient(a.rpcAddress).use(Constants.USER, Constants.PASSWORD) { connection -> @@ -239,8 +239,8 @@ class FlowStackSnapshotTest { } } - @Test - fun `flowStackSnapshot contains empty frames when methods with no side effects are called`() { + @Test(timeout=300_000) + fun `flowStackSnapshot contains empty frames when methods with no side effects are called`() { driver(DriverParameters(startNodesInProcess = true)) { val a = startNode(rpcUsers = listOf(User(Constants.USER, Constants.PASSWORD, setOf(startFlow())))).get() CordaRPCClient(a.rpcAddress).use(Constants.USER, Constants.PASSWORD) { connection -> @@ -254,8 +254,8 @@ class FlowStackSnapshotTest { } } - @Test - fun `persistFlowStackSnapshot persists empty frames to a file when methods with no side effects are called`() { + @Test(timeout=300_000) + fun `persistFlowStackSnapshot persists empty frames to a file when methods with no side effects are called`() { driver(DriverParameters(startNodesInProcess = true)) { val a = startNode(rpcUsers = listOf(User(Constants.USER, Constants.PASSWORD, setOf(startFlow())))).get() CordaRPCClient(a.rpcAddress).use(Constants.USER, Constants.PASSWORD) { connection -> @@ -270,8 +270,8 @@ class FlowStackSnapshotTest { } } - @Test - fun `persistFlowStackSnapshot persists multiple snapshots in different files`() { + @Test(timeout=300_000) + fun `persistFlowStackSnapshot persists multiple snapshots in different files`() { driver(DriverParameters(startNodesInProcess = true)) { val a = startNode(rpcUsers = listOf(User(Constants.USER, Constants.PASSWORD, setOf(startFlow())))).get() @@ -284,8 +284,8 @@ class FlowStackSnapshotTest { } } - @Test - fun `flowStackSnapshot object is serializable`() { + @Test(timeout=300_000) + fun `flowStackSnapshot object is serializable`() { val mockNet = MockNetwork(emptyList(), threadPerNode = true) val node = mockNet.createPartyNode() node.registerInitiatedFlow(DummyFlow::class.java) @@ -301,8 +301,8 @@ class FlowStackSnapshotTest { assertNull(thrown) } - @Test - fun `persistFlowStackSnapshot stack traces are aligned with stack objects`() { + @Test(timeout=300_000) + fun `persistFlowStackSnapshot stack traces are aligned with stack objects`() { driver(DriverParameters(startNodesInProcess = true)) { val a = startNode(rpcUsers = listOf(User(Constants.USER, Constants.PASSWORD, setOf(startFlow())))).get() diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/MockNetworkIntegrationTests.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/MockNetworkIntegrationTests.kt index 52ae6cbe69..8de9f6e61d 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/MockNetworkIntegrationTests.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/MockNetworkIntegrationTests.kt @@ -18,8 +18,8 @@ class MockNetworkIntegrationTests { } } - @Test - fun `does not leak non-daemon threads`() { + @Test(timeout=300_000) + fun `does not leak non-daemon threads`() { val quasar = projectRootDir / "lib" / "quasar.jar" assertEquals(0, startJavaProcess(emptyList(), extraJvmArguments = listOf("-javaagent:$quasar")).waitFor()) } diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/InternalMockNetworkIntegrationTests.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/InternalMockNetworkIntegrationTests.kt index 2ae8748215..09aae1a587 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/InternalMockNetworkIntegrationTests.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/InternalMockNetworkIntegrationTests.kt @@ -18,8 +18,8 @@ class InternalMockNetworkIntegrationTests { } } - @Test - fun `does not leak non-daemon threads`() { + @Test(timeout=300_000) + fun `does not leak non-daemon threads`() { val quasar = projectRootDir / "lib" / "quasar.jar" assertEquals(0, startJavaProcess(emptyList(), extraJvmArguments = listOf("-javaagent:$quasar")).waitFor()) } diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/ProcessUtilitiesTests.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/ProcessUtilitiesTests.kt index 5a9d2b3a96..9145839b3e 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/ProcessUtilitiesTests.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/node/internal/ProcessUtilitiesTests.kt @@ -26,8 +26,8 @@ class ProcessUtilitiesTests { } } - @Test - fun `test dummy process can be started`() { + @Test(timeout=300_000) + fun `test dummy process can be started`() { val tmpFile = tempFolder.newFile("${ProcessUtilitiesTests::class.java.simpleName}.txt") val startedProcess = ProcessUtilities.startJavaProcess(listOf(tmpFile.absolutePath)) assertTrue { startedProcess.waitFor(20, TimeUnit.SECONDS) } diff --git a/testing/node-driver/src/test/kotlin/net/corda/testing/node/MockNetworkTest.kt b/testing/node-driver/src/test/kotlin/net/corda/testing/node/MockNetworkTest.kt index 5656d6180c..8a42d7cb70 100644 --- a/testing/node-driver/src/test/kotlin/net/corda/testing/node/MockNetworkTest.kt +++ b/testing/node-driver/src/test/kotlin/net/corda/testing/node/MockNetworkTest.kt @@ -37,8 +37,8 @@ class MockNetworkTest { mockNetwork.stopNodes() } - @Test - fun `with a started node`() { + @Test(timeout=300_000) + fun `with a started node`() { val unstarted = mockNetwork.createUnstartedNode(DUMMY_BANK_A_NAME, forcedID = NODE_ID) assertFalse(unstarted.isStarted) @@ -51,15 +51,15 @@ class MockNetworkTest { assertFailsWith { started.info.identityFromX500Name(DUMMY_BANK_B_NAME) } } - @Test - fun `with an unstarted node`() { + @Test(timeout=300_000) + fun `with an unstarted node`() { val unstarted = mockNetwork.createUnstartedNode(DUMMY_BANK_A_NAME, forcedID = NODE_ID) val ex = assertFailsWith { unstarted.started } assertThat(ex).hasMessage("Node ID=$NODE_ID is not running") } - @Test - fun installCordaService() { + @Test(timeout=300_000) + fun installCordaService() { val unstarted = mockNetwork.createUnstartedNode() assertThat(unstarted.installCordaService(TestService::class.java)).isNotNull() val started = unstarted.start() diff --git a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/CustomCordappTest.kt b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/CustomCordappTest.kt index 9d2c2097a6..fc266a3d0b 100644 --- a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/CustomCordappTest.kt +++ b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/CustomCordappTest.kt @@ -15,8 +15,8 @@ class CustomCordappTest { @JvmField val tempFolder = TemporaryFolder() - @Test - fun `packageAsJar writes out the CorDapp info into the manifest`() { + @Test(timeout=300_000) + fun `packageAsJar writes out the CorDapp info into the manifest`() { val cordapp = cordappWithPackages("net.corda.testing.node.internal").copy(targetPlatformVersion = 123, name = "CustomCordappTest") val jarFile = packageAsJar(cordapp) JarInputStream(jarFile.inputStream()).use { @@ -26,8 +26,8 @@ class CustomCordappTest { } } - @Test - fun `packageAsJar on leaf package`() { + @Test(timeout=300_000) + fun `packageAsJar on leaf package`() { val entries = packageAsJarThenReadBack(cordappWithPackages("net.corda.testing.node.internal")) assertThat(entries).contains( @@ -41,8 +41,8 @@ class CustomCordappTest { assertThat(javaClass.classLoader.getResource("net/corda/testing/node/MockNetworkTest.class")).isNotNull() } - @Test - fun `packageAsJar on package with sub-packages`() { + @Test(timeout=300_000) + fun `packageAsJar on package with sub-packages`() { val entries = packageAsJarThenReadBack(cordappWithPackages("net.corda.testing.node")) assertThat(entries).contains( @@ -52,8 +52,8 @@ class CustomCordappTest { ) } - @Test - fun `packageAsJar on single class`() { + @Test(timeout=300_000) + fun `packageAsJar on single class`() { val entries = packageAsJarThenReadBack(cordappForClasses(InternalMockNetwork::class.java)) assertThat(entries).containsOnly("${InternalMockNetwork::class.java.name.replace('.', '/')}.class") diff --git a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt index 185a3dcaff..5299204c2a 100644 --- a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt +++ b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt @@ -21,8 +21,8 @@ class InternalMockNetworkTests { } } - @Test - fun basics() { + @Test(timeout=300_000) + fun basics() { mockNet = InternalMockNetwork() val node1 = mockNet.createNode() @@ -46,8 +46,8 @@ class InternalMockNetworkTests { assertTrue(Arrays.equals(finalDelivery!!.data.bytes, bits)) } - @Test - fun broadcast() { + @Test(timeout=300_000) + fun broadcast() { mockNet = InternalMockNetwork() val node1 = mockNet.createNode() @@ -67,8 +67,8 @@ class InternalMockNetworkTests { * Tests that unhandled messages in the received queue are skipped and the next message processed, rather than * causing processing to return null as if there was no message. */ - @Test - fun `skip unhandled messages`() { + @Test(timeout=300_000) + fun `skip unhandled messages`() { mockNet = InternalMockNetwork() val node1 = mockNet.createNode() @@ -99,8 +99,8 @@ class InternalMockNetworkTests { assertEquals(2, received) } - @Test - fun `does not leak serialization env if init fails`() { + @Test(timeout=300_000) + fun `does not leak serialization env if init fails`() { val e = Exception("didn't work") assertThatThrownBy { object : InternalMockNetwork(cordappsForAllNodes = emptySet()) { diff --git a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalTestUtilsTest.kt b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalTestUtilsTest.kt index 9219705166..faa1e7b998 100644 --- a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalTestUtilsTest.kt +++ b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalTestUtilsTest.kt @@ -4,8 +4,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.Test class InternalTestUtilsTest { - @Test - fun `test simplifyScanPackages`() { + @Test(timeout=300_000) + fun `test simplifyScanPackages`() { assertThat(simplifyScanPackages(emptyList())).isEmpty() assertThat(simplifyScanPackages(listOf("com.foo.bar"))).containsExactlyInAnyOrder("com.foo.bar") assertThat(simplifyScanPackages(listOf("com.foo", "com.foo"))).containsExactlyInAnyOrder("com.foo") diff --git a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/TestResponseFlowInIsolation.kt b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/TestResponseFlowInIsolation.kt index 7090496772..ce96875ef7 100644 --- a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/TestResponseFlowInIsolation.kt +++ b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/TestResponseFlowInIsolation.kt @@ -61,8 +61,8 @@ class TestResponseFlowInIsolation { } } - @Test - fun test() { + @Test(timeout=300_000) + fun test() { // This method returns the Responder flow object used by node B. // We tell node B to respond to BadInitiator with Responder. val initiatedResponderFlowFuture = b.registerInitiatedFlow(BadInitiator::class.java, Responder::class.java).toFuture() diff --git a/testing/test-cli/src/main/kotlin/net/corda/testing/CliBackwardsCompatibleTest.kt b/testing/test-cli/src/main/kotlin/net/corda/testing/CliBackwardsCompatibleTest.kt index 4390070dc9..b162a1faab 100644 --- a/testing/test-cli/src/main/kotlin/net/corda/testing/CliBackwardsCompatibleTest.kt +++ b/testing/test-cli/src/main/kotlin/net/corda/testing/CliBackwardsCompatibleTest.kt @@ -5,8 +5,8 @@ import org.junit.Test open class CliBackwardsCompatibleTest(val clazz: Class<*>) { - @Test - fun `should always be backwards compatible`() { + @Test(timeout=300_000) + fun `should always be backwards compatible`() { checkBackwardsCompatibility(clazz) } diff --git a/testing/test-cli/src/test/kotlin/net/corda/testing/CommandLineCompatibilityCheckerTest.kt b/testing/test-cli/src/test/kotlin/net/corda/testing/CommandLineCompatibilityCheckerTest.kt index bf3a3cf653..4d0586893d 100644 --- a/testing/test-cli/src/test/kotlin/net/corda/testing/CommandLineCompatibilityCheckerTest.kt +++ b/testing/test-cli/src/test/kotlin/net/corda/testing/CommandLineCompatibilityCheckerTest.kt @@ -17,8 +17,8 @@ class CommandLineCompatibilityCheckerTest { } - @Test - fun `should detect missing parameter`() { + @Test(timeout=300_000) + fun `should detect missing parameter`() { val value1 = object { @CommandLine.Option(names = arrayOf("-d", "--directory"), description = arrayOf("the directory to run in")) var baseDirectory: String? = null @@ -33,8 +33,8 @@ class CommandLineCompatibilityCheckerTest { } - @Test - fun `should detect changes in positional parameters`() { + @Test(timeout=300_000) + fun `should detect changes in positional parameters`() { val value1 = object { @CommandLine.Parameters(index = "0") var baseDirectory: String? = null @@ -52,8 +52,8 @@ class CommandLineCompatibilityCheckerTest { Assert.assertThat(breaks.first(), `is`(instanceOf(PositionalArgumentsChangedError::class.java))) } - @Test - fun `should detect removal of a subcommand`() { + @Test(timeout=300_000) + fun `should detect removal of a subcommand`() { @CommandLine.Command(subcommands = [ListCommand::class, StatusCommand::class]) class Dummy @@ -65,8 +65,8 @@ class CommandLineCompatibilityCheckerTest { Assert.assertThat(breaks.first(), `is`(instanceOf(CommandsChangedError::class.java))) } - @Test - fun `should detect change of parameter type`() { + @Test(timeout=300_000) + fun `should detect change of parameter type`() { val value1 = object { @CommandLine.Option(names = ["--directory"], description = ["the directory to run in"]) var baseDirectory: String? = null @@ -81,8 +81,8 @@ class CommandLineCompatibilityCheckerTest { Assert.assertThat(breaks.first(), `is`(instanceOf(TypesChangedError::class.java))) } - @Test - fun `should detect change of enum options`() { + @Test(timeout=300_000) + fun `should detect change of enum options`() { val value1 = object { @CommandLine.Option(names = ["--directory"], description = ["the directory to run in"]) var baseDirectory: AllOptions? = null diff --git a/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/CommonSerializationTestHelpers.kt b/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/CommonSerializationTestHelpers.kt index 4d26575e3a..20124ce09b 100644 --- a/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/CommonSerializationTestHelpers.kt +++ b/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/CommonSerializationTestHelpers.kt @@ -1,11 +1,19 @@ package net.corda.testing.common.internal import net.corda.core.serialization.internal.SerializationEnvironment -import net.corda.core.serialization.internal._contextSerializationEnv -import net.corda.core.serialization.internal._inheritableContextSerializationEnv +import net.corda.core.serialization.internal._driverSerializationEnv +import org.slf4j.Logger +import org.slf4j.LoggerFactory -fun SerializationEnvironment.asContextEnv(inheritable: Boolean = false, callable: (SerializationEnvironment) -> T): T { - val property = if (inheritable) _inheritableContextSerializationEnv else _contextSerializationEnv +val log: Logger = LoggerFactory.getLogger("TestSerializationRuleHelper") + + +fun SerializationEnvironment.asContextEnv(callable: (SerializationEnvironment) -> T): T { + val property = _driverSerializationEnv + if (property.get() != null) { + log.warn("Environment was not cleared up before previous test") + property.set(null) + } property.set(this) try { return callable(this) diff --git a/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupAMoreTests.kt b/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupAMoreTests.kt index cac013897f..abf22ed8ff 100644 --- a/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupAMoreTests.kt +++ b/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupAMoreTests.kt @@ -5,13 +5,13 @@ import org.junit.jupiter.api.Test @GroupA class GroupAMoreTests { - @Test + @Test() fun setExpectations() { AssertingTestDatabaseContext.addExpectations("groupA", "specialSql1-setup", "specialSql2-setup", "specialSql2-teardown", "specialSql1-teardown") } - @Test + @Test() @SpecialSql1 @SpecialSql2 fun moreSpecialSqlRequired() { diff --git a/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupATests.kt b/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupATests.kt index 40f7f8f1e1..52eb31a11d 100644 --- a/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupATests.kt +++ b/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupATests.kt @@ -7,13 +7,13 @@ import org.junit.jupiter.api.Test class GroupATests { @Test - fun setExpectations() { + fun setExpectations() { AssertingTestDatabaseContext.addExpectations("groupA", "forClassGroupATests-setup", "specialSql1-setup", "specialSql1-teardown", "forClassGroupATests-teardown") } @Test - fun noSpecialSqlRequired() { + fun noSpecialSqlRequired() { } @Test diff --git a/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupBTests.kt b/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupBTests.kt index 9b5cd8d4b8..a8e79a7594 100644 --- a/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupBTests.kt +++ b/testing/test-db/src/test/kotlin/net/corda/testing/internal/db/GroupBTests.kt @@ -5,18 +5,18 @@ import org.junit.jupiter.api.Test @GroupB class GroupBTests { - @Test - fun setExpectations() { + @Test() +fun setExpectations() { AssertingTestDatabaseContext.addExpectations("groupB", "forClassGroupBTests-setup", "specialSql1-setup", "specialSql1-teardown", "forClassGroupBTests-teardown") } - @Test - fun noSpecialSqlRequired() { + @Test() +fun noSpecialSqlRequired() { } - @Test - @SpecialSql1 + @Test() +@SpecialSql1 fun someSpecialSqlRequired() { } } \ No newline at end of file diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/SerializationEnvironmentRule.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/core/SerializationEnvironmentRule.kt index 2a32225876..add3716089 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/core/SerializationEnvironmentRule.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/core/SerializationEnvironmentRule.kt @@ -41,7 +41,7 @@ class SerializationEnvironmentRule(private val inheritable: Boolean = false) : T override fun apply(base: Statement, description: Description): Statement { env = createTestSerializationEnv() return object : Statement() { - override fun evaluate() = env.asTestContextEnv(inheritable) { base.evaluate() } + override fun evaluate() = env.asTestContextEnv { base.evaluate() } } } } diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt index aff3c9e851..c1ad09e30e 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt @@ -59,7 +59,7 @@ class CheckpointSerializationEnvironmentRule(private val inheritable: Boolean = private fun runTask(task: (SerializationEnvironment) -> T): T { try { - return env.asContextEnv(inheritable, task) + return env.asContextEnv(task) } finally { inVMExecutors.remove(env) } diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt index 622ab76245..a9572f62fd 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt @@ -43,9 +43,9 @@ fun createTestSerializationEnv(classLoader: ClassLoader?): SerializationEnvironm ) } -fun SerializationEnvironment.asTestContextEnv(inheritable: Boolean = false, callable: (SerializationEnvironment) -> T): T { +fun SerializationEnvironment.asTestContextEnv(callable: (SerializationEnvironment) -> T): T { try { - return asContextEnv(inheritable, callable) + return asContextEnv(callable) } finally { inVMExecutors.remove(this) } diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt b/testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt index 917309bbb8..72d71f1adc 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt +++ b/testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt @@ -8,16 +8,16 @@ import kotlin.test.assertEquals import kotlin.test.assertNotEquals class TestIdentityTests { - @Test - fun `entropy works`() { + @Test(timeout=300_000) + fun `entropy works`() { val a = TestIdentity(ALICE_NAME, 123) val b = TestIdentity(BOB_NAME, 123) assertEquals(a.publicKey, b.publicKey) assertEquals(a.keyPair.private, b.keyPair.private) } - @Test - fun `fresh works`() { + @Test(timeout=300_000) + fun `fresh works`() { val x = TestIdentity.fresh("xx") val y = TestIdentity.fresh("yy") // The param is called organisation so we'd better use it as such: diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/core/JarSignatureCollectorTest.kt b/testing/test-utils/src/test/kotlin/net/corda/testing/core/JarSignatureCollectorTest.kt index 60b09a3c54..c22083f2e3 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/core/JarSignatureCollectorTest.kt +++ b/testing/test-utils/src/test/kotlin/net/corda/testing/core/JarSignatureCollectorTest.kt @@ -61,8 +61,8 @@ class JarSignatureCollectorTest { assertThat(dir.list()).hasSize(5) } - @Test - fun `empty jar has no signers`() { + @Test(timeout=300_000) + fun `empty jar has no signers`() { (dir / "META-INF").createDirectory() // At least one arg is required, and jar cvf conveniently ignores this. dir.createJar(FILENAME, "META-INF") assertEquals(emptyList(), dir.getJarSigners(FILENAME)) @@ -71,8 +71,8 @@ class JarSignatureCollectorTest { assertEquals(emptyList(), dir.getJarSigners(FILENAME)) // There needs to have been a file for ALICE to sign. } - @Test - fun `unsigned jar has no signers`() { + @Test(timeout=300_000) + fun `unsigned jar has no signers`() { dir.createJar(FILENAME, "_signable1") assertEquals(emptyList(), dir.getJarSigners(FILENAME)) @@ -80,8 +80,8 @@ class JarSignatureCollectorTest { assertEquals(emptyList(), dir.getJarSigners(FILENAME)) } - @Test - fun `one signer`() { + @Test(timeout=300_000) + fun `one signer`() { dir.createJar(FILENAME, "_signable1", "_signable2") val key = signAsAlice() assertEquals(listOf(key), dir.getJarSigners(FILENAME)) @@ -91,8 +91,8 @@ class JarSignatureCollectorTest { assertEquals(listOf(key), dir.getJarSigners(FILENAME)) // Unsigned directory is irrelevant. } - @Test - fun `two signers`() { + @Test(timeout=300_000) + fun `two signers`() { dir.createJar(FILENAME, "_signable1", "_signable2") val key1 = signAsAlice() val key2 = signAsBob() @@ -100,8 +100,8 @@ class JarSignatureCollectorTest { assertEquals(setOf(key1, key2), dir.getJarSigners(FILENAME).toSet()) } - @Test - fun `all files must be signed by the same set of signers`() { + @Test(timeout=300_000) + fun `all files must be signed by the same set of signers`() { dir.createJar(FILENAME, "_signable1") val key1 = signAsAlice() assertEquals(listOf(key1), dir.getJarSigners(FILENAME)) @@ -118,8 +118,8 @@ class JarSignatureCollectorTest { ) { dir.getJarSigners(FILENAME) } } - @Test - fun `bad signature is caught even if the party would not qualify as a signer`() { + @Test(timeout=300_000) + fun `bad signature is caught even if the party would not qualify as a signer`() { (dir / "volatile").writeLines(listOf("volatile")) dir.createJar(FILENAME, "volatile") val key1 = signAsAlice() @@ -134,16 +134,16 @@ class JarSignatureCollectorTest { // Signing with EC algorithm produces META-INF/*.EC file name not compatible with JAR File Spec however it's compatible with java.util.JarVerifier // and our JarSignatureCollector - @Test - fun `one signer with EC algorithm`() { + @Test(timeout=300_000) + fun `one signer with EC algorithm`() { dir.createJar(FILENAME, "_signable1", "_signable2") // JDK11: Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. val key = signAs(CHARLIE, CHARLIE_PASS) assertEquals(listOf(key), dir.getJarSigners(FILENAME)) // We only used CHARLIE's distinguished name, so the keys will be different. } - @Test - fun `jar with jar index file`() { + @Test(timeout=300_000) + fun `jar with jar index file`() { dir.createJar(FILENAME, "_signable1") dir.addIndexList(FILENAME) val key = signAsAlice() diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt b/testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt index b36a5fb6e9..e7ac9a404b 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt +++ b/testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt @@ -7,8 +7,8 @@ import org.junit.Test import kotlin.test.assertEquals class MatcherTests { - @Test - fun `nested items indent`() { + @Test(timeout=300_000) + fun `nested items indent`() { val nestedMap = mapOf( "a" to mapOf( "apple" to "vegetable", diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt b/testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt index 7a03b5b359..dc17245347 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt +++ b/testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt @@ -30,8 +30,8 @@ private interface MySpectator { } class RigorousMockTest { - @Test - fun `toString has a reliable default answer in all cases`() { + @Test(timeout=300_000) + fun `toString has a reliable default answer in all cases`() { Stream.of<(Class) -> Any>(::spectator, ::rigorousMock, ::participant).forEach { profile -> Stream.of(MyInterface::class, MyAbstract::class, MyImpl::class).forEach { type -> val mock = profile(type.java) @@ -40,8 +40,8 @@ class RigorousMockTest { } } - @Test - fun `callRealMethod is preferred by rigorousMock`() { + @Test(timeout=300_000) + fun `callRealMethod is preferred by rigorousMock`() { rigorousMock().let { m -> assertSame(UndefinedMockBehaviorException::class.java, catchThrowable { m.abstractFun() }.javaClass) assertSame(UndefinedMockBehaviorException::class.java, catchThrowable { m.kotlinDefaultFun() }.javaClass) @@ -58,8 +58,8 @@ class RigorousMockTest { } } - @Test - fun `throw exception is preferred by participant`() { + @Test(timeout=300_000) + fun `throw exception is preferred by participant`() { participant().let { m -> assertSame(UndefinedMockBehaviorException::class.java, catchThrowable { m.abstractFun() }.javaClass) assertSame(UndefinedMockBehaviorException::class.java, catchThrowable { m.kotlinDefaultFun() }.javaClass) @@ -76,8 +76,8 @@ class RigorousMockTest { } } - @Test - fun `doing nothing is preferred by spectator`() { + @Test(timeout=300_000) + fun `doing nothing is preferred by spectator`() { val mock: MySpectator = spectator() mock.sideEffect() assertSame(UndefinedMockBehaviorException::class.java, catchThrowable { mock.noClearDefault() }.javaClass) @@ -97,8 +97,8 @@ class RigorousMockTest { private open class CD : AB() private class CDImpl : CD() - @Test - fun `method return type resolution works`() { + @Test(timeout=300_000) + fun `method return type resolution works`() { val m = spectator() assertThat(m.b, isA(Runnable::class.java)) assertSame(UndefinedMockBehaviorException::class.java, catchThrowable { m.a }.javaClass) // Can't mock String. @@ -110,8 +110,8 @@ class RigorousMockTest { fun u(): U = throw UnsupportedOperationException() } - @Test - fun `method return type erasure cases`() { + @Test(timeout=300_000) + fun `method return type erasure cases`() { val m = spectator>() m.t().let { t: Any -> assertFalse(t is RS) diff --git a/testing/testserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt b/testing/testserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt index 0a8e34340d..8d907fd135 100644 --- a/testing/testserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt +++ b/testing/testserver/src/integration-test/kotlin/net/corda/webserver/WebserverDriverTests.kt @@ -27,8 +27,8 @@ class WebserverDriverTests { } } - @Test - fun `starting a node and independent web server works`() { + @Test(timeout=300_000) + fun `starting a node and independent web server works`() { val addr = driver(DriverParameters(notarySpecs = emptyList())) { val node = startNode(providedName = DUMMY_BANK_A_NAME).getOrThrow() val webserverHandle = startWebserver(node).getOrThrow() diff --git a/tools/blobinspector/src/test/kotlin/net/corda/blobinspector/BlobInspectorTest.kt b/tools/blobinspector/src/test/kotlin/net/corda/blobinspector/BlobInspectorTest.kt index 65e1223c4f..210a5e9e11 100644 --- a/tools/blobinspector/src/test/kotlin/net/corda/blobinspector/BlobInspectorTest.kt +++ b/tools/blobinspector/src/test/kotlin/net/corda/blobinspector/BlobInspectorTest.kt @@ -16,8 +16,8 @@ import java.nio.charset.StandardCharsets.UTF_8 class BlobInspectorTest { private val blobInspector = BlobInspector() - @Test - fun `network-parameters file`() { + @Test(timeout=300_000) + fun `network-parameters file`() { val output = run("network-parameters") assertThat(output) .startsWith(SignedDataWithCert::class.java.name) @@ -25,8 +25,8 @@ class BlobInspectorTest { .contains(CordaX500Name("Notary Service", "Zurich", "CH").toString()) // Name of the notary in the network parameters } - @Test - fun `node-info file`() { + @Test(timeout=300_000) + fun `node-info file`() { checkNotOnClassPath("net.corda.nodeapi.internal.SignedNodeInfo") val output = run("node-info") assertThat(output) @@ -34,8 +34,8 @@ class BlobInspectorTest { .contains(CordaX500Name("BankOfCorda", "New York", "US").toString()) } - @Test - fun `WireTransaction with Cash state`() { + @Test(timeout=300_000) + fun `WireTransaction with Cash state`() { checkNotOnClassPath("net.corda.finance.contracts.asset.Cash\$State") val output = run("cash-wtx.blob") assertThat(output) @@ -43,8 +43,8 @@ class BlobInspectorTest { .contains("net.corda.finance.contracts.asset.Cash\$State") } - @Test - fun `SignedTransaction with Cash state taken from node db`() { + @Test(timeout=300_000) + fun `SignedTransaction with Cash state taken from node db`() { checkNotOnClassPath("net.corda.finance.contracts.asset.Cash\$State") val output = run("cash-stx-db.blob") assertThat(output) diff --git a/tools/bootstrapper/src/test/kotlin/net/corda/bootstrapper/NetworkBootstrapperRunnerTests.kt b/tools/bootstrapper/src/test/kotlin/net/corda/bootstrapper/NetworkBootstrapperRunnerTests.kt index f893e3373a..9336327436 100644 --- a/tools/bootstrapper/src/test/kotlin/net/corda/bootstrapper/NetworkBootstrapperRunnerTests.kt +++ b/tools/bootstrapper/src/test/kotlin/net/corda/bootstrapper/NetworkBootstrapperRunnerTests.kt @@ -87,16 +87,16 @@ class NetworkBootstrapperRunnerTests { return Pair(NetworkBootstrapperRunner(mockBootstrapper), mockBootstrapper) } - @Test - fun `test when defaults are run bootstrapper is called correctly`() { + @Test(timeout=300_000) + fun `test when defaults are run bootstrapper is called correctly`() { val (runner, mockBootstrapper) = getRunner() val exitCode = runner.runProgram() verify(mockBootstrapper).bootstrap(Paths.get(".").toAbsolutePath().normalize(), CopyCordapps.FirstRunOnly, NetworkParametersOverrides()) assertEquals(0, exitCode) } - @Test - fun `test when base directory is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when base directory is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() val tempDir = createTempDir() runner.dir = tempDir.toPath() @@ -105,8 +105,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when no copy flag is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when no copy flag is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() runner.noCopy = true val exitCode = runner.runProgram() @@ -114,8 +114,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when copy cordapps is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when copy cordapps is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() runner.copyCordapps = CopyCordapps.No val exitCode = runner.runProgram() @@ -123,8 +123,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when min platform version is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when min platform version is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() runner.minimumPlatformVersion = 1 val exitCode = runner.runProgram() @@ -132,16 +132,16 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when min platform version is invalid it fails to run with a sensible error message`() { + @Test(timeout=300_000) + fun `test when min platform version is invalid it fails to run with a sensible error message`() { val runner = getRunner().first runner.minimumPlatformVersion = 0 val exception = assertFailsWith { runner.runProgram() } assertEquals("The --minimum-platform-version parameter must be at least 1", exception.message) } - @Test - fun `test when max message size is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when max message size is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() runner.maxMessageSize = 1 val exitCode = runner.runProgram() @@ -149,16 +149,16 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when max message size is invalid it fails to run with a sensible error message`() { + @Test(timeout=300_000) + fun `test when max message size is invalid it fails to run with a sensible error message`() { val runner = getRunner().first runner.maxMessageSize = 0 val exception = assertFailsWith { runner.runProgram() } assertEquals("The --max-message-size parameter must be at least 1", exception.message) } - @Test - fun `test when max transaction size is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when max transaction size is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() runner.maxTransactionSize = 1 val exitCode = runner.runProgram() @@ -166,16 +166,16 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when max transaction size is invalid it fails to run with a sensible error message`() { + @Test(timeout=300_000) + fun `test when max transaction size is invalid it fails to run with a sensible error message`() { val runner = getRunner().first runner.maxTransactionSize = 0 val exception = assertFailsWith { runner.runProgram() } assertEquals("The --max-transaction-size parameter must be at least 1", exception.message) } - @Test - fun `test when event horizon is specified it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when event horizon is specified it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() runner.eventHorizon = 7.days val exitCode = runner.runProgram() @@ -183,16 +183,16 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when event horizon is invalid it fails to run with a sensible error message`() { + @Test(timeout=300_000) + fun `test when event horizon is invalid it fails to run with a sensible error message`() { val runner = getRunner().first runner.eventHorizon = (-7).days val exception = assertFailsWith { runner.runProgram() } assertEquals("The --event-horizon parameter must be a positive value", exception.message) } - @Test - fun `test when a network parameters is specified the values are passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when a network parameters is specified the values are passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() val conf = correctNetworkFile.copyToTestDir() runner.networkParametersFile = conf @@ -206,8 +206,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when a package is specified in the network parameters file it is passed through to the bootstrapper`() { + @Test(timeout=300_000) + fun `test when a package is specified in the network parameters file it is passed through to the bootstrapper`() { val (runner, mockBootstrapper) = getRunner() val conf = aliceConfigFile.copyToTestDir() runner.networkParametersFile = conf @@ -218,8 +218,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when a package is specified in the network parameters file it is passed through to the bootstrapper EC`() { + @Test(timeout=300_000) + fun `test when a package is specified in the network parameters file it is passed through to the bootstrapper EC`() { val (runner, mockBootstrapper) = getRunner() val conf = aliceConfigFile.copyToTestDir(dirAliceEC) runner.networkParametersFile = conf @@ -230,8 +230,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when a package is specified in the network parameters file it is passed through to the bootstrapper DSA`() { + @Test(timeout=300_000) + fun `test when a package is specified in the network parameters file it is passed through to the bootstrapper DSA`() { val (runner, mockBootstrapper) = getRunner() val conf = aliceConfigFile.copyToTestDir(dirAliceDSA) runner.networkParametersFile = conf @@ -242,8 +242,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(0, exitCode) } - @Test - fun `test when packages overlap that the bootstrapper fails with a sensible message`() { + @Test(timeout=300_000) + fun `test when packages overlap that the bootstrapper fails with a sensible message`() { val (runner, _) = getRunner() val conf = packageOverlapConfigFile.copyToTestDir() runner.networkParametersFile = conf @@ -253,8 +253,8 @@ class NetworkBootstrapperRunnerTests { assertEquals(1, exitCode) } - @Test - fun `test when keyfile does not exist then bootstrapper fails with a sensible message`() { + @Test(timeout=300_000) + fun `test when keyfile does not exist then bootstrapper fails with a sensible message`() { val (runner, _) = getRunner() runner.networkParametersFile = dirAlice / "filename-that-doesnt-exist" val exception = assertFailsWith { runner.runProgram() } diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/model/JVMConfigTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/model/JVMConfigTest.kt index 9e47e7736b..c66c850b45 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/model/JVMConfigTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/model/JVMConfigTest.kt @@ -10,30 +10,30 @@ import kotlin.test.assertEquals class JVMConfigTest { private val jvm = JVMConfig() - @Test - fun `test Java path`() { + @Test(timeout=300_000) + fun `test Java path`() { assertThat(jvm.javaPath.onFileSystem()).isExecutable() } - @Test - fun `test application directory`() { + @Test(timeout=300_000) + fun `test application directory`() { assertThat(jvm.applicationDir).isDirectory() } - @Test - fun `test user home`() { + @Test(timeout=300_000) + fun `test user home`() { assertThat(jvm.userHome).isDirectory() } - @Test - fun `test command for Jar`() { + @Test(timeout=300_000) + fun `test command for Jar`() { val command = jvm.commandFor(Paths.get("testapp.jar"), "arg1", "arg2") val java = jvm.javaPath assertEquals(listOf(java.toString(), "-jar", "testapp.jar", "arg1", "arg2"), command) } - @Test - fun `test process for Jar`() { + @Test(timeout=300_000) + fun `test process for Jar`() { val process = jvm.processFor(Paths.get("testapp.jar"), "arg1", "arg2", "arg3") val java = jvm.javaPath assertEquals(listOf(java.toString(), "-jar", "testapp.jar", "arg1", "arg2", "arg3"), process.command()) diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt index 742bcfe543..e63c9a6ad6 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt @@ -22,8 +22,8 @@ class NodeConfigTest { private val myLegalName = CordaX500Name(organisation = "My Name", locality = "New York", country = "US") } - @Test - fun `reading node configuration`() { + @Test(timeout=300_000) + fun `reading node configuration`() { val config = createConfig( legalName = myLegalName, p2pPort = 10001, @@ -53,8 +53,8 @@ class NodeConfigTest { assertFalse(fullConfig.detectPublicIp) } - @Test - fun `reading node configuration allows systemProperties and custom`() { + @Test(timeout=300_000) + fun `reading node configuration allows systemProperties and custom`() { val config = createConfig( legalName = myLegalName, p2pPort = 10001, @@ -86,8 +86,8 @@ class NodeConfigTest { assertFalse(fullConfig.detectPublicIp) } - @Test - fun `reading node configuration with currencies`() { + @Test(timeout=300_000) + fun `reading node configuration with currencies`() { val config = createConfig( legalName = myLegalName, p2pPort = 10001, @@ -102,8 +102,8 @@ class NodeConfigTest { assertEquals(listOf("GBP"), config.financeConf().getStringList("issuableCurrencies")) } - @Test - fun `reading webserver configuration`() { + @Test(timeout=300_000) + fun `reading webserver configuration`() { val config = createConfig( legalName = myLegalName, p2pPort = 10001, diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeControllerTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeControllerTest.kt index 703c424a07..d6f407cbd5 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeControllerTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeControllerTest.kt @@ -15,32 +15,32 @@ class NodeControllerTest { private val node1Name = "Organisation 1" private val organisation2Name = "Organisation 2" - @Test - fun `test unique nodes after validate`() { + @Test(timeout=300_000) + fun `test unique nodes after validate`() { val data = NodeData() data.legalName.value = node1Name assertNotNull(controller.validate(data)) assertNull(controller.validate(data)) } - @Test - fun `register notary`() { + @Test(timeout=300_000) + fun `register notary`() { assertFalse(controller.hasNotary()) val config = createConfig(organisation = "Name", notary = NotaryService(false)) controller.register(config) assertTrue(controller.hasNotary()) } - @Test - fun `register non notary`() { + @Test(timeout=300_000) + fun `register non notary`() { assertFalse(controller.hasNotary()) val config = createConfig(organisation = "Name") controller.register(config) assertFalse(controller.hasNotary()) } - @Test - fun `test unique key after validate`() { + @Test(timeout=300_000) + fun `test unique key after validate`() { val data = NodeData() data.legalName.value = node1Name @@ -49,8 +49,8 @@ class NodeControllerTest { assertTrue(controller.keyExists("organisation1")) } - @Test - fun `test matching name after validate`() { + @Test(timeout=300_000) + fun `test matching name after validate`() { val data = NodeData() data.legalName.value = node1Name @@ -63,8 +63,8 @@ class NodeControllerTest { assertTrue(controller.nameExists("organisation 1")) } - @Test - fun `test node system properties`() { + @Test(timeout=300_000) + fun `test node system properties`() { val data = NodeData() data.legalName.value = node1Name @@ -74,23 +74,23 @@ class NodeControllerTest { assertFalse(systemProperties["co.paralleluniverse.fibers.verifyInstrumentation"] as Boolean) } - @Test - fun `test register unique nodes`() { + @Test(timeout=300_000) + fun `test register unique nodes`() { val config = createConfig(organisation = organisation2Name) assertTrue(controller.register(config)) assertFalse(controller.register(config)) } - @Test - fun `test unique key after register`() { + @Test(timeout=300_000) + fun `test unique key after register`() { val config = createConfig(organisation = organisation2Name) assertFalse(controller.keyExists("organisation2")) controller.register(config) assertTrue(controller.keyExists("organisation2")) } - @Test - fun `test matching name after register`() { + @Test(timeout=300_000) + fun `test matching name after register`() { val config = createConfig(organisation = organisation2Name) assertFalse(controller.nameExists("Organisation 2")) assertFalse(controller.nameExists("Organisation2")) @@ -101,16 +101,16 @@ class NodeControllerTest { assertTrue(controller.nameExists("organisation 2")) } - @Test - fun `test valid ports`() { + @Test(timeout=300_000) + fun `test valid ports`() { assertFalse(controller.isPortValid(NodeController.minPort - 1)) assertTrue(controller.isPortValid(NodeController.minPort)) assertTrue(controller.isPortValid(NodeController.maxPort)) assertFalse(controller.isPortValid(NodeController.maxPort + 1)) } - @Test - fun `test P2P port is max`() { + @Test(timeout=300_000) + fun `test P2P port is max`() { val portNumber = NodeController.firstPort + 1234 val config = createConfig(p2pPort = portNumber) assertEquals(NodeController.firstPort, controller.nextPort) @@ -118,8 +118,8 @@ class NodeControllerTest { assertEquals(portNumber + 1, controller.nextPort) } - @Test - fun `test rpc port is max`() { + @Test(timeout=300_000) + fun `test rpc port is max`() { val portNumber = NodeController.firstPort + 7777 val config = createConfig(rpcPort = portNumber) assertEquals(NodeController.firstPort, controller.nextPort) @@ -127,8 +127,8 @@ class NodeControllerTest { assertEquals(portNumber + 1, controller.nextPort) } - @Test - fun `test web port is max`() { + @Test(timeout=300_000) + fun `test web port is max`() { val portNumber = NodeController.firstPort + 2356 val config = createConfig(webPort = portNumber) assertEquals(NodeController.firstPort, controller.nextPort) @@ -136,8 +136,8 @@ class NodeControllerTest { assertEquals(portNumber + 1, controller.nextPort) } - @Test - fun `test H2 port is max`() { + @Test(timeout=300_000) + fun `test H2 port is max`() { val portNumber = NodeController.firstPort + 3478 val config = createConfig(h2port = portNumber) assertEquals(NodeController.firstPort, controller.nextPort) @@ -145,8 +145,8 @@ class NodeControllerTest { assertEquals(portNumber + 1, controller.nextPort) } - @Test - fun `dispose node`() { + @Test(timeout=300_000) + fun `dispose node`() { val config = createConfig(organisation = "MyName") controller.register(config) diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt index 0f50441e86..62fb3d3ef6 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt @@ -24,22 +24,22 @@ class ZeroFilterTest { verify(process).outputStream } - @Test - fun `non-zero is OK`() { + @Test(timeout=300_000) + fun `non-zero is OK`() { for (c in 'A'..'Z') { filter.write(c.toInt()) } assertEquals(26, output.size()) } - @Test - fun `zero is removed`() { + @Test(timeout=300_000) + fun `zero is removed`() { filter.write(0) assertEquals(0, output.size()) } - @Test - fun `zero is removed from array`() { + @Test(timeout=300_000) + fun `zero is removed from array`() { val input = "He\u0000l\u0000lo".toByteArray(UTF_8) filter.write(input) @@ -47,8 +47,8 @@ class ZeroFilterTest { assertEquals("Hello", output.toString("UTF-8")) } - @Test - fun `zero is removed starting from offset`() { + @Test(timeout=300_000) + fun `zero is removed starting from offset`() { val input = "H\u0000el\u0000lo W\u0000or\u0000ld!\u0000".toByteArray(UTF_8) val offset = input.indexOf('W'.toByte()) filter.write(input, offset, input.size - offset) diff --git a/tools/explorer/src/test/kotlin/net/corda/explorer/model/SettingsModelTest.kt b/tools/explorer/src/test/kotlin/net/corda/explorer/model/SettingsModelTest.kt index df66ec83f7..0a5dbfaebd 100644 --- a/tools/explorer/src/test/kotlin/net/corda/explorer/model/SettingsModelTest.kt +++ b/tools/explorer/src/test/kotlin/net/corda/explorer/model/SettingsModelTest.kt @@ -14,8 +14,8 @@ class SettingsModelTest { @JvmField val tempFolder: TemporaryFolder = TemporaryFolder() - @Test - fun `test save config and rollback`() { + @Test(timeout=300_000) + fun `test save config and rollback`() { val path = tempFolder.root.toPath() / "conf" val config = path / "CordaExplorer.properties" diff --git a/tools/explorer/src/test/kotlin/net/corda/explorer/views/GuiUtilitiesKtTest.kt b/tools/explorer/src/test/kotlin/net/corda/explorer/views/GuiUtilitiesKtTest.kt index 4902fb69df..a347b2859e 100644 --- a/tools/explorer/src/test/kotlin/net/corda/explorer/views/GuiUtilitiesKtTest.kt +++ b/tools/explorer/src/test/kotlin/net/corda/explorer/views/GuiUtilitiesKtTest.kt @@ -6,8 +6,8 @@ import java.text.DecimalFormatSymbols import java.util.* class GuiUtilitiesKtTest { - @Test - fun `test to string with suffix`() { + @Test(timeout=300_000) + fun `test to string with suffix`() { //Required for this test to be independent of the default Locale. val ds = DecimalFormatSymbols(Locale.getDefault()).decimalSeparator diff --git a/tools/shell-cli/src/test/kotlin/net/corda/tools/shell/StandaloneShellArgsParserTest.kt b/tools/shell-cli/src/test/kotlin/net/corda/tools/shell/StandaloneShellArgsParserTest.kt index 0f34df3864..523ef5e879 100644 --- a/tools/shell-cli/src/test/kotlin/net/corda/tools/shell/StandaloneShellArgsParserTest.kt +++ b/tools/shell-cli/src/test/kotlin/net/corda/tools/shell/StandaloneShellArgsParserTest.kt @@ -10,8 +10,8 @@ import kotlin.test.assertEquals class StandaloneShellArgsParserTest { private val CONFIG_FILE = StandaloneShellArgsParserTest::class.java.getResource("/config.conf").toPath() - @Test - fun empty_args_to_cmd_options() { + @Test(timeout=300_000) + fun empty_args_to_cmd_options() { val expectedOptions = ShellCmdLineOptions() assertEquals(expectedOptions.configFile, null) @@ -23,8 +23,8 @@ class StandaloneShellArgsParserTest { assertEquals(expectedOptions.password, null) } - @Test - fun args_to_config() { + @Test(timeout=300_000) + fun args_to_config() { val options = ShellCmdLineOptions() options.configFile = null options.commandsDirectory = Paths.get("/x/y/commands") @@ -56,8 +56,8 @@ class StandaloneShellArgsParserTest { assertEquals(expectedConfig, config) } - @Test - fun cmd_options_to_config_from_file() { + @Test(timeout=300_000) + fun cmd_options_to_config_from_file() { val options = ShellCmdLineOptions() options.configFile = CONFIG_FILE options.commandsDirectory = null @@ -86,8 +86,8 @@ class StandaloneShellArgsParserTest { assertEquals(expectedConfig, config) } - @Test - fun cmd_options_override_config_from_file() { + @Test(timeout=300_000) + fun cmd_options_override_config_from_file() { val options = ShellCmdLineOptions() options.configFile = CONFIG_FILE options.commandsDirectory = null diff --git a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/HashLookupCommandTest.kt b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/HashLookupCommandTest.kt index d1a912fcb6..ad1b89c43a 100644 --- a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/HashLookupCommandTest.kt +++ b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/HashLookupCommandTest.kt @@ -27,8 +27,8 @@ import kotlin.test.assertTrue class HashLookupCommandTest { @Ignore - @Test - fun `hash lookup command returns correct response`() { + @Test(timeout=300_000) + fun `hash lookup command returns correct response`() { val user = User("u", "p", setOf(Permissions.all())) driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = listOf(DUMMY_CONTRACTS_CORDAPP))) { diff --git a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt index 84262a2120..1a6a9fec81 100644 --- a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt +++ b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/InteractiveShellIntegrationTest.kt @@ -88,8 +88,8 @@ class InteractiveShellIntegrationTest { inputObjectMapper = objectMapperWithClassLoader(InteractiveShell.getCordappsClassloader()) } - @Test - fun `shell should not log in with invalid credentials`() { + @Test(timeout=300_000) + fun `shell should not log in with invalid credentials`() { val user = User("u", "p", setOf()) driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() @@ -98,8 +98,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell should log in with valid credentials`() { + @Test(timeout=300_000) + fun `shell should log in with valid credentials`() { val user = User("u", "p", setOf()) driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() @@ -108,8 +108,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell should log in with ssl`() { + @Test(timeout=300_000) + fun `shell should log in with ssl`() { val user = User("mark", "dadada", setOf(all())) val (keyPair, cert) = createKeyPairAndSelfSignedTLSCertificate(testName) @@ -126,8 +126,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell shoud not log in with invalid truststore`() { + @Test(timeout=300_000) + fun `shell shoud not log in with invalid truststore`() { val user = User("mark", "dadada", setOf("ALL")) val (keyPair, cert) = createKeyPairAndSelfSignedTLSCertificate(testName) val keyStorePath = saveToKeyStore(tempFolder.root.toPath() / "keystore.jks", keyPair, cert) @@ -144,8 +144,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `internal shell user should not be able to connect if node started with devMode=false`() { + @Test(timeout=300_000) + fun `internal shell user should not be able to connect if node started with devMode=false`() { driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { val node = startNode().getOrThrow() val conf = (node as NodeHandleInternal).configuration.toShellConfig() @@ -155,8 +155,8 @@ class InteractiveShellIntegrationTest { } @Ignore - @Test - fun `ssh runs flows via standalone shell`() { + @Test(timeout=300_000) + fun `ssh runs flows via standalone shell`() { val user = User("u", "p", setOf( startFlow(), Permissions.invokeRpc(CordaRPCOps::registeredFlows), @@ -193,8 +193,8 @@ class InteractiveShellIntegrationTest { } @Ignore - @Test - fun `ssh run flows via standalone shell over ssl to node`() { + @Test(timeout=300_000) + fun `ssh run flows via standalone shell over ssl to node`() { val user = User("mark", "dadada", setOf( startFlow(), Permissions.invokeRpc(CordaRPCOps::registeredFlows), @@ -243,8 +243,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell should start flow with fully qualified class name`() { + @Test(timeout=300_000) + fun `shell should start flow with fully qualified class name`() { val user = User("u", "p", setOf(all())) driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() @@ -255,8 +255,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell should start flow with unique un-qualified class name`() { + @Test(timeout=300_000) + fun `shell should start flow with unique un-qualified class name`() { val user = User("u", "p", setOf(all())) driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() @@ -267,8 +267,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell should fail to start flow with ambiguous class name`() { + @Test(timeout=300_000) + fun `shell should fail to start flow with ambiguous class name`() { val user = User("u", "p", setOf(all())) driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() @@ -279,8 +279,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `shell should start flow with partially matching class name`() { + @Test(timeout=300_000) + fun `shell should start flow with partially matching class name`() { val user = User("u", "p", setOf(all())) driver(DriverParameters(startNodesInProcess = true, notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { val node = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() @@ -291,8 +291,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `dumpCheckpoints correctly serializes FlowExternalOperations`() { + @Test(timeout=300_000) + fun `dumpCheckpoints correctly serializes FlowExternalOperations`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() (alice.baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME).createDirectories() @@ -314,8 +314,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `dumpCheckpoints correctly serializes FlowExternalAsyncOperations`() { + @Test(timeout=300_000) + fun `dumpCheckpoints correctly serializes FlowExternalAsyncOperations`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() (alice.baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME).createDirectories() @@ -336,8 +336,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `dumpCheckpoints correctly serializes WaitForStateConsumption`() { + @Test(timeout=300_000) + fun `dumpCheckpoints correctly serializes WaitForStateConsumption`() { driver(DriverParameters(notarySpecs = emptyList(), startNodesInProcess = true)) { val alice = startNode(providedName = ALICE_NAME).getOrThrow() (alice.baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME).createDirectories() @@ -360,8 +360,8 @@ class InteractiveShellIntegrationTest { } } - @Test - fun `dumpCheckpoints creates zip with json file for suspended flow`() { + @Test(timeout=300_000) + fun `dumpCheckpoints creates zip with json file for suspended flow`() { val user = User("u", "p", setOf(all())) driver(DriverParameters(startNodesInProcess = true, cordappsForAllNodes = listOf(enclosedCordapp()))) { val aliceNode = startNode(providedName = ALICE_NAME, rpcUsers = listOf(user)).getOrThrow() diff --git a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt index 9774c22329..1247d50963 100644 --- a/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt +++ b/tools/shell/src/integration-test/kotlin/net/corda/tools/shell/SSHServerTest.kt @@ -28,8 +28,8 @@ import kotlin.test.assertTrue import kotlin.test.fail class SSHServerTest { - @Test - fun `ssh server does not start be default`() { + @Test(timeout=300_000) + fun `ssh server does not start be default`() { val user = User("u", "p", setOf()) // The driver will automatically pick up the annotated flows below driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { @@ -49,8 +49,8 @@ class SSHServerTest { } } - @Test - fun `ssh server starts when configured`() { + @Test(timeout=300_000) + fun `ssh server starts when configured`() { val user = User("u", "p", setOf()) // The driver will automatically pick up the annotated flows below driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { @@ -68,8 +68,8 @@ class SSHServerTest { } } - @Test - fun `ssh server verify credentials`() { + @Test(timeout=300_000) + fun `ssh server verify credentials`() { val user = User("u", "p", setOf()) // The driver will automatically pick up the annotated flows below driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = emptyList())) { @@ -91,8 +91,8 @@ class SSHServerTest { } } - @Test - fun `ssh respects permissions`() { + @Test(timeout=300_000) + fun `ssh respects permissions`() { val user = User("u", "p", setOf(startFlow(), invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name))) // The driver will automatically pick up the annotated flows below @@ -121,8 +121,8 @@ class SSHServerTest { } @Ignore - @Test - fun `ssh runs flows`() { + @Test(timeout=300_000) + fun `ssh runs flows`() { val user = User("u", "p", setOf(startFlow())) // The driver will automatically pick up the annotated flows below driver(DriverParameters(notarySpecs = emptyList(), cordappsForAllNodes = listOf(enclosedCordapp()))) { diff --git a/tools/shell/src/test/kotlin/net/corda/tools/shell/CustomTypeJsonParsingTests.kt b/tools/shell/src/test/kotlin/net/corda/tools/shell/CustomTypeJsonParsingTests.kt index ff510693e7..5d291987b0 100644 --- a/tools/shell/src/test/kotlin/net/corda/tools/shell/CustomTypeJsonParsingTests.kt +++ b/tools/shell/src/test/kotlin/net/corda/tools/shell/CustomTypeJsonParsingTests.kt @@ -31,8 +31,8 @@ class CustomTypeJsonParsingTests { objectMapper.registerModule(simpleModule) } - @Test - fun `Deserializing UniqueIdentifier by parsing string`() { + @Test(timeout=300_000) + fun `Deserializing UniqueIdentifier by parsing string`() { val id = "26b37265-a1fd-4c77-b2e0-715917ef619f" val json = """{"linearId":"$id"}""" val state = objectMapper.readValue(json) @@ -40,8 +40,8 @@ class CustomTypeJsonParsingTests { assertEquals(id, state.linearId.id.toString()) } - @Test - fun `Deserializing UniqueIdentifier by parsing string with underscore`() { + @Test(timeout=300_000) + fun `Deserializing UniqueIdentifier by parsing string with underscore`() { val json = """{"linearId":"extkey564_26b37265-a1fd-4c77-b2e0-715917ef619f"}""" val state = objectMapper.readValue(json) @@ -55,8 +55,8 @@ class CustomTypeJsonParsingTests { objectMapper.readValue(json) } - @Test - fun `Deserializing UUID by parsing string`() { + @Test(timeout=300_000) + fun `Deserializing UUID by parsing string`() { val json = """{"uuid":"26b37265-a1fd-4c77-b2e0-715917ef619f"}""" val state = objectMapper.readValue(json) diff --git a/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt b/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt index 7a3212298f..9bfb1d465d 100644 --- a/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt +++ b/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt @@ -137,36 +137,36 @@ class InteractiveShellTest { return objectMapper } - @Test - fun flowStartSimple() { + @Test(timeout=300_000) + fun flowStartSimple() { check("a: Hi there", "Hi there") check("b: 12", "12") check("b: 12, c: Yo", "12Yo") } - @Test - fun flowStartWithComplexTypes() = check("amount: £10", "10.00 GBP") + @Test(timeout=300_000) + fun flowStartWithComplexTypes() = check("amount: £10", "10.00 GBP") - @Test - fun flowStartWithNestedTypes() = check( + @Test(timeout=300_000) + fun flowStartWithNestedTypes() = check( input = "pair: { first: $100.12, second: df489807f81c8c8829e509e1bcb92e6692b9dd9d624b7456435cb2f51dc82587 }", expected = "(100.12 USD, DF489807F81C8C8829E509E1BCB92E6692B9DD9D624B7456435CB2F51DC82587)" ) - @Test - fun flowStartWithArrayType() = check( + @Test(timeout=300_000) + fun flowStartWithArrayType() = check( input = "c: [ One, Two, Three, Four ]", expected = "One+Two+Three+Four" ) - @Test - fun flowStartWithUserAmount() = check( + @Test(timeout=300_000) + fun flowStartWithUserAmount() = check( input = """b: 500, amount: { "quantity": 10001, "token":{ "label": "of value" } }""", expected = "10501 of value" ) - @Test - fun flowStartWithArrayOfNestedTypes() = check( + @Test(timeout=300_000) + fun flowStartWithArrayOfNestedTypes() = check( input = """amounts: [ { "quantity": 10, "token": { "label": "(1)" } }, { "quantity": 200, "token": { "label": "(2)" } } ]""", expected = "10 (1)++200 (2)" ) @@ -180,8 +180,8 @@ class InteractiveShellTest { @Test(expected = InteractiveShell.NoApplicableConstructor::class) fun flowTooManyParams() = check("b: 12, c: Yo, d: Bar", "") - @Test - fun niceTypeNamesInErrors() { + @Test(timeout=300_000) + fun niceTypeNamesInErrors() { val e = assertFailsWith { check("", expected = "") } @@ -201,11 +201,11 @@ class InteractiveShellTest { assert(errors.isEmpty()) { errors.joinToString(", ") } } - @Test - fun party() = check("party: \"${megaCorp.name}\"", megaCorp.name.toString()) + @Test(timeout=300_000) + fun party() = check("party: \"${megaCorp.name}\"", megaCorp.name.toString()) - @Test - fun runRpcFromStringWithCustomTypeResult() { + @Test(timeout=300_000) + fun runRpcFromStringWithCustomTypeResult() { val command = listOf("nodeInfo") whenever(cordaRpcOps.nodeInfo()).thenReturn(ALICE_NODE_INFO) @@ -219,8 +219,8 @@ class InteractiveShellTest { verify(printWriter).println(NODE_INFO_JSON_PAYLOAD.replace("\n", System.lineSeparator())) } - @Test - fun runRpcFromStringWithCollectionsResult() { + @Test(timeout=300_000) + fun runRpcFromStringWithCollectionsResult() { val command = listOf("networkMapSnapshot") whenever(cordaRpcOps.networkMapSnapshot()).thenReturn(listOf(ALICE_NODE_INFO, BOB_NODE_INFO)) @@ -233,15 +233,15 @@ class InteractiveShellTest { verify(printWriter).println(NETWORK_MAP_JSON_PAYLOAD.replace("\n", System.lineSeparator())) } - @Test - fun killFlowWithNonsenseID() { + @Test(timeout=300_000) + fun killFlowWithNonsenseID() { InteractiveShell.killFlowById("nonsense", printWriter, cordaRpcOps, om) verify(printWriter).println("Cannot parse flow ID of 'nonsense' - expecting a UUID.", Decoration.bold, Color.red) verify(printWriter).flush() } - @Test - fun killFlowFailure() { + @Test(timeout=300_000) + fun killFlowFailure() { val runId = StateMachineRunId.createRandom() whenever(cordaRpcOps.killFlow(any())).thenReturn(false) @@ -251,8 +251,8 @@ class InteractiveShellTest { verify(printWriter).flush() } - @Test - fun killFlowSuccess() { + @Test(timeout=300_000) + fun killFlowSuccess() { val runId = StateMachineRunId.createRandom() whenever(cordaRpcOps.killFlow(any())).thenReturn(true) diff --git a/tools/shell/src/test/kotlin/net/corda/tools/shell/utilities/ANSIProgressRendererTest.kt b/tools/shell/src/test/kotlin/net/corda/tools/shell/utilities/ANSIProgressRendererTest.kt index 4f0573fdb2..a86d443004 100644 --- a/tools/shell/src/test/kotlin/net/corda/tools/shell/utilities/ANSIProgressRendererTest.kt +++ b/tools/shell/src/test/kotlin/net/corda/tools/shell/utilities/ANSIProgressRendererTest.kt @@ -72,8 +72,8 @@ class ANSIProgressRendererTest { verify(printWriter, times(updates)).flush() } - @Test - fun `test that steps are rendered appropriately depending on their status`() { + @Test(timeout=300_000) + fun `test that steps are rendered appropriately depending on their status`() { progressRenderer.render(flowProgressHandle) feedSubject.onNext(listOf(Pair(0, STEP_1_LABEL), Pair(0, STEP_2_LABEL), Pair(0, STEP_3_LABEL))) // The flow is currently at step 3, while step 1 has been completed and step 2 has been skipped. @@ -84,8 +84,8 @@ class ANSIProgressRendererTest { checkTrackingState(captor, 2, listOf(stepSuccess(STEP_1_LABEL), stepSkipped(STEP_2_LABEL), stepActive(STEP_3_LABEL))) } - @Test - fun `changing tree causes correct steps to be marked as done`() { + @Test(timeout=300_000) + fun `changing tree causes correct steps to be marked as done`() { progressRenderer.render(flowProgressHandle) feedSubject.onNext(listOf(Pair(0, STEP_1_LABEL), Pair(1, STEP_2_LABEL), Pair(1, STEP_3_LABEL), Pair(0, STEP_4_LABEL), Pair(0, STEP_5_LABEL))) indexSubject.onNext(0) @@ -99,8 +99,8 @@ class ANSIProgressRendererTest { checkTrackingState(captor, 4, listOf(stepActive(STEP_1_LABEL), stepNotRun(STEP_4_LABEL), stepNotRun(STEP_5_LABEL))) } - @Test - fun `duplicate steps in different children handled correctly`() { + @Test(timeout=300_000) + fun `duplicate steps in different children handled correctly`() { val captor = argumentCaptor() progressRenderer.render(flowProgressHandle) feedSubject.onNext(listOf(Pair(0, STEP_1_LABEL), Pair(0, STEP_2_LABEL))) diff --git a/tools/worldmap/src/test/kotlin/net/corda/worldmap/CityDatabaseTest.kt b/tools/worldmap/src/test/kotlin/net/corda/worldmap/CityDatabaseTest.kt index 651c5992c1..8c308fd91f 100644 --- a/tools/worldmap/src/test/kotlin/net/corda/worldmap/CityDatabaseTest.kt +++ b/tools/worldmap/src/test/kotlin/net/corda/worldmap/CityDatabaseTest.kt @@ -4,8 +4,8 @@ import org.junit.Assert.assertEquals import org.junit.Test class CityDatabaseTest { - @Test - fun lookups() { + @Test(timeout=300_000) + fun lookups() { val london = CityDatabase["London"]!! assertEquals(WorldCoordinate(51.5, -0.12), london.coordinate) assertEquals("GB", london.countryCode)