[fix][python-function] Fix the failed CPP test CI caused by python function - #15827
[fix][python-function] Fix the failed CPP test CI caused by python function#15827zymap wants to merge 5 commits into
Conversation
…nction
---
**Motivation**
The CPP ci test always failed by the python function tests
```
ERROR: test_python_instance (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_python_instance
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/pulsar/pulsar-functions/instance/target/python-instance/tests/test_python_instance.py", line 28, in <module>
from python_instance import InstanceConfig
File "/pulsar/pulsar-functions/instance/target/python-instance/python_instance.py", line 37, in <module>
import Function_pb2
File "/pulsar/pulsar-functions/instance/target/python-instance/Function_pb2.py", line 51, in <module>
_descriptor.EnumValueDescriptor(
File "/usr/local/lib/python3.8/dist-packages/google/protobuf/descriptor.py", line 755, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
```
**Modification**
Regenerate the proto file for python instance
|
Looks like that because we upgraded the python version in this PR |
|
Something wrong with bookkeeper client: |
|
Protobuf was upgraded in #15344 . Is protobuf 3.20.0 compatible with the bookkeeper python client? |
@lhotari But we need to upgrade the bookkeeper Protobuf to the 3.19.0+ then regenerate the code? |
@zymap I guess so, but that would first require the change in Bookkeeper. I wonder if it would be able to downgrade Protobuf on Pulsar side so that we wouldn't have to depend on a Bookkeeper upgrade. |
|
CPP flaky test: |
|
The function tests failed by the same reason: |
(cherry picked from commit 437388a)
| // skip this tests and fix it later | ||
| // @Test(groups = {"python_state", "state", "function", "python_function"}) |
There was a problem hiding this comment.
Is this also required with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python ?
There was a problem hiding this comment.
Yes. The function tests using python runtime will meet the same exception. I added the variable in the docker, and I will revert this change.
|
@zymap FYI , #15846 (comment) . The PR will fix the dependencies in the Pulsar's Python client so that Protobuf package version is limited to 3.20.* . |
|
The pr had no activity for 30 days, mark with Stale label. |
Motivation
The CPP ci test always failed by the python function tests
Modification
Regenerate the proto file for the python instance