Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite fails when not using release config #7285

Open
emlautarom1 opened this issue Jul 23, 2024 · 2 comments
Open

Test suite fails when not using release config #7285

emlautarom1 opened this issue Jul 23, 2024 · 2 comments

Comments

@emlautarom1
Copy link
Contributor

Description

Our current test suite fails for some modules when no configuration is provided (defaulting most likely to Debug)

Steps to Reproduce

  1. Clone the repository
  2. Run cd src/Nethermind
  3. Run dotnet test Nethermind.Evm.Test.
  4. Run dotnet test Nethermind.Evm.Test -c release.

Actual behavior
The test suite fails when no config is provided

Expected behavior
The test suite should pass with any configuration

Desktop (please complete the following information):
Please provide the following information regarding your setup:

  • Operating System: Fedora
  • Version: Workstation 39
  • Installation Method: Source (commit 54f5817)
  • Consensus Client: none

Logs
Exception stack trace:

The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.InvalidOperationException: ArrayPoolList hasn't been disposed. Created    at Nethermind.Core.Collections.ArrayPoolList`1..ctor(ArrayPool`1 arrayPool, Int32 capacity, Int32 startingCount)
   at Nethermind.Core.Collections.ArrayPoolList`1..ctor(Int32 capacity)
   at Nethermind.Evm.Tracing.GethStyle.Custom.Native.Call.NativeCallTracerCallFrame..ctor()
   at Nethermind.Evm.Tracing.GethStyle.Custom.Native.Call.NativeCallTracer.ReportAction(Int64 gas, UInt256 value, Address from, Address to, ReadOnlyMemory`1 input, ExecutionType callType, Boolean isPrecompileCall)
   at Nethermind.Evm.VirtualMachine`1.Run[TTracingActions](EvmState state, IWorldState worldState, ITxTracer txTracer)
   at Nethermind.Evm.VirtualMachine.Run[TTracingActions](EvmState state, IWorldState worldState, ITxTracer txTracer)
   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.ExecuteEvmCall(Transaction tx, BlockHeader header, IReleaseSpec spec, ITxTracer tracer, ExecutionOptions opts, Int64& gasAvailable, ExecutionEnvironment& env, TransactionSubstate& substate, Int64& spentGas, Byte& statusCode)
   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.Execute(Transaction tx, BlockExecutionContext& blCtx, ITxTracer tracer, ExecutionOptions opts)
   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.Execute(Transaction transaction, BlockExecutionContext& blCtx, ITxTracer txTracer)
   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.Nethermind.Evm.TransactionProcessing.ITransactionProcessor.Execute(Transaction transaction, BlockExecutionContext& blCtx, ITxTracer txTracer)
   at Nethermind.Evm.Test.VirtualMachineTestsBase.Execute[T](T tracer, Byte[] code, Nullable`1 forkActivation)
   at Nethermind.Evm.Test.Tracing.GethLikeCallTracerTests.ExecuteCallTrace(Byte[] code, String tracerConfig)
   at Nethermind.Evm.Test.Tracing.GethLikeCallTracerTests.Test_CallTrace_SelfDestruct()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at NUnit.Framework.Internal.Reflect.InvokeMethod(MethodInfo method, Object fixture, Object[] args)
   at NUnit.Framework.Internal.MethodWrapper.Invoke(Object fixture, Object[] args)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.InvokeTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
   at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
   at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated(ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated[T](Func`1 func)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
   at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
   at NUnit.Framework.Internal.Execution.WorkItem.Execute()
   at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work, ParallelExecutionStrategy strategy)
   at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work)
   at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
   at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
   at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
   at NUnit.Framework.Internal.Execution.WorkItem.Execute()
   at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at Nethermind.Core.Collections.ArrayPoolList`1.Finalize() in /home/emlautarom1/dev/nethermind/src/Nethermind/Nethermind.Core/Collections/ArrayPoolList.cs:line 359
@emlautarom1
Copy link
Contributor Author

The issue seems due to this check that only exists in DEBUG builds:

#if DEBUG
private readonly StackTrace _creationStackTrace = new();
~ArrayPoolList()
{
if (_capacity != 0 && !_disposed)
{
throw new InvalidOperationException($"{nameof(ArrayPoolList<T>)} hasn't been disposed. Created {_creationStackTrace}");
}
}
#endif

This could be due to the test suite not properly releasing resources (missing .Dispose() or using). In the meantime, if you happen to see the same issue when running the test suite from your IDE like me, make sure that you use a Release profile.

@emlautarom1
Copy link
Contributor Author

Relevant: #7186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant