Skip to content

Commit ea7a15c

Browse files
authored
Make sure mailboxes in test actorsystems are in a locked state (#11837)
1 parent 923d372 commit ea7a15c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ydb/core/util/actorsys_test/testactorsys.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,12 @@ class TTestActorSystem {
492492
}
493493

494494
// register actor in mailbox
495-
const auto& it = Mailboxes.try_emplace(TMailboxId(nodeId, poolId, mboxId)).first;
495+
auto [it, mboxInserted] = Mailboxes.try_emplace(TMailboxId(nodeId, poolId, mboxId));
496496
TMailboxInfo& mbox = it->second;
497497
mbox.Hint = mboxId;
498+
if (mboxInserted) {
499+
mbox.LockFromFree();
500+
}
498501
mbox.AttachActor(ActorLocalId, actor);
499502

500503
// generate actor id

ydb/library/actors/testlib/test_runtime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ namespace NActors {
928928
RegistrationObserver(*this, parentId ? parentId : CurrentRecipient, actorId);
929929
DoActorInit(node->ActorSystem.Get(), actor, actorId, parentId ? parentId : CurrentRecipient);
930930

931-
mailbox->Unlock(node->ExecutorPools[0], GetCycleCountFast(), revolvingCounter);
931+
// Note: test actorsystem mailboxes stay permanently locked
932932

933933
return actorId;
934934
}

0 commit comments

Comments
 (0)