NUnit test results: Exception stack trace doesn't join stack frames logically

Here's how my stacktrace looks in R# Test Session window when an error happens during an NUNIT test (If you look at the order it doesn't make sense as the stack frames don't join either above the frame or below):

at Util.Grid.HandleException(Exception ex, String errSource) in Grid.vb: line 7967
at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray, Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in Grid.vb: line 14052
at Util.Grid.Read(Boolean ClearRows) in Grid.vb: line 13024
at Util.Grid.Read() in Grid.vb: line 13011
at Util.Test.GridFixture_Connection.ReadStoredProc() in GridFixture_Connection.vb: line 641   <--- THIS IS WHERE MY TEST IS
--Exception
at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref IDbConnection Connection, Boolean StructureOnly, Boolean DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32 CommandTimeout, ref IDbTransaction Transaction, ExecuteMode ExecutionMode) in DataArray.vb: line 5657
at Util.DataArray.Import(String SqlText, String KeyColumns, ref IDbConnection Connection, Boolean StructureOnly, Boolean DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32 CommandTimeout, ref IDbTransaction Transaction) in DataArray.vb: line 5356
at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray, Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in Grid.vb: line 13188
--IndexOutOfRangeException
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at Util.DataReader.GetOrdinal(String name) in DataReader.vb: line 47
at Util.DataHandler.GetDataType(ref IDataReader dr, String Field) in DataHandler.vb: line 1295
at Util.DataArray.ImportDataReader(ref IDataReader dr, String[] KeyColumns, Boolean StructureOnly, Int32 MaxNonCriticalErrorsReported) in DataArray.vb: line 6240
at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref IDbConnection Connection, Boolean StructureOnly, Boolean DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32 CommandTimeout, ref IDbTransaction Transaction, ExecuteMode ExecutionMode) in DataArray.vb: line 5572

Here's how I believe IT SHOULD LOOK LIKE (or maybe flipped the other way but the frames should logically follow each other):

--IndexOutOfRangeException
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at Util.DataReader.GetOrdinal(String name) in DataReader.vb: line 47
at Util.DataHandler.GetDataType(ref IDataReader dr, String Field) in DataHandler.vb: line 1295
at Util.DataArray.ImportDataReader(ref IDataReader dr, String[] KeyColumns, Boolean StructureOnly, Int32 MaxNonCriticalErrorsReported) in DataArray.vb: line 6240
at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref IDbConnection Connection, Boolean StructureOnly, Boolean DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32 CommandTimeout, ref IDbTransaction Transaction, ExecuteMode ExecutionMode) in DataArray.vb: line 5572

--Exception
at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref IDbConnection Connection, Boolean StructureOnly, Boolean DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32 CommandTimeout, ref IDbTransaction Transaction, ExecuteMode ExecutionMode) in DataArray.vb: line 5657
at Util.DataArray.Import(String SqlText, String KeyColumns, ref IDbConnection Connection, Boolean StructureOnly, Boolean DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32 CommandTimeout, ref IDbTransaction Transaction) in DataArray.vb: line 5356
at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray, Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in Grid.vb: line 13188
--<NOT SURE WHAT IS HAPPENING HERE AS THE STACKS DON'T JOIN RIGHT>

at Util.Grid.HandleException(Exception ex, String errSource) in Grid.vb: line 7967
at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray, Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in Grid.vb: line 14052
at Util.Grid.Read(Boolean ClearRows) in Grid.vb: line 13024
at Util.Grid.Read() in Grid.vb: line 13011
at Util.Test.GridFixture_Connection.ReadStoredProc() in GridFixture_Connection.vb: line 641   <-- THIS IS WHERE THE TEST IS

2 comments

Hello Denis,

