87
Views
0
Comments
[TestFramework] Unit-tests crashed when running their in Test Framework
Question
Forge component by Indigo
45
Published on 03 Nov 2020

Hi.

When running tests in Test Framework some of them crushed by cause: "String or binary data would be truncated.
The statement has been terminated."
When you run these tests isolated, they run successfully.

I found this topic: https://www.outsystems.com/forums/discussion/21459/string-or-binary-data-would-be-truncated-the-statement-has-been-terminated/.

"It happens when you try to insert/update a record on the database, with some value that is larger than the database field can hold".

I checked the error log, but there are no references to the entities with which the work is done in the test. Therefore, I assume that the problem is in Test Framework.

Maybe someone can help me or suggest what could be wrong?

Trace:
String or binary data would be truncated.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteReader(IDbCommand cmd)
   at OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService.ExecuteScalar(IDbCommand cmd)
   at OutSystems.Internal.Db.Command.<ExecuteScalar>b__47_0()
   at OutSystems.Internal.Db.DatabaseAccess.ExecuteWithoutRequestTimeout[T](Func`1 action)
   at OutSystems.Internal.Db.Command.ExecuteScalar(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)
   at ssTestFramework_Core.ExtendedActions.CreateOrUpdateTestStepRunExtended(HeContext heContext, BitArray usedFields, RCTestStepRunExtendedRecord inParamSource, Int64& outParamId)
   at ssTestFramework_Core.Actions.ActionTestStepRunExtended_CreateOrUpdate(HeContext heContext, ENTestStepRunExtendedEntityRecord inParamTestStepRunExtended, Int64& outParamTestStepRunExtendedId)
   at ssTestFramework_Core.Actions.ActionHTTP_Invoke(HeContext heContext, ENTestStepEntityRecord inParamTestStep, Int32 inParamTestStepRunId, RLVariableList inParamVarList, String inParamTargetEnvironmentURL)
   at ssTestFramework_Core.Actions.ActionTestStep_Start(HeContext heContext, Int32 inParamTestStepId, Int32 inParamTestCaseRunId, RLVariableList inParamVarList, String inParamTargetEnvironmentURL, Int32 inParamTestScheduleId, Boolean& outParamIsTestDiscarded)