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

Fix racy FunctionRefSpecs #7169

Merged
merged 3 commits into from Apr 24, 2024

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Apr 24, 2024

Changes

Noticed that these were failing racily on #7168 - I'm able to reproduce the failure in Rider using "run until failure" pretty easily. Working on debugging these.

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

@@ -204,7 +212,7 @@ public async Task FunctionRef_created_by_non_top_level_actor_must_be_watchable()

s.Tell(new GetForwarder(TestActor));
var f = await ExpectMsgAsync<FunctionRef>();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this method time out - working on figuring out why. The other two calls below can also time out.

@Aaronontheweb
Copy link
Member Author

Aaronontheweb commented Apr 24, 2024

FunctionRef_created_by_top_level_actor_must_be_watchable

Failed: Expected a message of type Akka.Actor.Terminated, but received {[akka://FunctionRefSpec-7/user/super/$$b#224401843]} (type Akka.Actor.Function...

Xunit.Sdk.FailException
Failed: Expected a message of type Akka.Actor.Terminated, but received {[akka://FunctionRefSpec-7/user/super/$$b#224401843]} (type Akka.Actor.FunctionRef) instead Terminated [akka://FunctionRefSpec-7/user/super/$$a#1445975092].  from [akka://FunctionRefSpec-7/user/super#791687691]
   at Akka.TestKit.Xunit2.XunitAssertions.Fail(String format, Object[] args) in E:\Repositories\olympus\akka.net\src\contrib\testkits\Akka.TestKit.Xunit2\XunitAssertions.cs:line 26
   at Akka.TestKit.TestKitBase.<InternalExpectMsgEnvelopeAsync>d__140`1.MoveNext() in E:\Repositories\olympus\akka.net\src\core\Akka.TestKit\TestKitBase_Expect.cs:line 445
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Akka.TestKit.TestKitBase.<InternalExpectMsgEnvelopeAsync>d__139`1.MoveNext() in E:\Repositories\olympus\akka.net\src\core\Akka.TestKit\TestKitBase_Expect.cs:line 411
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Akka.TestKit.TestKitBase.<InternalExpectMsgAsync>d__137`1.MoveNext() in E:\Repositories\olympus\akka.net\src\core\Akka.TestKit\TestKitBase_Expect.cs:line 379
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Akka.Tests.Actor.FunctionRefSpec.<FunctionRef_created_by_top_level_actor_must_be_watchable>d__8.MoveNext() in E:\Repositories\olympus\akka.net\src\core\Akka.Tests\Actor\FunctionRefSpecs.cs:line 160
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 276
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.ExecutionTimer.<AggregateAsync>d__4.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xunit.Sdk.ExceptionAggregator.<RunAsync>d__9.MoveNext() in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90



[INFO][04/24/2024 12:15:54.741Z][Thread 0022][ActorSystem(FunctionRefSpec-7)] Starting FunctionRefSpec
[DEBUG][04/24/2024 12:15:54.743Z][Thread 0024][akka://FunctionRefSpec-7/user/super] received handled message Akka.Tests.Actor.FunctionRefSpec+GetForwarder from akka://FunctionRefSpec-7/system/testActor7
[DEBUG][04/24/2024 12:15:54.743Z][Thread 0024][akka://FunctionRefSpec-7/user/super] received handled message Akka.Tests.Actor.FunctionRefSpec+GetForwarder from akka://FunctionRefSpec-7/system/testActor7
[DEBUG][04/24/2024 12:15:54.743Z][Thread 0018][akka://FunctionRefSpec-7/user/super] received handled message Akka.Tests.Actor.FunctionRefSpec+DropForwarder from akka://FunctionRefSpec-7/system/testActor7
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0024][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [before-service-unbind] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [service-unbind] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [service-requests-done] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [service-stop] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [before-cluster-shutdown] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [cluster-sharding-shutdown-region] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [cluster-leave] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [cluster-exiting] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [cluster-exiting-done] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [cluster-shutdown] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [before-actor-system-terminate] with [0] tasks.
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][CoordinatedShutdown (akka://FunctionRefSpec-7)] Performing phase [actor-system-terminate] with [1] tasks: [terminate-system]
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0016][ActorSystem(FunctionRefSpec-7)] System shutdown initiated
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0022][EventStream] Shutting down: StandardOutLogger started
[DEBUG][04/24/2024 12:15:54.745Z][Thread 0022][EventStream] All default loggers stopped

@Aaronontheweb
Copy link
Member Author

Welp, this was dumb - old bug in the test suite that got "fixed" when I made sure that Watch / Unwatch worked properly in the TestKit.

@Aaronontheweb Aaronontheweb changed the title [WIP] Fix racy FunctionRefSpecs Fix racy FunctionRefSpecs Apr 24, 2024
@Aaronontheweb Aaronontheweb marked this pull request as ready for review April 24, 2024 12:25
Copy link
Member Author

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed my changes

src/core/Akka.Tests/Actor/FunctionRefSpecs.cs Show resolved Hide resolved
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) April 24, 2024 12:26
@Aaronontheweb Aaronontheweb merged commit f8a3c88 into akkadotnet:dev Apr 24, 2024
12 checks passed
@Aaronontheweb Aaronontheweb deleted the racy-FunctionRefSpecs branch April 24, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant