Skip to content

Commit

Permalink
test: timeout control adjusting for ci (jina-ai#2916)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanFM authored Jul 12, 2021
1 parent 6c5a64c commit 9917aab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion jina/parsers/peapods/runtimes/zmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def mixin_zmq_runtime_parser(parser):
gp.add_argument(
'--timeout-ctrl',
type=int,
default=5000,
default=int(os.getenv('JINA_DEFAULT_TIMEOUT_CTRL', '5000')),
help='The timeout in milliseconds of the control request, -1 for waiting forever',
)

Expand Down
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,8 @@ def test_envs(tmpdir):
@pytest.fixture(autouse=True)
def test_log_level(monkeypatch):
monkeypatch.setenv('JINA_LOG_LEVEL', 'DEBUG')


@pytest.fixture(autouse=True)
def test_timeout_ctrl_time(monkeypatch):
monkeypatch.setenv('JINA_DEFAULT_TIMEOUT_CTRL', '500')
6 changes: 3 additions & 3 deletions tests/integration/rolling_update/test_rolling_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def handle_search_result(resp):
assert len(set(shard_list)) == NUM_SHARDS


@pytest.mark.timeout(30)
@pytest.mark.timeout(60)
def test_simple_run(docs):
flow = Flow().add(
name='pod1',
Expand All @@ -90,7 +90,7 @@ def test_simple_run(docs):


@pytest.mark.repeat(5)
@pytest.mark.timeout(30)
@pytest.mark.timeout(60)
def test_thread_run(docs, mocker, reraise):
def update_rolling(flow, pod_name):
with reraise:
Expand Down Expand Up @@ -119,7 +119,7 @@ def update_rolling(flow, pod_name):


@pytest.mark.repeat(5)
@pytest.mark.timeout(30)
@pytest.mark.timeout(60)
def test_vector_indexer_thread(config, docs, mocker, reraise):
def update_rolling(flow, pod_name):
with reraise:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/v2_api/test_docs_matrix_tail_pea.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def merge(self, docs_matrix, **kwargs):
return DocumentArray(list(results.values()))


@pytest.mark.timeout(5)
@pytest.mark.timeout(60)
@pytest.mark.parametrize('num_replicas, num_shards', [(1, 1), (2, 2)])
def test_sharding_tail_pea(num_replicas, num_shards):
"""TODO(Maximilian): Make (1, 2) and (2, 1) also workable"""
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/clients/python/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_client_csv(protocol, mocker, func_name):


# Timeout is necessary to fail in case of hanging client requests
@pytest.mark.timeout(5)
@pytest.mark.timeout(60)
def test_client_websocket(mocker, flow_with_websocket):
with flow_with_websocket:
time.sleep(0.5)
Expand Down

0 comments on commit 9917aab

Please sign in to comment.