-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose grpc parameters and add production ready keepalive param…
…eters (#5092) * fix: add production ready keepalive grpc parameters * feat: add test for long live flow * feat: add grpc server options to argument * style: fix overload and cli autocomplete * feat: update description * feat: add test for grpc server options * fix: move parsing from gateway to worker * style: fix overload and cli autocomplete * feat: merge default values and new ones for grpc option * refactor: cleaner dict to list unpacking * refactor: reduce the time in test to wait * docs: add example in docstring for grpc server options * refactor: move the get grpc option from jina helper to runtime helper * style: fix overload and cli autocomplete * fix: fix typo * style: fix overload and cli autocomplete Co-authored-by: Jina Dev Bot <dev-bot@jina.ai>
- Loading branch information
Showing
14 changed files
with
123 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/integration/gateway_clients/test_long_flow_keepalive.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import time | ||
|
||
import pytest | ||
from docarray import DocumentArray | ||
|
||
from jina import Executor, Flow, requests | ||
|
||
|
||
@pytest.fixture() | ||
def slow_executor() -> Executor: | ||
class MySlowExec(Executor): | ||
@requests | ||
def slow(self, docs, **kwargs): | ||
time.sleep(30) | ||
for doc_ in docs: | ||
doc_.text = 'process' | ||
|
||
return MySlowExec | ||
|
||
|
||
@pytest.mark.slow | ||
def test_long_flow_keep_alive(slow_executor): | ||
# it tests that the connection to a flow that take a lot of time to process will not be killed by the keepalive feature | ||
|
||
with Flow().add(uses=slow_executor) as f: | ||
docs = f.search(inputs=DocumentArray.empty(10)) | ||
|
||
for doc_ in docs: | ||
assert doc_.text == 'process' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters