Hello,
We recently had a dev check some code in that required he mock out our ITimeService and over the last week or so we've started to see some random failures. So this morning I dug a little deeper and was able to reproduce.
Below is the exception I was able to reproduce [IndexOutOfRangeException]
(Note: You may have to run the test multiple times before receive the exception).
System.AggregateException : AggregateException_ctor_DefaultMessage
----> System.IndexOutOfRangeException : Index was outside the bounds of the array.
at
System.Threading.Tasks.Task.
ThrowIfExceptional(
Boolean includeTaskCanceledExceptions)
at
System.Threading.Tasks.Task.
Wait(
Int32 millisecondsTimeout,
CancellationToken cancellationToken)
at
System.Threading.Tasks.Parallel.
ForWorker(
Int32 fromInclusive,
Int32 toExclusive,
ParallelOptions parallelOptions,
Action`1 body,
Action`2 bodyWithState,
Func`4 bodyWithLocal,
Func`1 localInit,
Action`1 localFinally)
at
System.Threading.Tasks.Parallel.
For(
Int32 fromInclusive,
Int32 toExclusive,
Action`1 body)
at
MyNamespace.MyClass.
Should_Work() in
OATestBase.cs: line 83
--IndexOutOfRangeException
at
System.Collections.Generic.List`1.
Add(
T item)
at
Moq.Interceptor.
Intercept(
ICallContext invocation)
at
Moq.Proxy.CastleProxyFactory.Interceptor.
Intercept(
IInvocation invocation)
at
Castle.DynamicProxy.AbstractInvocation.
Proceed()
at
Castle.Proxies.ITimeServiceProxy.get_Today()
at
MyNamespace.MyClass.
Somework() in
OATestBase.cs: line 89
at
MyNamespace.MyClass.
<Should_Work>b__0(
Int32 i) in
OATestBase.cs: line 83
at
System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
at
System.Threading.Tasks.Task.
InnerInvoke()
at
System.Threading.Tasks.Task.
InnerInvokeWithArg(
Task childTask)
at
System.Threading.Tasks.Task.
<>c__DisplayClass3.<ExecuteSelfReplicating>b__2(
Object)
Here's how I repro'd the issue.
Other things to note.
1. I first started seeing this on an old version of Moq. So I upped to the latest and am still able to reproduce the issue.
2. Everything is .net 3.5 (My project, back-port of the System.Threading (reactive extensions), Moq, etc...)
Any thoughts?
--
Post:
moq...@googlegroups.com
Unsubscribe:
moqdisc-u...@googlegroups.com