Skip to content

Commit

Permalink
Harden Lease docs unit test (#7394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Nov 19, 2024
1 parent bd8a823 commit e412b58
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/Akka.Docs.Tests/Utilities/LeaseActorDocSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,18 @@ public LeaseActorDocSpec(ITestOutputHelper output)
TestLeaseExt.Get(Sys);
}

private TestLease GetLease() => TestLeaseExt.Get(Sys).GetTestLease(ResourceId);
private TestLease GetLease()
{
TestLease? testLease = null;

// wait until TestLease is created.
AwaitAssert(() =>
{
testLease = TestLeaseExt.Get(Sys).GetTestLease(ResourceId);
}, 3.Seconds(), 100.Milliseconds());

return testLease!;
}

[Fact]
public void Actor_with_lease_should_not_be_active_until_lease_is_acquired()
Expand Down

0 comments on commit e412b58

Please sign in to comment.