Skip to content

Commit c2cfa57

Browse files
committed
Increased timeout to fix flaky test
1 parent dc23a23 commit c2cfa57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_server_handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from h2.errors import ErrorCodes
77

8-
from grpclib.const import Handler, Cardinality
8+
from grpclib.const import Handler, Cardinality, Status
99
from grpclib.events import _DispatchServerEvents
1010
from grpclib.server import request_handler
1111
from grpclib.protocol import Connection, EventsProcessor
@@ -168,7 +168,7 @@ async def test_deadline(
168168
(':path', '/package.Service/Method'),
169169
('te', 'trailers'),
170170
('content-type', 'application/grpc'),
171-
('grpc-timeout', '10m'),
171+
('grpc-timeout', '50m'),
172172
]
173173
methods = {'/package.Service/Method': Handler(
174174
handler,
@@ -179,12 +179,12 @@ async def test_deadline(
179179
task = loop.create_task(
180180
call_handler(methods, stream, headers)
181181
)
182-
await asyncio.wait_for(task, 0.1)
182+
await asyncio.wait_for(task, 0.1) # should be bigger than grpc-timeout
183183
assert stream.__events__ == [
184184
SendHeaders(headers=[
185185
(':status', '200'),
186186
('content-type', 'application/grpc+proto'),
187-
('grpc-status', '4'), # DEADLINE_EXCEEDED
187+
('grpc-status', str(Status.DEADLINE_EXCEEDED.value)),
188188
], end_stream=True),
189189
Reset(ErrorCodes.NO_ERROR),
190190
]

0 commit comments

Comments
 (0)