xDS interop: Use ref server in py tests when set_not_serving needed (#30636)

In python tests that require set_not_serving server RPC, override
the python server with the reference server (Java) because
the python server doesn't yet support set_not_serving RPC.

Ref https://github.com/grpc/grpc/issues/30635.
pull/30641/head
Sergii Tkachenko 2 years ago committed by GitHub
parent 01b07e46e2
commit 620c174e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py
  2. 12
      tools/run_tests/xds_k8s_test_driver/tests/failover_test.py

@ -19,6 +19,7 @@ from absl import flags
from absl.testing import absltest
from google.protobuf import json_format
from framework import xds_k8s_flags
from framework import xds_k8s_testcase
from framework import xds_url_map_testcase
from framework.helpers import skips
@ -43,6 +44,15 @@ _RPC_COUNT = 100
class AffinityTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Force the python client to use the reference server image (Java)
# because the python server doesn't yet support set_not_serving RPC.
# TODO(https://github.com/grpc/grpc/issues/30635): Remove when resolved.
if cls.lang_spec.client_lang == _Lang.PYTHON:
cls.server_image = xds_k8s_flags.SERVER_IMAGE_UNIVERSAL.value
@staticmethod
def is_supported(config: skips.TestConfig) -> bool:
if config.client_lang in _Lang.CPP | _Lang.JAVA:

@ -17,7 +17,9 @@ from typing import List
from absl import flags
from absl.testing import absltest
from framework import xds_k8s_flags
from framework import xds_k8s_testcase
from framework.helpers import skips
from framework.infrastructure import k8s
from framework.test_app.runners.k8s import k8s_xds_server_runner
@ -25,6 +27,7 @@ logger = logging.getLogger(__name__)
flags.adopt_module_key_flags(xds_k8s_testcase)
# Type aliases
_Lang = skips.Lang
_XdsTestServer = xds_k8s_testcase.XdsTestServer
_XdsTestClient = xds_k8s_testcase.XdsTestClient
_KubernetesServerRunner = k8s_xds_server_runner.KubernetesServerRunner
@ -34,6 +37,15 @@ class FailoverTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
REPLICA_COUNT = 3
MAX_RATE_PER_ENDPOINT = 100
@classmethod
def setUpClass(cls):
super().setUpClass()
# Force the python client to use the reference server image (Java)
# because the python server doesn't yet support set_not_serving RPC.
# TODO(https://github.com/grpc/grpc/issues/30635): Remove when resolved.
if cls.lang_spec.client_lang == _Lang.PYTHON:
cls.server_image = xds_k8s_flags.SERVER_IMAGE_UNIVERSAL.value
def setUp(self):
super().setUp()
self.secondary_server_runner = _KubernetesServerRunner(

Loading…
Cancel
Save