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

Akka.Tests.Delivery.ReliableDeliveryRandomSpecs.ReliableDelivery_with_random_failures_must_work_with_flaky_network_without_resending failure #7033

Closed
Aaronontheweb opened this issue Jan 3, 2024 · 1 comment · Fixed by #7034
Labels
Milestone

Comments

@Aaronontheweb
Copy link
Member

Version Information
Version of Akka.NET? v1.5,14
Which Akka.NET Modules? Akka

Describe the bug

After two minutes Akka.Tests.Delivery.ReliableDeliveryRandomSpecs.ReliableDelivery_with_random_failures_must_work_with_flaky_network_without_resending was unable to complete successfully. Full log is attached.

This looks like a legitimate race condition with the feature itself, rather than the test testing it.

To Reproduce

Unknown, but the test can reproduce it periodically. Logs are attached:

Akka.Tests.Delivery.ReliableDelivery_with_random_failures_must_work_with_flaky_network_without_resending.log

@Aaronontheweb Aaronontheweb added this to the 1.5.15 milestone Jan 3, 2024
Aaronontheweb added a commit to Aaronontheweb/akka.net that referenced this issue Jan 3, 2024
@Aaronontheweb
Copy link
Member Author

Found this issue after I relaxed the log levels:

[DEBUG][01/03/2024 20:31:42.040Z][Thread 0033][akka://test/user/producer-controller-1] Received request, confirmed [11], requested [21], current [31]
[ERROR][01/03/2024 20:31:42.041Z][Thread 0031][akka://test/system/log-test] Received a malformed formatted message. Log level: [DebugLevel], Template: [Expanded requestedSeqNr from [{0}] to [{1}], because current [{3}] and all were probably lost.], args: [Akka.Event.LogValues`3[System.Int64,System.Int64,System.Int64]]
Cause: System.FormatException: Received a malformed formatted message. Log level: [DebugLevel], Template: [Expanded requestedSeqNr from [{0}] to [{1}], because current [{3}] and all were probably lost.], args: [Akka.Event.LogValues`3[System.Int64,System.Int64,System.Int64]]
 ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.ValueStringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ReadOnlySpan`1 args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ReadOnlySpan`1 args)
   at System.String.Format(String format, Object[] args)
   at Akka.Event.DefaultLogMessageFormatter.Format(String format, IEnumerable`1 args) in C:\Repositories\olympus\akka.net\src\core\Akka\Event\DefaultLogMessageFormatter.cs:line 28
   at Akka.Event.LogMessage`1.ToString() in C:\Repositories\olympus\akka.net\src\core\Akka\Event\LogMessage.cs:line 79
   at System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted[T](T value)
   at Akka.Event.LogEvent.ToString() in C:\Repositories\olympus\akka.net\src\core\Akka\Event\LogEvent.cs:line 96
   at Akka.TestKit.Xunit2.Internals.TestOutputLogger.HandleLogEvent(LogEvent e) in C:\Repositories\olympus\akka.net\src\contrib\testkits\Akka.TestKit.Xunit2\Internals\Loggers.cs:line 46
   --- End of inner exception stack trace ---
   at Akka.TestKit.Xunit2.Internals.TestOutputLogger.HandleLogEvent(LogEvent e) in C:\Repositories\olympus\akka.net\src\contrib\testkits\Akka.TestKit.Xunit2\Internals\Loggers.cs:line 56
   at lambda_method20(Closure, Object, Action`1, Action`1, Action`1, Action`1, Action`1)
   at Akka.Tools.MatchHandler.PartialHandlerArgumentsCapture`6.Handle(T value) in C:\Repositories\olympus\akka.net\src\core\Akka\Util\MatchHandler\PartialHandlerArgumentsCapture.cs:line 216
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction) in C:\Repositories\olympus\akka.net\src\core\Akka\Actor\ReceiveActor.cs:line 78
   at Akka.Actor.ReceiveActor.OnReceive(Object message) in C:\Repositories\olympus\akka.net\src\core\Akka\Actor\ReceiveActor.cs:line 73
   at Akka.Actor.UntypedActor.Receive(Object message) in C:\Repositories\olympus\akka.net\src\core\Akka\Actor\UntypedActor.cs:line 26
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message) in C:\Repositories\olympus\akka.net\src\core\Akka\Actor\ActorBase.cs:line 214
   at Akka.Actor.ActorCell.ReceiveMessage(Object message) in C:\Repositories\olympus\akka.net\src\core\Akka\Actor\ActorCell.DefaultMessages.cs:line 185
   at Akka.Actor.ActorCell.Invoke(Envelope envelope) in C:\Repositories\olympus\akka.net\src\core\Akka\Actor\ActorCell.DefaultMessages.cs:line 87

This shouldn't be affecting the participating actors from doing their processing, but it's worth resolving anyway.

Aaronontheweb added a commit that referenced this issue Jan 4, 2024
* Troubleshoot ReliableDeliveryRandomSpecs

reproduce #7033

* fixed logging bug

* adding better logging around fuzz factor

* found the bug
Aaronontheweb added a commit that referenced this issue Jan 17, 2024
…s TestKit methods and fix `Watch` / `Unwatch` bugs (#7037)

* Troubleshoot ReliableDeliveryRandomSpecs

reproduce #7033

* fixed logging bug

* adding better logging around fuzz factor

* found the bug

* Address racy Akka.Persistence.Testkit.Tests

Trying to reproduce some test failures discovered on the build server

* removed all `ConfigureAwait(false)` usages from inside TestKit

* disabling annoying test

* fix another additional racy test

* attempting to debug Akka.Persistence.TestKit.Tests

* minor refactorings

* fixed racy `Watch` call

* cleaning up additional specs

* simplified `InternalTestActor` design

* fixed race

* going to grab logs for racy Akka.Persistence.TestKit.Test

* added debug logging for some racy specs

* added API approvals

* harden racy circuit breaker specs

* added `WatchAsync` and `UnwatchAsync` methods to TestKit

* fixed ResizerSpec

* fixed feedback on internal TestActor messages

* clean up `.Result` instances

* cleaned up `.Result` usages in `TestKitBase_Expect.cs`

* Update TestKitBase_ExpectAllWithPredicates.cs

* Update TestKitBase_Receive.cs

* Update TestKitBase_Receive.cs

* Update TestKitBase_Within.cs

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

Successfully merging a pull request may close this issue.

1 participant