How is the exception rendered when you run that test using NUnit built-in
console runner? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Here's how my stacktrace looks in R# Test Session window when an error
happens during an NUNIT test (If you look at the order it doesn't make
sense as the stack frames don't join either above the frame or below):

at Util.Grid.HandleException(Exception ex, String errSource) in
Grid.vb: line 7967

at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray,
Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in
Grid.vb: line 14052

at Util.Grid.Read(Boolean ClearRows) in Grid.vb: line 13024

at Util.Grid.Read() in Grid.vb: line 13011

at Util.Test.GridFixture_Connection.ReadStoredProc() in
GridFixture_Connection.vb: line 641   <--- THIS IS WHERE MY TEST IS

--Exception

at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref
IDbConnection Connection, Boolean StructureOnly, Boolean
DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32
CommandTimeout, ref IDbTransaction Transaction, ExecuteMode
ExecutionMode) in DataArray.vb: line 5657

at Util.DataArray.Import(String SqlText, String KeyColumns, ref
IDbConnection Connection, Boolean StructureOnly, Boolean
DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32
CommandTimeout, ref IDbTransaction Transaction) in DataArray.vb: line
5356

at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray,
Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in
Grid.vb: line 13188

--IndexOutOfRangeException

at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String
fieldName)

at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)

at Util.DataReader.GetOrdinal(String name) in DataReader.vb: line 47

at Util.DataHandler.GetDataType(ref IDataReader dr, String Field) in
DataHandler.vb: line 1295

at Util.DataArray.ImportDataReader(ref IDataReader dr, String[]
KeyColumns, Boolean StructureOnly, Int32 MaxNonCriticalErrorsReported)
in DataArray.vb: line 6240

at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref
IDbConnection Connection, Boolean StructureOnly, Boolean
DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32
CommandTimeout, ref IDbTransaction Transaction, ExecuteMode
ExecutionMode) in DataArray.vb: line 5572

Here's how I believe IT SHOULD LOOK LIKE (or maybe flipped the other
way but the frames should logically follow each other):

--IndexOutOfRangeException

at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String
fieldName)

at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)

at Util.DataReader.GetOrdinal(String name) in DataReader.vb: line 47

at Util.DataHandler.GetDataType(ref IDataReader dr, String Field) in
DataHandler.vb: line 1295

at Util.DataArray.ImportDataReader(ref IDataReader dr, String[]
KeyColumns, Boolean StructureOnly, Int32 MaxNonCriticalErrorsReported)
in DataArray.vb: line 6240

at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref
IDbConnection Connection, Boolean StructureOnly, Boolean
DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32
CommandTimeout, ref IDbTransaction Transaction, ExecuteMode
ExecutionMode) in DataArray.vb: line 5572

--Exception

at Util.DataArray.Import(String SqlText, String[] KeyColumns, ref
IDbConnection Connection, Boolean StructureOnly, Boolean
DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32
CommandTimeout, ref IDbTransaction Transaction, ExecuteMode
ExecutionMode) in DataArray.vb: line 5657

at Util.DataArray.Import(String SqlText, String KeyColumns, ref
IDbConnection Connection, Boolean StructureOnly, Boolean
DefaultValues, String DefaultValuesSource, Boolean Passthrough, Int32
CommandTimeout, ref IDbTransaction Transaction) in DataArray.vb: line
5356

at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray,
Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in
Grid.vb: line 13188

--<NOT SURE WHAT IS HAPPENING HERE AS THE STACKS DON'T JOIN RIGHT>

at Util.Grid.HandleException(Exception ex, String errSource) in
Grid.vb: line 7967

at Util.Grid.Read(ref DataArray DataArray, Boolean ResetDataArray,
Boolean ClearRows, Boolean IncludeEmptyRows, String Source) in
Grid.vb: line 14052

at Util.Grid.Read(Boolean ClearRows) in Grid.vb: line 13024

at Util.Grid.Read() in Grid.vb: line 13011

at Util.Test.GridFixture_Connection.ReadStoredProc() in
GridFixture_Connection.vb: line 641   *<-- THIS IS WHERE THE TEST IS*

---
Original message URL:
http://devnet.jetbrains.net/message/5304640#5304640



0

I see what you mean but I can't reproduce this exception anymore (our code has changed to fix it). Maybe you can run some tests and see if the stack trace is somehow flipped.

0

Please sign in to leave a comment.