From f876faa41bf2bfe0204267a8c866a77568883aa4 Mon Sep 17 00:00:00 2001 From: Alexey Efimov Date: Wed, 3 Jan 2024 11:14:54 +0000 Subject: [PATCH] fix http tests to wait for port binding --- ydb/library/actors/http/http_ut.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ydb/library/actors/http/http_ut.cpp b/ydb/library/actors/http/http_ut.cpp index 2b5cc6c02f1b..6c92f3b938f0 100644 --- a/ydb/library/actors/http/http_ut.cpp +++ b/ydb/library/actors/http/http_ut.cpp @@ -303,8 +303,8 @@ Y_UNIT_TEST_SUITE(HttpProxy) { NActors::IActor* proxy = NHttp::CreateHttpProxy(); NActors::TActorId proxyId = actorSystem.Register(proxy); - actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true); - actorSystem.DispatchEvents(); + actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true); + actorSystem.GrabEdgeEvent(handle); NActors::TActorId serverId = actorSystem.AllocateEdgeActor(); actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true); @@ -336,8 +336,8 @@ Y_UNIT_TEST_SUITE(HttpProxy) { NActors::IActor* proxy = NHttp::CreateHttpProxy(); NActors::TActorId proxyId = actorSystem.Register(proxy); - actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true); - actorSystem.DispatchEvents(); + actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true); + actorSystem.GrabEdgeEvent(handle); NActors::TActorId serverId = actorSystem.AllocateEdgeActor(); actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true); @@ -432,8 +432,8 @@ CRA/5XcX13GJwHHj6LCoc3sL7mt8qV9HKY2AOZ88mpObzISZxgPpdKCfjsrdm63V add->CertificateFile = certificateFile.Name(); add->PrivateKeyFile = certificateFile.Name(); ///////// - actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), add.Release()), 0, true); - actorSystem.DispatchEvents(); + actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), add.Release()), 0, true); + actorSystem.GrabEdgeEvent(handle); NActors::TActorId serverId = actorSystem.AllocateEdgeActor(); actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true); @@ -487,8 +487,8 @@ CRA/5XcX13GJwHHj6LCoc3sL7mt8qV9HKY2AOZ88mpObzISZxgPpdKCfjsrdm63V NActors::IActor* proxy = NHttp::CreateHttpProxy(); NActors::TActorId proxyId = actorSystem.Register(proxy); - actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true); - actorSystem.DispatchEvents(); + actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true); + actorSystem.GrabEdgeEvent(handle); NActors::TActorId serverId = actorSystem.AllocateEdgeActor(); actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true);