Increase timeout in some tests

pull/21819/head
Pau Freixes 5 years ago
parent 84d2a70741
commit 5cd4e133bf
  1. 1
      src/python/grpcio_tests/tests_aio/unit/channel_test.py
  2. 2
      src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
  3. 13
      src/python/grpcio_tests/tests_aio/unit/interceptor_test.py

@ -19,7 +19,6 @@ import unittest
import grpc
from grpc.experimental import aio
from grpc.experimental.aio import _base_call
from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
from tests.unit.framework.common import test_constants

@ -90,7 +90,7 @@ class TestCloseChannel(AioTestBase):
call = UnaryCallWithSleep(messages_pb2.SimpleRequest())
await channel.close(grace=UNARY_CALL_WITH_SLEEP_VALUE * 2)
await channel.close(grace=UNARY_CALL_WITH_SLEEP_VALUE * 4)
self.assertEqual(grpc.StatusCode.OK, await call.code())

@ -29,6 +29,7 @@ _INITIAL_METADATA_TO_INJECT = (
(_INITIAL_METADATA_KEY, 'extra info'),
(_TRAILING_METADATA_KEY, b'\x13\x37'),
)
_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED = 1.0
class TestUnaryUnaryClientInterceptor(AioTestBase):
@ -607,7 +608,9 @@ class TestInterceptedUnaryUnaryCall(AioTestBase):
await call
try:
await asyncio.wait_for(called.wait(), timeout=0.1)
await asyncio.wait_for(
called.wait(),
timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
except:
self.fail("Callback was not called")
@ -640,7 +643,9 @@ class TestInterceptedUnaryUnaryCall(AioTestBase):
call.add_done_callback(callback)
try:
await asyncio.wait_for(called.wait(), timeout=0.1)
await asyncio.wait_for(
called.wait(),
timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
except:
self.fail("Callback was not called")
@ -673,7 +678,9 @@ class TestInterceptedUnaryUnaryCall(AioTestBase):
await call
try:
await asyncio.wait_for(called.wait(), timeout=0.1)
await asyncio.wait_for(
called.wait(),
timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
except:
self.fail("Callback was not called")

Loading…
Cancel
Save