Skip to content

Commit ab4ec31

Browse files
Fix descriptor pool TODO (#343)
Seems that `protobuf` no longer segfaults using the dynamic descriptor pool, so we can finish off this TODO.
1 parent caae239 commit ab4ec31

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/conformance/runner.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
from google.protobuf import any_pb2, descriptor, descriptor_pool, message_factory
2020

2121
import protovalidate
22-
23-
# TODO(afuller): Use dynamic descriptor pool based on the FileDescriptorSet
24-
# in the TestConformanceRequest, once the Python protobuf library no longer
25-
# segfaults when using a dynamic descriptor pool.
2622
from buf.validate.conformance.cases import (
2723
bool_pb2, # noqa: F401
2824
bytes_pb2, # noqa: F401
@@ -93,10 +89,9 @@ def run_any_test_case(
9389
def run_conformance_test(
9490
request: harness_pb2.TestConformanceRequest,
9591
) -> harness_pb2.TestConformanceResponse:
96-
# pool = descriptor_pool.DescriptorPool()
97-
# for fd in request.fdset.file:
98-
# pool.Add(fd)
99-
pool = descriptor_pool.Default()
92+
pool = descriptor_pool.DescriptorPool()
93+
for fd in request.fdset.file:
94+
pool.Add(fd)
10095
result = harness_pb2.TestConformanceResponse()
10196
for name, tc in request.cases.items():
10297
run_any_test_case(pool, tc, result.results[name])

0 commit comments

Comments
 (0)