Skip to content

Commit f876faa

Browse files
committed
fix http tests to wait for port binding
1 parent b38baa9 commit f876faa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ydb/library/actors/http/http_ut.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ Y_UNIT_TEST_SUITE(HttpProxy) {
303303

304304
NActors::IActor* proxy = NHttp::CreateHttpProxy();
305305
NActors::TActorId proxyId = actorSystem.Register(proxy);
306-
actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true);
307-
actorSystem.DispatchEvents();
306+
actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true);
307+
actorSystem.GrabEdgeEvent<NHttp::TEvHttpProxy::TEvConfirmListen>(handle);
308308

309309
NActors::TActorId serverId = actorSystem.AllocateEdgeActor();
310310
actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true);
@@ -336,8 +336,8 @@ Y_UNIT_TEST_SUITE(HttpProxy) {
336336

337337
NActors::IActor* proxy = NHttp::CreateHttpProxy();
338338
NActors::TActorId proxyId = actorSystem.Register(proxy);
339-
actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true);
340-
actorSystem.DispatchEvents();
339+
actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true);
340+
actorSystem.GrabEdgeEvent<NHttp::TEvHttpProxy::TEvConfirmListen>(handle);
341341

342342
NActors::TActorId serverId = actorSystem.AllocateEdgeActor();
343343
actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true);
@@ -432,8 +432,8 @@ CRA/5XcX13GJwHHj6LCoc3sL7mt8qV9HKY2AOZ88mpObzISZxgPpdKCfjsrdm63V
432432
add->CertificateFile = certificateFile.Name();
433433
add->PrivateKeyFile = certificateFile.Name();
434434
/////////
435-
actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), add.Release()), 0, true);
436-
actorSystem.DispatchEvents();
435+
actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), add.Release()), 0, true);
436+
actorSystem.GrabEdgeEvent<NHttp::TEvHttpProxy::TEvConfirmListen>(handle);
437437

438438
NActors::TActorId serverId = actorSystem.AllocateEdgeActor();
439439
actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true);
@@ -487,8 +487,8 @@ CRA/5XcX13GJwHHj6LCoc3sL7mt8qV9HKY2AOZ88mpObzISZxgPpdKCfjsrdm63V
487487

488488
NActors::IActor* proxy = NHttp::CreateHttpProxy();
489489
NActors::TActorId proxyId = actorSystem.Register(proxy);
490-
actorSystem.Send(new NActors::IEventHandle(proxyId, TActorId(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true);
491-
actorSystem.DispatchEvents();
490+
actorSystem.Send(new NActors::IEventHandle(proxyId, actorSystem.AllocateEdgeActor(), new NHttp::TEvHttpProxy::TEvAddListeningPort(port)), 0, true);
491+
actorSystem.GrabEdgeEvent<NHttp::TEvHttpProxy::TEvConfirmListen>(handle);
492492

493493
NActors::TActorId serverId = actorSystem.AllocateEdgeActor();
494494
actorSystem.Send(new NActors::IEventHandle(proxyId, serverId, new NHttp::TEvHttpProxy::TEvRegisterHandler("/test", serverId)), 0, true);

0 commit comments

Comments
 (0)