Skip to content

harden Bugfix4360Spec - #5256

Merged
Aaronontheweb merged 2 commits into
akkadotnet:devfrom
Aaronontheweb:fix/Bugfix4360Spec
Sep 6, 2021
Merged

Aaronontheweb merged 2 commits into
akkadotnet:devfrom
Aaronontheweb:fix/Bugfix4360Spec

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Member

The AwaitAssert is actually what made this spec racy

The `AwaitAssert` is actually what made this spec racy
@Aaronontheweb Aaronontheweb added tests akka-persistence-sql-common Akka.Persistence.Sql.Common labels Sep 6, 2021
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) September 6, 2021 16:59
ExpectTerminated(recoveryActor);

// recreate the actor and recover
var recoveryActor2 = Sys.ActorOf(Props.Create(() => new RecoverActor(TestActor)), recoveryActor.Path.Name);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Once the Terminated is received, this actor should be safe to recreate again right away.

If it's not - we should do a "double-tap" and get a second ExpectTerminated instead of an AwaitAssert in this case.

var r2 = ExpectMsg<IEnumerable<string>>(TimeSpan.FromMilliseconds(100));
r2.Should().Contain(new[] { "foo", "bar" });
}, interval:TimeSpan.FromMilliseconds(150));
var r2 = ExpectMsg<IEnumerable<string>>();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Use a longer timeout instead of AwaitAssert

@Aaronontheweb
Aaronontheweb merged commit b39bce3 into akkadotnet:dev Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

akka-persistence-sql-common Akka.Persistence.Sql.Common tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant