[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Assorted fixes for observability. #75

Merged
merged 9 commits into from
Apr 18, 2024
Prev Previous commit
Next Next commit
Applying callout server changes to aplicable tests.
Some additional small cleanups.
  • Loading branch information
jstraceski committed Apr 18, 2024
commit 9d1f364c0457c0f9120d52defaa88b3e36355ae0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cryptography==42.0.5
12 changes: 10 additions & 2 deletions callouts/python/extproc/tests/basic_grpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class ServerSetupException(Exception):
pass


class NoResponseError(Exception):
pass


# Replace the default ports of the server so that they do not clash with running programs.
default_kwargs: dict = {
'address': ('0.0.0.0', 8443),
Expand Down Expand Up @@ -94,7 +98,7 @@ def _start_server(server: CalloutServer) -> threading.Thread:
def _stop_server(server: CalloutServer, thread: threading.Thread):
# Stop the server
server.shutdown()
thread.join(timeout=5)
thread.join(timeout=10)


@pytest.fixture(scope='class', name='server')
Expand Down Expand Up @@ -132,7 +136,11 @@ def make_request(stub: ExternalProcessorStub, **kwargs) -> ProcessingResponse:
Returns: The response returned from the server.
"""
request_iter = iter([ProcessingRequest(**kwargs)])
return next(stub.Process(request_iter))
responses = stub.Process(request_iter)
# Get the first response
for response in responses:
return response
raise NoResponseError("Response not found.")


class TestBasicServer(object):
Expand Down
1 change: 0 additions & 1 deletion callouts/python/extproc/tests/jwt_auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

from extproc.example.jwt_auth.service_callout_example import (
CalloutServerExample as CalloutServerTest)
from extproc.service.callout_tools import add_header_mutation
from extproc.tests.basic_grpc_test import (
make_request,
setup_server,
Expand Down