From 90dd6dc7e2538e8b0fde2c1bc0e6ef576285ceaa Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Mon, 28 Jul 2025 14:31:00 -0400 Subject: [PATCH] Fix descriptor pool TODO Seems that `protobuf` no longer segfaults using the dynamic descriptor pool, so we can finish off this TODO. --- test/conformance/runner.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/conformance/runner.py b/test/conformance/runner.py index 4ef90279..1185424e 100644 --- a/test/conformance/runner.py +++ b/test/conformance/runner.py @@ -19,10 +19,6 @@ from google.protobuf import any_pb2, descriptor, descriptor_pool, message_factory import protovalidate - -# TODO(afuller): Use dynamic descriptor pool based on the FileDescriptorSet -# in the TestConformanceRequest, once the Python protobuf library no longer -# segfaults when using a dynamic descriptor pool. from buf.validate.conformance.cases import ( bool_pb2, # noqa: F401 bytes_pb2, # noqa: F401 @@ -93,10 +89,9 @@ def run_any_test_case( def run_conformance_test( request: harness_pb2.TestConformanceRequest, ) -> harness_pb2.TestConformanceResponse: - # pool = descriptor_pool.DescriptorPool() - # for fd in request.fdset.file: - # pool.Add(fd) - pool = descriptor_pool.Default() + pool = descriptor_pool.DescriptorPool() + for fd in request.fdset.file: + pool.Add(fd) result = harness_pb2.TestConformanceResponse() for name, tc in request.cases.items(): run_any_test_case(pool, tc, result.results[name])