MCPcopy Create free account
hub / github.com/bytedance/bolt / DEBUG_ONLY_TEST_F

Function DEBUG_ONLY_TEST_F

bolt/exec/tests/DriverTest.cpp:1075–1192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073 .values({rows}, true)
1074 .addNode([](std::string id, core::PlanNodePtr input) {
1075 return std::make_shared<ThrowNode>(
1076 id, ThrowNode::OperatorMethod::kAddInput, input);
1077 })
1078 .planNode();
1079 CursorParameters params;
1080 params.planNode = plan;
1081 params.maxDrivers = 5;
1082 auto cursor = TaskCursor::create(params);
1083 auto task = cursor->task();
1084 // Ensure execution threw correct error.
1085 BOLT_ASSERT_THROW(cursor->moveNext(), "Too many drivers");
1086 EXPECT_EQ(TaskState::kFailed, task->state());
1087}
1088
1089TEST_F(DriverTest, nonBoltOperatorException) {
1090 Operator::registerOperator(
1091 std::make_unique<ThrowNodeFactory>(std::numeric_limits<uint32_t>::max()));
1092
1093 auto rows = makeRowVector({makeFlatVector<int32_t>({1, 2, 3})});
1094
1095 auto makePlan = [&](ThrowNode::OperatorMethod throwingMethod) {
1096 return PlanBuilder()
1097 .values({rows}, true)
1098 .addNode([throwingMethod](std::string id, core::PlanNodePtr input) {
1099 return std::make_shared<ThrowNode>(id, throwingMethod, input);
1100 })
1101 .planNode();
1102 };
1103
1104 BOLT_ASSERT_THROW(
1105 AssertQueryBuilder(makePlan(ThrowNode::OperatorMethod::kIsBlocked))
1106 .copyResults(pool()),
1107 "Operator::isBlocked failed for [operator: Throw, plan node ID: 1]");
1108
1109 BOLT_ASSERT_THROW(
1110 AssertQueryBuilder(makePlan(ThrowNode::OperatorMethod::kNeedsInput))
1111 .copyResults(pool()),
1112 "Operator::needsInput failed for [operator: Throw, plan node ID: 1]");
1113
1114 BOLT_ASSERT_THROW(
1115 AssertQueryBuilder(makePlan(ThrowNode::OperatorMethod::kAddInput))
1116 .copyResults(pool()),
1117 "Operator::addInput failed for [operator: Throw, plan node ID: 1]");
1118
1119 BOLT_ASSERT_THROW(
1120 AssertQueryBuilder(makePlan(ThrowNode::OperatorMethod::kNoMoreInput))
1121 .copyResults(pool()),
1122 "Operator::noMoreInput failed for [operator: Throw, plan node ID: 1]");
1123
1124 BOLT_ASSERT_THROW(
1125 AssertQueryBuilder(makePlan(ThrowNode::OperatorMethod::kGetOutput))
1126 .copyResults(pool()),
1127 "Operator::getOutput failed for [operator: Throw, plan node ID: 1]");
1128}
1129
1130DEBUG_ONLY_TEST_F(DriverTest, driverSuspensionRaceWithTaskPause) {
1131 struct {
1132 int numDrivers;

Callers

nothing calls this directly

Calls 15

waitForTaskCompletionFunction · 0.85
driverThreadContextFunction · 0.85
PlanBuilderClass · 0.85
requestPauseMethod · 0.80
waitMethod · 0.80
testingVisitDriversMethod · 0.80
suspendedMethod · 0.80
requestAbortMethod · 0.80
requestCancelMethod · 0.80
requestYieldMethod · 0.80
driverMethod · 0.80
testingOperatorCtxMethod · 0.80

Tested by

no test coverage detected