dapr / dotnet-sdk

Dapr SDK for .NET
Apache License 2.0
1.1k stars 327 forks source link

Test non-determinism #596

Open rynowak opened 3 years ago

rynowak commented 3 years ago

Seeing a test fail somewhat non-deterministically on the CI:

   Failed Dapr.Actors.Test.ApiTokenTests.CreateProxyWithRemoting_WithApiToken [7 ms]
  Error Message:
   System.Runtime.Serialization.SerializationException : Type 'Dapr.Actors.Test.ITestActor_.actorV1.mt.SetCountAsyncReqBody' with data contract name 'SetCountAsyncReqBody:urn:actors' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
  Stack Trace:
     at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
   at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerializeWithSurrogate(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
   at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
   at WriteWrappedMsgBodyToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle)
   at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
   at Dapr.Actors.Communication.ActorMessageBodyDataContractSerializationProvider.MemoryStreamMessageBodySerializer`2.Dapr.Actors.Communication.IActorRequestMessageBodySerializer.Serialize(IActorRequestMessageBody actorRequestMessageBody) in /home/runner/work/dotnet-sdk/dotnet-sdk/src/Dapr.Actors/Communication/ActorMessageBodyDataContractSerializationProvider.cs:line 174
   at Dapr.Actors.DaprHttpInteractor.InvokeActorMethodWithRemotingAsync(ActorMessageSerializersManager serializersManager, IActorRequestMessage remotingRequestRequestMessage, CancellationToken cancellationToken) in /home/runner/work/dotnet-sdk/dotnet-sdk/src/Dapr.Actors/DaprHttpInteractor.cs:line 98
   at Dapr.Actors.Communication.Client.ActorRemotingClient.InvokeAsync(IActorRequestMessage remotingRequestMessage, CancellationToken cancellationToken) in /home/runner/work/dotnet-sdk/dotnet-sdk/src/Dapr.Actors/Communication/Client/ActorRemotingClient.cs:line 39
   at Dapr.Actors.Client.ActorProxy.InvokeMethodAsync(Int32 interfaceId, Int32 methodId, String methodName, IActorRequestMessageBody requestMsgBodyValue, CancellationToken cancellationToken) in /home/runner/work/dotnet-sdk/dotnet-sdk/src/Dapr.Actors/Client/ActorProxy.cs:line 219
   at Dapr.Actors.Test.ApiTokenTests.<>c__DisplayClass0_0.<<CreateProxyWithRemoting_WithApiToken>b__0>d.MoveNext() in /home/runner/work/dotnet-sdk/dotnet-sdk/test/Dapr.Actors.Test/ApiTokenTests.cs:line 32
--- End of stack trace from previous location where exception was thrown ---
   at Dapr.TestClient`1.CaptureHttpRequestMessageAsync(Func`2 operation) in /home/runner/work/dotnet-sdk/dotnet-sdk/test/Shared/TestClient.cs:line 384
   at Dapr.TestClient`1.CaptureHttpRequestAsync(Func`2 operation) in /home/runner/work/dotnet-sdk/dotnet-sdk/test/Shared/TestClient.cs:line 355
   at Dapr.Actors.Test.ApiTokenTests.CreateProxyWithRemoting_WithApiToken() in /home/runner/work/dotnet-sdk/dotnet-sdk/test/Dapr.Actors.Test/ApiTokenTests.cs:line 28
   at Dapr.Actors.Test.ApiTokenTests.CreateProxyWithRemoting_WithApiToken() in /home/runner/work/dotnet-sdk/dotnet-sdk/test/Dapr.Actors.Test/ApiTokenTests.cs:line 38
--- End of stack trace from previous location where exception was thrown ---
rynowak commented 3 years ago

Keeping this issue around as a reminder in case we see it again. Haven't seen it repro again or any issues reported in production.

rynowak commented 3 years ago

This happened again here: https://github.com/dapr/dotnet-sdk/runs/2034727454