修复若干问题

This commit is contained in:
2026-08-15 02:51:11 +08:00
parent 282768e0ea
commit 04a9156cd6
25 changed files with 631 additions and 176 deletions
@@ -181,6 +181,13 @@ TEST(render_dag_test,
ASSERT_EQ(analysis.workers.size(), 1U);
EXPECT_EQ(analysis.workers.front().work_duration_ns, 20U);
EXPECT_DOUBLE_EQ(analysis.workers.front().utilization, 0.1);
const auto statistics = analyze_node_statistics(
std::span<const Frame_Analysis>(&analysis, 1));
ASSERT_EQ(statistics.size(), 1U);
EXPECT_DOUBLE_EQ(statistics.front().average_cpu_ns, 20.0);
EXPECT_DOUBLE_EQ(statistics.front().average_external_ns, 180.0);
EXPECT_DOUBLE_EQ(statistics.front().p95_cpu_ns, 20.0);
EXPECT_DOUBLE_EQ(statistics.front().p95_external_ns, 180.0);
}
TEST(render_dag_test, failed_capture_ticket_is_retried_until_the_requested_frame_completes) {
@@ -106,6 +106,21 @@ TEST(external_operation_test, completion_before_subscription_is_delivered_once)
EXPECT_EQ(completion_count, 1);
}
TEST(external_operation_test,
callback_exceptions_are_contained_for_both_completion_orders) {
External_Operation_Source completed_first;
const auto completed_operation = completed_first.operation();
ASSERT_TRUE(completed_first.complete());
EXPECT_NO_THROW(completed_operation.on_complete(
[](std::exception_ptr) { throw std::runtime_error("late callback"); }));
External_Operation_Source subscribed_first;
const auto subscribed_operation = subscribed_first.operation();
subscribed_operation.on_complete(
[](std::exception_ptr) { throw std::runtime_error("early callback"); });
EXPECT_TRUE(subscribed_first.complete());
}
TEST(render_graph_runtime_test,
external_successor_stays_blocked_until_operation_completes) {
const auto plan = two_node_plan();