Skip to content

Commit bdd77f9

Browse files
committed
don't wait for TestActor to start
1 parent 539867d commit bdd77f9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/core/Akka.TestKit/TestKitBase.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ protected virtual void InitializeTest(ActorSystem system, ActorSystemSetup confi
172172

173173
var testActor = CreateInitialTestActor(system, testActorName);
174174

175-
// Wait for the testactor to start
176-
WaitUntilTestActorIsReady(testActor, _testState.TestKitSettings);
177-
178175
if (this is not INoImplicitSender)
179176
{
180177
InternalCurrentActorCellKeeper.Current = (ActorCell)((ActorRefWithCell)testActor).Underlying;
@@ -731,12 +728,10 @@ private IActorRef CreateInitialTestActor(ActorSystem system, string name)
731728
// executes on the calling thread, we need to trigger the mailbox to run now.
732729
// Sending any message to the TestActor will cause its mailbox to process
733730
// both the pending Supervise message and our message synchronously.
734-
if (testActor is RepointableActorRef repointable && !repointable.IsStarted)
735-
{
736-
// Send a dummy message to force the mailbox to run on this thread
737-
// This will process the Supervise message and complete initialization
738-
testActor.Tell(new TestActor.SetIgnore(null));
739-
}
731+
732+
// Send a dummy message to force the mailbox to run on this thread
733+
// This will process the Supervise message and complete initialization
734+
testActor.Tell(new TestActor.SetIgnore(null));
740735

741736
return testActor;
742737
}

0 commit comments

Comments
 (0)