protoc-gen-validate icon indicating copy to clipboard operation
protoc-gen-validate copied to clipboard

`make bazel-tests` is broken

Open h-otter opened this issue 2 years ago • 0 comments

In CI of https://github.com/envoyproxy/protoc-gen-validate/pull/586, make bazel-tests fails for a reason which is not related to the changes of PR.

The output looks like this:

================================================================================
INFO: Elapsed time: 69.380s, Critical Path: 53.66s
INFO: 6 processes: 10 processwrapper-sandbox.
INFO: Build completed, 1 test FAILED, 6 total actions
//tests/harness/cc:cc_diamond_test                              (cached) PASSED in 0.2s
//tests/harness/cc:polymorphic_test                             (cached) PASSED in 1.5s
//tests/harness/executor:executor_cc_test                       (cached) PASSED in 6.9s
  Stats over 5 runs: max = 6.9s, min = 5.6s, avg = 6.1s, dev = 0.5s
//tests/harness/executor:executor_go_test                       (cached) PASSED in 3.9s
  Stats over 5 runs: max = 3.9s, min = 2.3s, avg = 3.2s, dev = 0.7s
//tests/harness/executor:executor_java_test                     (cached) PASSED in 197.9s
  Stats over 5 runs: max = 197.9s, min = 85.1s, avg = 167.7s, dev = 41.6s
//tests/harness/python:python-requirements-match                (cached) PASSED in 0.5s
//tests/harness/executor:executor_python_test                            FAILED in 5 out of 5 in 52.2s
  Stats over 5 runs: max = 52.2s, min = 13.8s, avg = 44.5s, dev = 15.3s
  /root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/testlogs/tests/harness/executor/executor_python_test/shard_3_of_5/test.log
  /root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/testlogs/tests/harness/executor/executor_python_test/shard_4_of_5/test.log
  /root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/testlogs/tests/harness/executor/executor_python_test/shard_5_of_5/test.log
  /root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/testlogs/tests/harness/executor/executor_python_test/shard_1_of_5/test.log
  /root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/testlogs/tests/harness/executor/executor_python_test/shard_2_of_5/test.log

Executed 1 out of 7 tests: 6 tests pass and 1 fails locally.
INFO: Build completed, 1 test FAILED, 6 total actions

and a lot of similar output like this:

[sfixed32 - not in - invalid] (python harness) executor error: [tests/harness/python/python-harness tests/harness/python/python-harness] failed execution (exit status 1) - captured stderr:
Traceback (most recent call last):
  File "/root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/sandbox/processwrapper-sandbox/1267/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/bin/tests/harness/executor/executor_python_test.runfiles/com_envoyproxy_protoc_gen_validate/tests/harness/python/harness.py", line 6, in <module>
    from tests.harness.harness_pb2 import TestCase, TestResult
  File "/root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/sandbox/processwrapper-sandbox/1267/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/bin/tests/harness/executor/executor_python_test.runfiles/com_envoyproxy_protoc_gen_validate/tests/harness/harness_pb2.py", line 38, in <module>
    _descriptor.FieldDescriptor(
  File "/root/.cache/bazel/_bazel_root/f3b2f14a341ae4a212816bde0c6dce42/sandbox/processwrapper-sandbox/1267/execroot/com_envoyproxy_protoc_gen_validate/bazel-out/k8-fastbuild/bin/tests/harness/executor/executor_python_test.runfiles/pgv_pip_deps/pypi__protobuf/google/protobuf/descriptor.py", line 560, 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

h-otter avatar Jul 22 '22 06:07 h-otter