Skip to content

Commit

Permalink
Test error delivery in result receiver (ydb-platform#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored and azevaykin committed Dec 19, 2023
1 parent 60f9bed commit e6e7b74
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ydb/library/yql/providers/dq/actors/actors_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ using namespace NYql::NDqs;

Y_UNIT_TEST_SUITE(ResultReceiver) {

auto ResultReceiver() {
auto ResultReceiver(TActorId executerId = {}) {
TDqConfiguration::TPtr settings = new TDqConfiguration();
auto receiver = MakeResultReceiver(
{}, // columns,
TActorId{}, // executerId
executerId,
"traceId",
settings, // settings
settings,
{}, // secureParams
"", // resultType ?
{}, // graphExecutionEventsId ?
Expand All @@ -37,5 +37,17 @@ Y_UNIT_TEST(ReceiveStatus) {
runtime.Send(new IEventHandle(receiverId, sender, new TEvReadyState(), 0, true));
}

Y_UNIT_TEST(ReceiveError) {
TTestActorRuntimeBase runtime;
runtime.Initialize();

auto executerId = runtime.AllocateEdgeActor();
auto receiverId = runtime.Register(ResultReceiver(executerId).Release());
runtime.Send(new IEventHandle(receiverId, {}, new NActors::TEvents::TEvUndelivered(0,0), 0, true));

auto response = runtime.GrabEdgeEvent<TEvDqFailure>();
UNIT_ASSERT_EQUAL(response->Record.GetStatusCode(), NYql::NDqProto::StatusIds::UNAVAILABLE);
}

} // Y_UNIT_TEST_SUITE(ResultReceiver)

0 comments on commit e6e7b74

Please sign in to comment.