temporalio / samples-dotnet

Samples for working with the Temporal .NET SDK
MIT License
50 stars 15 forks source link

[Bug] TimeSkipping test server hangs when testing Update #72

Open mnichols opened 3 weeks ago

mnichols commented 3 weeks ago

What are you really trying to do?

I was trying to test WorkflowUpdate in my own code and was using StartTimeSkippingAsync . My test was hanging each time even though the samples in this repo were succeeding. I changed the WorkflowUpdate sample in this repo to use StartTimeSkippingAsync instead of StartLocalAsync and got the same behavior.

Here is logging output after test times out:

A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:30.59]     TemporalioSamples.Tests.WorkflowUpdate.WorkflowUpdateTests.SimpleRun_Succeed [FAIL]
  Failed TemporalioSamples.Tests.WorkflowUpdate.WorkflowUpdateTests.SimpleRun_Succeed [30 s]
  Error Message:
   Temporalio.Exceptions.RpcException : Timeout expired
  Stack Trace:
     at Temporalio.Bridge.Client.CallAsync[T](RpcService service, String rpc, IMessage req, MessageParser`1 resp, Boolean retry, IEnumerable`1 metadata, Nullable`1 timeout, Nullable`1 cancellationToken)
   at Temporalio.Client.TemporalConnection.InvokeRpcAsync[T](RpcService service, String rpc, IMessage req, MessageParser`1 resp, RpcOptions options)
   at Temporalio.Client.TemporalClient.Impl.StartWorkflowUpdateAsync[TResult](StartWorkflowUpdateInput input)
   at Temporalio.Client.WorkflowHandle`1.ExecuteUpdateAsync[TUpdateResult](Expression`1 updateCall, WorkflowUpdateOptions options)
   at TemporalioSamples.Tests.WorkflowUpdate.WorkflowUpdateTests.<>c__DisplayClass1_0.<<SimpleRun_Succeed>b__0>d.MoveNext() in /Users/mnichols/dev/samples-dotnet/tests/WorkflowUpdate/WorkflowUpdateTests.cs:line 31
--- End of stack trace from previous location ---
   at Temporalio.Worker.TemporalWorker.ExecuteInternalAsync(Func`1 untilComplete, CancellationToken stoppingToken)
   at Temporalio.Worker.TemporalWorker.ExecuteInternalAsync(Func`1 untilComplete, CancellationToken stoppingToken)
   at TemporalioSamples.Tests.WorkflowUpdate.WorkflowUpdateTests.SimpleRun_Succeed() in /Users/mnichols/dev/samples-dotnet/tests/WorkflowUpdate/WorkflowUpdateTests.cs:line 25
   at TemporalioSamples.Tests.WorkflowUpdate.WorkflowUpdateTests.SimpleRun_Succeed() in /Users/mnichols/dev/samples-dotnet/tests/WorkflowUpdate/WorkflowUpdateTests.cs:line 25
--- End of stack trace from previous location ---

Failed!  - Failed:     1, Passed:     0, Skipped:     0, Total:     1, Duration: < 1 ms - TemporalioSamples.Tests.dll (net8.0)

Minimal Reproduction

Just change WorkflowEnvironment.StartLocalAsync to WorkflowEnvironment.StartTimeSkippingAsync and run

dotnet test --filter "TemporalioSamples.Tests.WorkflowUpdate.WorkflowUpdateTests.SimpleRun_Succeed"

Environment/Versions

cretz commented 3 weeks ago

This is a bug on the test server not this SDK specifically: https://github.com/temporalio/sdk-java/issues/1903. Also see https://github.com/temporalio/sdk-dotnet/issues/179.