From 0496589405496e4bf42661556a80bc43b01aaa8d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 11 Oct 2023 17:46:20 -0700 Subject: [PATCH] Revert "[Python run_test] Fix run_test" (#34667) Reverts grpc/grpc#34292 --- .../grpc/_cython/_cygrpc/aio/server.pxd.pxi | 1 - .../grpc/_cython/_cygrpc/aio/server.pyx.pxi | 5 +- src/python/grpcio_tests/commands.py | 117 +++++++++++ src/python/grpcio_tests/setup.py | 2 +- .../tests/_sanity/_sanity_test.py | 3 +- .../grpcio_tests/tests/admin/BUILD.bazel | 6 +- .../grpcio_tests/tests/admin/__init__.py | 13 -- .../admin/{admin_test.py => test_admin.py} | 0 .../grpcio_tests/tests/csds/BUILD.bazel | 6 +- .../grpcio_tests/tests/csds/__init__.py | 13 -- .../tests/csds/{csds_test.py => test_csds.py} | 1 + src/python/grpcio_tests/tests/tests.json | 184 +++++++++--------- .../tests/unit/_dynamic_stubs_test.py | 7 +- src/python/grpcio_tests/tests_aio/tests.json | 84 ++++---- .../tests_aio/unit/metadata_test.py | 6 +- .../tests_aio/unit/server_test.py | 16 +- .../grpcio_tests/tests_gevent/tests.json | 1 + .../dockerfile/compile_python_310.include | 2 +- .../dockerfile/compile_python_311.include | 2 +- .../dockerfile/compile_python_37.include | 2 +- .../dockerfile/compile_python_38.include | 2 +- .../Dockerfile.template | 4 - .../Dockerfile.template | 4 - .../dockerimage_current_versions.bzl | 4 +- tools/distrib/python/xds_protos/build.py | 2 +- ...hon_debian11_default_arm64.current_version | 2 +- .../python_debian11_default_arm64/Dockerfile | 4 - ...ython_debian11_default_x64.current_version | 2 +- .../python_debian11_default_x64/Dockerfile | 12 +- .../artifacts/build_artifact_python.sh | 2 +- .../run_tests/helper_scripts/build_python.sh | 2 +- tools/run_tests/run_tests.py | 7 +- 32 files changed, 292 insertions(+), 226 deletions(-) delete mode 100644 src/python/grpcio_tests/tests/admin/__init__.py rename src/python/grpcio_tests/tests/admin/{admin_test.py => test_admin.py} (100%) delete mode 100644 src/python/grpcio_tests/tests/csds/__init__.py rename src/python/grpcio_tests/tests/csds/{csds_test.py => test_csds.py} (99%) create mode 100644 src/python/grpcio_tests/tests_gevent/tests.json diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi index ce82592db12..fe10c3883c3 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi @@ -29,7 +29,6 @@ cdef class RPCState(GrpcCallWrapper): cdef bint metadata_sent cdef bint status_sent cdef grpc_status_code status_code - cdef object py_status_code cdef str status_details cdef tuple trailing_metadata cdef object compression_algorithm diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi index e191878c688..5adaeb48896 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi @@ -55,7 +55,6 @@ cdef class RPCState: self.metadata_sent = False self.status_sent = False self.status_code = StatusCode.ok - self.py_status_code = None self.status_details = '' self.trailing_metadata = _IMMUTABLE_EMPTY_METADATA self.compression_algorithm = None @@ -185,7 +184,6 @@ cdef class _ServicerContext: self._rpc_state.status_details = details actual_code = get_status_code(code) - self._rpc_state.py_status_code = code self._rpc_state.status_code = actual_code self._rpc_state.status_sent = True @@ -215,10 +213,9 @@ cdef class _ServicerContext: def set_code(self, object code): self._rpc_state.status_code = get_status_code(code) - self._rpc_state.py_status_code = code def code(self): - return self._rpc_state.py_status_code + return self._rpc_state.status_code def set_details(self, str details): self._rpc_state.status_details = details diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 32311cea101..eead3c60660 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -152,6 +152,123 @@ class TestAio(setuptools.Command): sys.exit("Test failure") +class TestGevent(setuptools.Command): + """Command to run tests w/gevent.""" + + BANNED_TESTS = ( + # Fork support is not compatible with gevent + "fork._fork_interop_test.ForkInteropTest", + # These tests send a lot of RPCs and are really slow on gevent. They will + # eventually succeed, but need to dig into performance issues. + "unit._cython._no_messages_server_completion_queue_per_call_test.Test.test_rpcs", + "unit._cython._no_messages_single_server_completion_queue_test.Test.test_rpcs", + "unit._compression_test", + # TODO(https://github.com/grpc/grpc/issues/16890) enable this test + "unit._cython._channel_test.ChannelTest.test_multiple_channels_lonely_connectivity", + # I have no idea why this doesn't work in gevent, but it shouldn't even be + # using the c-core + "testing._client_test.ClientTest.test_infinite_request_stream_real_time", + # TODO(https://github.com/grpc/grpc/issues/15743) enable this test + "unit._session_cache_test.SSLSessionCacheTest.testSSLSessionCacheLRU", + # TODO(https://github.com/grpc/grpc/issues/14789) enable this test + "unit._server_ssl_cert_config_test", + # TODO(https://github.com/grpc/grpc/issues/14901) enable this test + "protoc_plugin._python_plugin_test.PythonPluginTest", + "protoc_plugin._python_plugin_test.SimpleStubsPluginTest", + # Beta API is unsupported for gevent + "protoc_plugin.beta_python_plugin_test", + "unit.beta._beta_features_test", + # TODO(https://github.com/grpc/grpc/issues/15411) unpin gevent version + # This test will stuck while running higher version of gevent + "unit._auth_context_test.AuthContextTest.testSessionResumption", + # TODO(https://github.com/grpc/grpc/issues/15411) enable these tests + "unit._channel_ready_future_test.ChannelReadyFutureTest.test_immediately_connectable_channel_connectivity", + "unit._cython._channel_test.ChannelTest.test_single_channel_lonely_connectivity", + "unit._exit_test.ExitTest.test_in_flight_unary_unary_call", + "unit._exit_test.ExitTest.test_in_flight_unary_stream_call", + "unit._exit_test.ExitTest.test_in_flight_stream_unary_call", + "unit._exit_test.ExitTest.test_in_flight_stream_stream_call", + "unit._exit_test.ExitTest.test_in_flight_partial_unary_stream_call", + "unit._exit_test.ExitTest.test_in_flight_partial_stream_unary_call", + "unit._exit_test.ExitTest.test_in_flight_partial_stream_stream_call", + # TODO(https://github.com/grpc/grpc/issues/18980): Reenable. + "unit._signal_handling_test.SignalHandlingTest", + "unit._metadata_flags_test", + "health_check._health_servicer_test.HealthServicerTest.test_cancelled_watch_removed_from_watch_list", + # TODO(https://github.com/grpc/grpc/issues/17330) enable these three tests + "channelz._channelz_servicer_test.ChannelzServicerTest.test_many_subchannels", + "channelz._channelz_servicer_test.ChannelzServicerTest.test_many_subchannels_and_sockets", + "channelz._channelz_servicer_test.ChannelzServicerTest.test_streaming_rpc", + # TODO(https://github.com/grpc/grpc/issues/15411) enable this test + "unit._cython._channel_test.ChannelTest.test_negative_deadline_connectivity", + # TODO(https://github.com/grpc/grpc/issues/15411) enable this test + "unit._local_credentials_test.LocalCredentialsTest", + # TODO(https://github.com/grpc/grpc/issues/22020) LocalCredentials + # aren't supported with custom io managers. + "unit._contextvars_propagation_test", + "testing._time_test.StrictRealTimeTest", + ) + BANNED_WINDOWS_TESTS = ( + # TODO(https://github.com/grpc/grpc/pull/15411) enable this test + "unit._dns_resolver_test.DNSResolverTest.test_connect_loopback", + # TODO(https://github.com/grpc/grpc/pull/15411) enable this test + "unit._server_test.ServerTest.test_failed_port_binding_exception", + ) + BANNED_MACOS_TESTS = ( + # TODO(https://github.com/grpc/grpc/issues/15411) enable this test + "unit._dynamic_stubs_test.DynamicStubTest", + ) + description = "run tests with gevent. Assumes grpc/gevent are installed" + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + # distutils requires this override. + pass + + def run(self): + import gevent + from gevent import monkey + + monkey.patch_all() + + threadpool = gevent.hub.get_hub().threadpool + + # Currently, each channel corresponds to a single native thread in the + # gevent threadpool. Thus, when the unit test suite spins up hundreds of + # channels concurrently, some will be starved out, causing the test to + # increase in duration. We increase the max size here so this does not + # happen. + threadpool.maxsize = 1024 + threadpool.size = 32 + + import grpc.experimental.gevent + + import tests + + grpc.experimental.gevent.init_gevent() + + import gevent + + import tests + + loader = tests.Loader() + loader.loadTestsFromNames(["tests", "tests_gevent"]) + runner = tests.Runner() + if sys.platform == "win32": + runner.skip_tests(self.BANNED_TESTS + self.BANNED_WINDOWS_TESTS) + elif sys.platform == "darwin": + runner.skip_tests(self.BANNED_TESTS + self.BANNED_MACOS_TESTS) + else: + runner.skip_tests(self.BANNED_TESTS) + result = gevent.spawn(runner.run, loader.suite) + result.join() + if not result.value.wasSuccessful(): + sys.exit("Test failure") + + class RunInterop(test.test): description = "run interop test client/server" user_options = [ diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py index 19b34ecccb8..0cef4c2755e 100644 --- a/src/python/grpcio_tests/setup.py +++ b/src/python/grpcio_tests/setup.py @@ -43,7 +43,6 @@ INSTALL_REQUIRES = ( "grpcio-status>={version}".format(version=grpc_version.VERSION), "grpcio-tools>={version}".format(version=grpc_version.VERSION), "grpcio-health-checking>={version}".format(version=grpc_version.VERSION), - "xds-protos>={version}".format(version=grpc_version.VERSION), "oauth2client>=1.4.7", "protobuf>=4.21.6rc1,!=4.22.0.*", "google-auth>=1.17.2", @@ -59,6 +58,7 @@ COMMAND_CLASS = { "run_fork": commands.RunFork, "run_interop": commands.RunInterop, "test_lite": commands.TestLite, + "test_gevent": commands.TestGevent, "test_aio": commands.TestAio, "test_py3_only": commands.TestPy3Only, } diff --git a/src/python/grpcio_tests/tests/_sanity/_sanity_test.py b/src/python/grpcio_tests/tests/_sanity/_sanity_test.py index 61751392cda..af0b2ee57c0 100644 --- a/src/python/grpcio_tests/tests/_sanity/_sanity_test.py +++ b/src/python/grpcio_tests/tests/_sanity/_sanity_test.py @@ -39,10 +39,9 @@ class SanityTest(unittest.TestCase): ) tests_json_string = pkgutil.get_data(self.TEST_PKG_PATH, "tests.json") - tests_json = json.loads(tests_json_string.decode()) + tests_json = tests_json_string.decode() self.assertSequenceEqual(tests_json, test_suite_names) - self.assertGreater(len(test_suite_names), 0) if __name__ == "__main__": diff --git a/src/python/grpcio_tests/tests/admin/BUILD.bazel b/src/python/grpcio_tests/tests/admin/BUILD.bazel index a21c8505f33..6dc80bf0bc6 100644 --- a/src/python/grpcio_tests/tests/admin/BUILD.bazel +++ b/src/python/grpcio_tests/tests/admin/BUILD.bazel @@ -13,10 +13,10 @@ # limitations under the License. py_test( - name = "admin_test", + name = "test_admin", size = "small", - srcs = ["admin_test.py"], - main = "admin_test.py", + srcs = ["test_admin.py"], + main = "test_admin.py", python_version = "PY3", deps = [ "//src/python/grpcio/grpc:grpcio", diff --git a/src/python/grpcio_tests/tests/admin/__init__.py b/src/python/grpcio_tests/tests/admin/__init__.py deleted file mode 100644 index d64db04fd01..00000000000 --- a/src/python/grpcio_tests/tests/admin/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2023 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/python/grpcio_tests/tests/admin/admin_test.py b/src/python/grpcio_tests/tests/admin/test_admin.py similarity index 100% rename from src/python/grpcio_tests/tests/admin/admin_test.py rename to src/python/grpcio_tests/tests/admin/test_admin.py diff --git a/src/python/grpcio_tests/tests/csds/BUILD.bazel b/src/python/grpcio_tests/tests/csds/BUILD.bazel index 7a2d647dcce..07b684007c9 100644 --- a/src/python/grpcio_tests/tests/csds/BUILD.bazel +++ b/src/python/grpcio_tests/tests/csds/BUILD.bazel @@ -13,10 +13,10 @@ # limitations under the License. py_test( - name = "csds_test", + name = "test_csds", size = "small", - srcs = ["csds_test.py"], - main = "csds_test.py", + srcs = ["test_csds.py"], + main = "test_csds.py", python_version = "PY3", deps = [ "//src/python/grpcio/grpc:grpcio", diff --git a/src/python/grpcio_tests/tests/csds/__init__.py b/src/python/grpcio_tests/tests/csds/__init__.py deleted file mode 100644 index d64db04fd01..00000000000 --- a/src/python/grpcio_tests/tests/csds/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2023 The gRPC Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/python/grpcio_tests/tests/csds/csds_test.py b/src/python/grpcio_tests/tests/csds/test_csds.py similarity index 99% rename from src/python/grpcio_tests/tests/csds/csds_test.py rename to src/python/grpcio_tests/tests/csds/test_csds.py index c58cb5943d2..8823444d59b 100644 --- a/src/python/grpcio_tests/tests/csds/csds_test.py +++ b/src/python/grpcio_tests/tests/csds/test_csds.py @@ -120,6 +120,7 @@ class TestCsds(unittest.TestCase): break except KeyError as e: logging.debug("Invalid config: %s\n%s: %s", config, type(e), e) + pass if ok: break time.sleep(1) diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index aa05ac18f94..60d86d8727f 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -1,95 +1,93 @@ [ - "tests._sanity._sanity_test.SanityTest", - "tests.admin.admin_test.TestAdmin", - "tests.channelz._channelz_servicer_test.ChannelzServicerTest", - "tests.csds.csds_test.TestCsds", - "tests.csds.csds_test.TestCsdsStream", - "tests.fork._fork_interop_test.ForkInteropTest", - "tests.health_check._health_servicer_test.HealthServicerBackwardsCompatibleWatchTest", - "tests.health_check._health_servicer_test.HealthServicerTest", - "tests.interop._insecure_intraop_test.InsecureIntraopTest", - "tests.interop._secure_intraop_test.SecureIntraopTest", - "tests.protoc_plugin._python_plugin_test.ModuleMainTest", - "tests.protoc_plugin._python_plugin_test.PythonPluginTest", - "tests.protoc_plugin._python_plugin_test.SimpleStubsPluginTest", - "tests.protoc_plugin._split_definitions_test.SameProtoGrpcBeforeProtoProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SameProtoMid2016ProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SameProtoProtoBeforeGrpcProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SameProtoSingleProtocExecutionProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SplitProtoGrpcBeforeProtoProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SplitProtoMid2016ProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SplitProtoProtoBeforeGrpcProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.SplitProtoSingleProtocExecutionProtocStyleTest", - "tests.protoc_plugin._split_definitions_test.WellKnownTypesTest", - "tests.protoc_plugin.beta_python_plugin_test.PythonPluginTest", - "tests.reflection._reflection_client_test.ReflectionClientTest", - "tests.reflection._reflection_servicer_test.ReflectionServicerTest", - "tests.status._grpc_status_test.StatusTest", - "tests.testing._client_test.ClientTest", - "tests.testing._server_test.FirstServiceServicerTest", - "tests.testing._time_test.StrictFakeTimeTest", - "tests.testing._time_test.StrictRealTimeTest", - "tests.unit._abort_test.AbortTest", - "tests.unit._api_test.AllTest", - "tests.unit._api_test.ChannelConnectivityTest", - "tests.unit._api_test.ChannelTest", - "tests.unit._auth_context_test.AuthContextTest", - "tests.unit._auth_test.AccessTokenAuthMetadataPluginTest", - "tests.unit._auth_test.GoogleCallCredentialsTest", - "tests.unit._channel_args_test.ChannelArgsTest", - "tests.unit._channel_close_test.ChannelCloseTest", - "tests.unit._channel_connectivity_test.ChannelConnectivityTest", - "tests.unit._channel_ready_future_test.ChannelReadyFutureTest", - "tests.unit._compression_test.CompressionTest", - "tests.unit._contextvars_propagation_test.ContextVarsPropagationTest", - "tests.unit._credentials_test.CredentialsTest", - "tests.unit._cython._cancel_many_calls_test.CancelManyCallsTest", - "tests.unit._cython._channel_test.ChannelTest", - "tests.unit._cython._fork_test.ForkPosixTester", - "tests.unit._cython._fork_test.ForkWindowsTester", - "tests.unit._cython._no_messages_server_completion_queue_per_call_test.Test", - "tests.unit._cython._no_messages_single_server_completion_queue_test.Test", - "tests.unit._cython._read_some_but_not_all_responses_test.ReadSomeButNotAllResponsesTest", - "tests.unit._cython._server_test.Test", - "tests.unit._cython.cygrpc_test.InsecureServerInsecureClient", - "tests.unit._cython.cygrpc_test.SecureServerSecureClient", - "tests.unit._cython.cygrpc_test.TypeSmokeTest", - "tests.unit._dns_resolver_test.DNSResolverTest", - "tests.unit._dynamic_stubs_test.DynamicStubTest", - "tests.unit._empty_message_test.EmptyMessageTest", - "tests.unit._error_message_encoding_test.ErrorMessageEncodingTest", - "tests.unit._exit_test.ExitTest", - "tests.unit._grpc_shutdown_test.GrpcShutdownTest", - "tests.unit._interceptor_test.InterceptorTest", - "tests.unit._invalid_metadata_test.InvalidMetadataTest", - "tests.unit._invocation_defects_test.InvocationDefectsTest", - "tests.unit._local_credentials_test.LocalCredentialsTest", - "tests.unit._logging_test.LoggingTest", - "tests.unit._metadata_code_details_test.InspectContextTest", - "tests.unit._metadata_code_details_test.MetadataCodeDetailsTest", - "tests.unit._metadata_flags_test.MetadataFlagsTest", - "tests.unit._metadata_test.MetadataTest", - "tests.unit._reconnect_test.ReconnectTest", - "tests.unit._resource_exhausted_test.ResourceExhaustedTest", - "tests.unit._rpc_part_1_test.RPCPart1Test", - "tests.unit._rpc_part_2_test.RPCPart2Test", - "tests.unit._server_shutdown_test.ServerShutdown", - "tests.unit._server_ssl_cert_config_test.ServerSSLCertConfigFetcherParamsChecks", - "tests.unit._server_ssl_cert_config_test.ServerSSLCertReloadTestCertConfigReuse", - "tests.unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth", - "tests.unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth", - "tests.unit._server_test.ServerTest", - "tests.unit._server_wait_for_termination_test.ServerWaitForTerminationTest", - "tests.unit._session_cache_test.SSLSessionCacheTest", - "tests.unit._signal_handling_test.SignalHandlingTest", - "tests.unit._version_test.VersionTest", - "tests.unit._xds_credentials_test.XdsCredentialsTest", - "tests.unit.beta._beta_features_test.BetaFeaturesTest", - "tests.unit.beta._beta_features_test.ContextManagementAndLifecycleTest", - "tests.unit.beta._connectivity_channel_test.ConnectivityStatesTest", - "tests.unit.beta._implementations_test.CallCredentialsTest", - "tests.unit.beta._implementations_test.ChannelCredentialsTest", - "tests.unit.beta._not_found_test.NotFoundTest", - "tests.unit.beta._utilities_test.ChannelConnectivityTest", - "tests.unit.framework.foundation._logging_pool_test.LoggingPoolTest" + "_sanity._sanity_test.SanityTest", + "admin.test_admin.TestAdmin", + "channelz._channelz_servicer_test.ChannelzServicerTest", + "csds.test_csds.TestCsds", + "fork._fork_interop_test.ForkInteropTest", + "health_check._health_servicer_test.HealthServicerBackwardsCompatibleWatchTest", + "health_check._health_servicer_test.HealthServicerTest", + "interop._insecure_intraop_test.InsecureIntraopTest", + "interop._secure_intraop_test.SecureIntraopTest", + "protoc_plugin._python_plugin_test.ModuleMainTest", + "protoc_plugin._python_plugin_test.PythonPluginTest", + "protoc_plugin._python_plugin_test.SimpleStubsPluginTest", + "protoc_plugin._split_definitions_test.SameProtoGrpcBeforeProtoProtocStyleTest", + "protoc_plugin._split_definitions_test.SameProtoMid2016ProtocStyleTest", + "protoc_plugin._split_definitions_test.SameProtoProtoBeforeGrpcProtocStyleTest", + "protoc_plugin._split_definitions_test.SameProtoSingleProtocExecutionProtocStyleTest", + "protoc_plugin._split_definitions_test.SplitProtoGrpcBeforeProtoProtocStyleTest", + "protoc_plugin._split_definitions_test.SplitProtoMid2016ProtocStyleTest", + "protoc_plugin._split_definitions_test.SplitProtoProtoBeforeGrpcProtocStyleTest", + "protoc_plugin._split_definitions_test.SplitProtoSingleProtocExecutionProtocStyleTest", + "protoc_plugin.beta_python_plugin_test.PythonPluginTest", + "reflection._reflection_client_test.ReflectionClientTest", + "reflection._reflection_servicer_test.ReflectionServicerTest", + "status._grpc_status_test.StatusTest", + "testing._client_test.ClientTest", + "testing._server_test.FirstServiceServicerTest", + "testing._time_test.StrictFakeTimeTest", + "testing._time_test.StrictRealTimeTest", + "unit._abort_test.AbortTest", + "unit._api_test.AllTest", + "unit._api_test.ChannelConnectivityTest", + "unit._api_test.ChannelTest", + "unit._auth_context_test.AuthContextTest", + "unit._auth_test.AccessTokenAuthMetadataPluginTest", + "unit._auth_test.GoogleCallCredentialsTest", + "unit._channel_args_test.ChannelArgsTest", + "unit._channel_close_test.ChannelCloseTest", + "unit._channel_connectivity_test.ChannelConnectivityTest", + "unit._channel_ready_future_test.ChannelReadyFutureTest", + "unit._compression_test.CompressionTest", + "unit._contextvars_propagation_test.ContextVarsPropagationTest", + "unit._credentials_test.CredentialsTest", + "unit._cython._cancel_many_calls_test.CancelManyCallsTest", + "unit._cython._channel_test.ChannelTest", + "unit._cython._fork_test.ForkPosixTester", + "unit._cython._fork_test.ForkWindowsTester", + "unit._cython._no_messages_server_completion_queue_per_call_test.Test", + "unit._cython._no_messages_single_server_completion_queue_test.Test", + "unit._cython._read_some_but_not_all_responses_test.ReadSomeButNotAllResponsesTest", + "unit._cython._server_test.Test", + "unit._cython.cygrpc_test.InsecureServerInsecureClient", + "unit._cython.cygrpc_test.SecureServerSecureClient", + "unit._cython.cygrpc_test.TypeSmokeTest", + "unit._dns_resolver_test.DNSResolverTest", + "unit._dynamic_stubs_test.DynamicStubTest", + "unit._empty_message_test.EmptyMessageTest", + "unit._error_message_encoding_test.ErrorMessageEncodingTest", + "unit._exit_test.ExitTest", + "unit._grpc_shutdown_test.GrpcShutdownTest", + "unit._interceptor_test.InterceptorTest", + "unit._invalid_metadata_test.InvalidMetadataTest", + "unit._invocation_defects_test.InvocationDefectsTest", + "unit._local_credentials_test.LocalCredentialsTest", + "unit._logging_test.LoggingTest", + "unit._metadata_code_details_test.InspectContextTest", + "unit._metadata_code_details_test.MetadataCodeDetailsTest", + "unit._metadata_flags_test.MetadataFlagsTest", + "unit._metadata_test.MetadataTest", + "unit._reconnect_test.ReconnectTest", + "unit._resource_exhausted_test.ResourceExhaustedTest", + "unit._rpc_part_1_test.RPCPart1Test", + "unit._rpc_part_2_test.RPCPart2Test", + "unit._server_shutdown_test.ServerShutdown", + "unit._server_ssl_cert_config_test.ServerSSLCertConfigFetcherParamsChecks", + "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestCertConfigReuse", + "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth", + "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth", + "unit._server_test.ServerTest", + "unit._server_wait_for_termination_test.ServerWaitForTerminationTest", + "unit._session_cache_test.SSLSessionCacheTest", + "unit._signal_handling_test.SignalHandlingTest", + "unit._version_test.VersionTest", + "unit._xds_credentials_test.XdsCredentialsTest", + "unit.beta._beta_features_test.BetaFeaturesTest", + "unit.beta._beta_features_test.ContextManagementAndLifecycleTest", + "unit.beta._connectivity_channel_test.ConnectivityStatesTest", + "unit.beta._implementations_test.CallCredentialsTest", + "unit.beta._implementations_test.ChannelCredentialsTest", + "unit.beta._not_found_test.NotFoundTest", + "unit.beta._utilities_test.ChannelConnectivityTest", + "unit.framework.foundation._logging_pool_test.LoggingPoolTest" ] diff --git a/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py b/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py index 83450c09484..90f0779a4a2 100644 --- a/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py +++ b/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py @@ -131,11 +131,8 @@ def _test_grpc_tools_unimportable(): # NOTE(rbellevi): multiprocessing.Process fails to pickle function objects # when they do not come from the "__main__" module, so this test passes -# if run directly on Windows or MacOS, but not if started by the test runner. -@unittest.skipIf( - os.name == "nt" or "darwin" in sys.platform, - "Windows and MacOS multiprocessing unsupported", -) +# if run directly on Windows, but not if started by the test runner. +@unittest.skipIf(os.name == "nt", "Windows multiprocessing unsupported") class DynamicStubTest(unittest.TestCase): def test_sunny_day(self): _run_in_subprocess(_test_sunny_day) diff --git a/src/python/grpcio_tests/tests_aio/tests.json b/src/python/grpcio_tests/tests_aio/tests.json index 2c3db85fffd..2fc4c32c68e 100644 --- a/src/python/grpcio_tests/tests_aio/tests.json +++ b/src/python/grpcio_tests/tests_aio/tests.json @@ -1,44 +1,44 @@ [ - "tests_aio._sanity._sanity_test.AioSanityTest", - "tests_aio.channelz.channelz_servicer_test.ChannelzServicerTest", - "tests_aio.health_check.health_servicer_test.HealthServicerTest", - "tests_aio.interop.local_interop_test.InsecureLocalInteropTest", - "tests_aio.interop.local_interop_test.SecureLocalInteropTest", - "tests_aio.reflection.reflection_servicer_test.ReflectionServicerTest", - "tests_aio.status.grpc_status_test.StatusTest", - "tests_aio.unit._metadata_test.TestTypeMetadata", - "tests_aio.unit.abort_test.TestAbort", - "tests_aio.unit.aio_rpc_error_test.TestAioRpcError", - "tests_aio.unit.auth_context_test.TestAuthContext", - "tests_aio.unit.call_test.TestStreamStreamCall", - "tests_aio.unit.call_test.TestStreamUnaryCall", - "tests_aio.unit.call_test.TestUnaryStreamCall", - "tests_aio.unit.call_test.TestUnaryUnaryCall", - "tests_aio.unit.channel_argument_test.TestChannelArgument", - "tests_aio.unit.channel_ready_test.TestChannelReady", - "tests_aio.unit.channel_test.TestChannel", - "tests_aio.unit.client_stream_stream_interceptor_test.TestStreamStreamClientInterceptor", - "tests_aio.unit.client_stream_unary_interceptor_test.TestStreamUnaryClientInterceptor", - "tests_aio.unit.client_unary_stream_interceptor_test.TestUnaryStreamClientInterceptor", - "tests_aio.unit.client_unary_unary_interceptor_test.TestInterceptedUnaryUnaryCall", - "tests_aio.unit.client_unary_unary_interceptor_test.TestUnaryUnaryClientInterceptor", - "tests_aio.unit.close_channel_test.TestCloseChannel", - "tests_aio.unit.compatibility_test.TestCompatibility", - "tests_aio.unit.compression_test.TestCompression", - "tests_aio.unit.connectivity_test.TestConnectivityState", - "tests_aio.unit.context_peer_test.TestContextPeer", - "tests_aio.unit.done_callback_test.TestClientSideDoneCallback", - "tests_aio.unit.done_callback_test.TestServerSideDoneCallback", - "tests_aio.unit.init_test.TestInit", - "tests_aio.unit.metadata_test.TestMetadata", - "tests_aio.unit.outside_init_test.TestOutsideInit", - "tests_aio.unit.secure_call_test.TestStreamStreamSecureCall", - "tests_aio.unit.secure_call_test.TestUnaryStreamSecureCall", - "tests_aio.unit.secure_call_test.TestUnaryUnarySecureCall", - "tests_aio.unit.server_interceptor_test.TestServerInterceptor", - "tests_aio.unit.server_test.TestServer", - "tests_aio.unit.server_time_remaining_test.TestServerTimeRemaining", - "tests_aio.unit.timeout_test.TestTimeout", - "tests_aio.unit.wait_for_connection_test.TestWaitForConnection", - "tests_aio.unit.wait_for_ready_test.TestWaitForReady" + "_sanity._sanity_test.AioSanityTest", + "channelz.channelz_servicer_test.ChannelzServicerTest", + "health_check.health_servicer_test.HealthServicerTest", + "interop.local_interop_test.InsecureLocalInteropTest", + "interop.local_interop_test.SecureLocalInteropTest", + "reflection.reflection_servicer_test.ReflectionServicerTest", + "status.grpc_status_test.StatusTest", + "unit._metadata_test.TestTypeMetadata", + "unit.abort_test.TestAbort", + "unit.aio_rpc_error_test.TestAioRpcError", + "unit.auth_context_test.TestAuthContext", + "unit.call_test.TestStreamStreamCall", + "unit.call_test.TestStreamUnaryCall", + "unit.call_test.TestUnaryStreamCall", + "unit.call_test.TestUnaryUnaryCall", + "unit.channel_argument_test.TestChannelArgument", + "unit.channel_ready_test.TestChannelReady", + "unit.channel_test.TestChannel", + "unit.client_stream_stream_interceptor_test.TestStreamStreamClientInterceptor", + "unit.client_stream_unary_interceptor_test.TestStreamUnaryClientInterceptor", + "unit.client_unary_stream_interceptor_test.TestUnaryStreamClientInterceptor", + "unit.client_unary_unary_interceptor_test.TestInterceptedUnaryUnaryCall", + "unit.client_unary_unary_interceptor_test.TestUnaryUnaryClientInterceptor", + "unit.close_channel_test.TestCloseChannel", + "unit.compatibility_test.TestCompatibility", + "unit.compression_test.TestCompression", + "unit.connectivity_test.TestConnectivityState", + "unit.context_peer_test.TestContextPeer", + "unit.done_callback_test.TestClientSideDoneCallback", + "unit.done_callback_test.TestServerSideDoneCallback", + "unit.init_test.TestInit", + "unit.metadata_test.TestMetadata", + "unit.outside_init_test.TestOutsideInit", + "unit.secure_call_test.TestStreamStreamSecureCall", + "unit.secure_call_test.TestUnaryStreamSecureCall", + "unit.secure_call_test.TestUnaryUnarySecureCall", + "unit.server_interceptor_test.TestServerInterceptor", + "unit.server_test.TestServer", + "unit.server_time_remaining_test.TestServerTimeRemaining", + "unit.timeout_test.TestTimeout", + "unit.wait_for_connection_test.TestWaitForConnection", + "unit.wait_for_ready_test.TestWaitForReady" ] diff --git a/src/python/grpcio_tests/tests_aio/unit/metadata_test.py b/src/python/grpcio_tests/tests_aio/unit/metadata_test.py index 53592c70a90..47b9cf51f43 100644 --- a/src/python/grpcio_tests/tests_aio/unit/metadata_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/metadata_test.py @@ -183,9 +183,9 @@ class _TestGenericHandlerForMethods(grpc.GenericRpcHandler): context.set_trailing_metadata(_TRAILING_METADATA) # ensure that we can read back the data we set on the context - assert context.code() == _NON_OK_CODE - assert context.details() == _DETAILS - assert context.trailing_metadata() == _TRAILING_METADATA + assert context.get_code() == _NON_OK_CODE + assert context.get_details() == _DETAILS + assert context.get_trailing_metadata() == _TRAILING_METADATA return _RESPONSE def service(self, handler_call_details): diff --git a/src/python/grpcio_tests/tests_aio/unit/server_test.py b/src/python/grpcio_tests/tests_aio/unit/server_test.py index 2f2333f1b6d..790cb27f746 100644 --- a/src/python/grpcio_tests/tests_aio/unit/server_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/server_test.py @@ -570,9 +570,6 @@ class TestServer(AioTestBase): server.add_secure_port(bind_address, server_credentials) async def test_maximum_concurrent_rpcs(self): - async def coro_wrapper(awaitable): - return await awaitable - # Build the server with concurrent rpc argument server = aio.server(maximum_concurrent_rpcs=_MAXIMUM_CONCURRENT_RPCS) port = server.add_insecure_port("localhost:0") @@ -582,18 +579,15 @@ class TestServer(AioTestBase): # Build the channel channel = aio.insecure_channel(bind_address) # Deplete the concurrent quota with 3 times of max RPCs - rpc_tasks = [] + rpcs = [] for _ in range(3 * _MAXIMUM_CONCURRENT_RPCS): - task = asyncio.create_task( - coro_wrapper(channel.unary_unary(_BLOCK_BRIEFLY)(_REQUEST)) - ) - rpc_tasks.append(task) - await_tasks = asyncio.wait( - rpc_tasks, return_when=asyncio.FIRST_EXCEPTION + rpcs.append(channel.unary_unary(_BLOCK_BRIEFLY)(_REQUEST)) + task = self.loop.create_task( + asyncio.wait(rpcs, return_when=asyncio.FIRST_EXCEPTION) ) # Each batch took test_constants.SHORT_TIMEOUT /2 start_time = time.time() - await await_tasks + await task elapsed_time = time.time() - start_time self.assertGreater(elapsed_time, test_constants.SHORT_TIMEOUT * 3 / 2) # Clean-up diff --git a/src/python/grpcio_tests/tests_gevent/tests.json b/src/python/grpcio_tests/tests_gevent/tests.json new file mode 100644 index 00000000000..11307dcb116 --- /dev/null +++ b/src/python/grpcio_tests/tests_gevent/tests.json @@ -0,0 +1 @@ +["unit.close_channel_test.CloseChannelTest"] diff --git a/templates/tools/dockerfile/compile_python_310.include b/templates/tools/dockerfile/compile_python_310.include index aaf5c5154d7..21ff50121dd 100644 --- a/templates/tools/dockerfile/compile_python_310.include +++ b/templates/tools/dockerfile/compile_python_310.include @@ -1,7 +1,7 @@ #================= # Compile CPython 3.10.3 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && ${'\\'} diff --git a/templates/tools/dockerfile/compile_python_311.include b/templates/tools/dockerfile/compile_python_311.include index 36286e46223..7076b05e039 100644 --- a/templates/tools/dockerfile/compile_python_311.include +++ b/templates/tools/dockerfile/compile_python_311.include @@ -1,7 +1,7 @@ #================= # Compile CPython 3.11.4 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && ${'\\'} diff --git a/templates/tools/dockerfile/compile_python_37.include b/templates/tools/dockerfile/compile_python_37.include index 47d3800b8b8..80a72ae65b8 100644 --- a/templates/tools/dockerfile/compile_python_37.include +++ b/templates/tools/dockerfile/compile_python_37.include @@ -1,7 +1,7 @@ #================= # Compile CPython 3.7.13 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && ${'\\'} diff --git a/templates/tools/dockerfile/compile_python_38.include b/templates/tools/dockerfile/compile_python_38.include index ddce2b4f6eb..9147a95367d 100644 --- a/templates/tools/dockerfile/compile_python_38.include +++ b/templates/tools/dockerfile/compile_python_38.include @@ -1,7 +1,7 @@ #================= # Compile CPython 3.8.13 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && ${'\\'} diff --git a/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template index 36d36810208..a8b3eafa086 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile.template @@ -19,10 +19,6 @@ <%include file="../../apt_get_basic.include"/> <%include file="../../run_tests_addons.include"/> - # Python test coverage requires libsqlite3, and it have - # to be installed before Python. - RUN apt-get update && apt-get install -y libsqlite3-dev - # 3.9 is the default python3 version on debian11 RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip diff --git a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template index cb03c87c681..af81c06de27 100644 --- a/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_debian11_default_x64/Dockerfile.template @@ -25,10 +25,6 @@ <%include file="../../compile_python_310.include"/> <%include file="../../compile_python_311.include"/> - # Python test coverage requires libsqlite3, and it have - # to be installed before Python. - RUN apt-get update && apt-get install -y libsqlite3-dev - # 3.9 is the default python3 version on debian11 RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 108aa47a9cd..064ae74825f 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -107,8 +107,8 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/test/php7_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64@sha256:7ee21f253a2ddd255f4f6779cd19818eec6524e78b0bf0a7765339e4aa7347c3", "tools/dockerfile/test/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:302c06c5dbffb97dd5540d758a8ce849269527bb7d1c3885af0b956f8f33c49e", "tools/dockerfile/test/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:75fa424f2dae683422a5875d64911d9abf06c31e944401d240666d06f83de573", - "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:fccca33a655c7aa89dd7ebd9492cbcc1f636bd2a004cd939d1982cfce3d68326", - "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:51107bfe5f9ef2c9d9c7a6554a16c4335a6d48f81a47cf6176fb36eca0605f02", + "tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:e1fd0a85aed633d817ac086f3c588c6343d316b7d41a4dd62a8ecfbb70358687", + "tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:8f22ba10b93b14c13ceb296cbbd41dba04947b457efc229412b43280ad6a4adc", "tools/dockerfile/test/rbe_ubuntu2204.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2204@sha256:a193b5d481ddd24cffbbe31d81c95f97e5a9f417fdd6ba8b7be972c28dfaa9e7", "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:7e77cf17e2e8657f4cc23ac9f93630bf13213fff961799e0f16dae17cd45cf6d", "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:e4cb502caccf2db733268ce2ddc951fda8a9df2f7f53d6b74523c33d40c83006", diff --git a/tools/distrib/python/xds_protos/build.py b/tools/distrib/python/xds_protos/build.py index bdcb4286d42..3f9f518dcd2 100644 --- a/tools/distrib/python/xds_protos/build.py +++ b/tools/distrib/python/xds_protos/build.py @@ -101,7 +101,7 @@ COMPILE_BOTH = COMPILE_PROTO_ONLY + ["--grpc_python_out={}".format(OUTPUT_PATH)] def has_grpc_service(proto_package_path: str) -> bool: - return proto_package_path.startswith(os.path.join("envoy", "service")) + return proto_package_path.startswith("envoy/service") def compile_protos(proto_root: str, sub_dir: str = ".") -> None: diff --git a/tools/dockerfile/test/python_debian11_default_arm64.current_version b/tools/dockerfile/test/python_debian11_default_arm64.current_version index 2bd50d83173..ab5a5bae275 100644 --- a/tools/dockerfile/test/python_debian11_default_arm64.current_version +++ b/tools/dockerfile/test/python_debian11_default_arm64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64:55eb2e98cc7ff914777976a5482fee5fa62e9cbe@sha256:fccca33a655c7aa89dd7ebd9492cbcc1f636bd2a004cd939d1982cfce3d68326 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64:4fbecbb42c07bce5d982e3808be6981549a5126d@sha256:e1fd0a85aed633d817ac086f3c588c6343d316b7d41a4dd62a8ecfbb70358687 \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile b/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile index 024acfe7e70..147f2ff5ecf 100644 --- a/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile @@ -66,10 +66,6 @@ RUN git config --global protocol.file.allow always RUN mkdir /var/local/jenkins -# Python test coverage requires libsqlite3, and it have -# to be installed before Python. -RUN apt-get update && apt-get install -y libsqlite3-dev - # 3.9 is the default python3 version on debian11 RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip diff --git a/tools/dockerfile/test/python_debian11_default_x64.current_version b/tools/dockerfile/test/python_debian11_default_x64.current_version index 0e61fda7183..becc9998989 100644 --- a/tools/dockerfile/test/python_debian11_default_x64.current_version +++ b/tools/dockerfile/test/python_debian11_default_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:3aec01d65a59f4583b9a54369fc5d08b84b1017e@sha256:51107bfe5f9ef2c9d9c7a6554a16c4335a6d48f81a47cf6176fb36eca0605f02 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64:a6300ecdbf62f0873270a97068c013e4ffc0b32d@sha256:8f22ba10b93b14c13ceb296cbbd41dba04947b457efc229412b43280ad6a4adc \ No newline at end of file diff --git a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile index aca43456da1..b05110c364c 100644 --- a/tools/dockerfile/test/python_debian11_default_x64/Dockerfile +++ b/tools/dockerfile/test/python_debian11_default_x64/Dockerfile @@ -90,7 +90,7 @@ RUN python3.6 -m ensurepip && \ #================= # Compile CPython 3.7.13 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ @@ -111,7 +111,7 @@ RUN python3.7 -m ensurepip && \ #================= # Compile CPython 3.8.13 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ @@ -132,7 +132,7 @@ RUN python3.8 -m ensurepip && \ #================= # Compile CPython 3.10.3 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ @@ -153,7 +153,7 @@ RUN python3.10 -m ensurepip && \ #================= # Compile CPython 3.11.4 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ @@ -173,10 +173,6 @@ RUN python3.11 -m ensurepip && \ python3.11 -m pip install coverage -# Python test coverage requires libsqlite3, and it have -# to be installed before Python. -RUN apt-get update && apt-get install -y libsqlite3-dev - # 3.9 is the default python3 version on debian11 RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index 8d5ce3a01e9..d5530dfdead 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -234,7 +234,7 @@ then # through setup.py, but we can optimize it with "bdist_wheel" command, which # skips the wheel building step. - # Build xds_protos source distribution + # Build grpcio_reflection source distribution ${SETARCH_CMD} "${PYTHON}" tools/distrib/python/xds_protos/build.py ${SETARCH_CMD} "${PYTHON}" tools/distrib/python/xds_protos/setup.py \ sdist bdist_wheel install diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index e7948f4afc6..9c22cc182b1 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -211,7 +211,7 @@ pip_install_dir "$ROOT/src/python/grpcio_admin" pip_install_dir "$ROOT/src/python/grpcio_testing" # Build/install tests -pip_install coverage==7.2.0 oauth2client==4.1.0 \ +pip_install coverage==4.4 oauth2client==4.1.0 \ google-auth>=1.35.0 requests==2.31.0 \ googleapis-common-protos>=1.5.5 rsa==4.0 absl-py==1.4.0 $VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" preprocess diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 64d2cfcbeb0..1a416daf0fd 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -721,11 +721,16 @@ class PythonConfig( class PythonLanguage(object): _TEST_SPECS_FILE = { "native": ["src/python/grpcio_tests/tests/tests.json"], + "gevent": [ + "src/python/grpcio_tests/tests/tests.json", + "src/python/grpcio_tests/tests_gevent/tests.json", + ], "asyncio": ["src/python/grpcio_tests/tests_aio/tests.json"], } _TEST_COMMAND = { "native": "test_lite", + "gevent": "test_gevent", "asyncio": "test_aio", } @@ -750,7 +755,7 @@ class PythonLanguage(object): ], timeout_seconds=60, environ=_FORCE_ENVIRON_FOR_WRAPPERS, - shortname=f"{python_config.name}.xds_protos", + shortname="f{python_config.name}.xds_protos", ) )