Skip to content

Commit d8b7d3b

Browse files
committed
IGNITE-18006 wip.
1 parent 0e9ef46 commit d8b7d3b

File tree

3 files changed

+13
-66
lines changed

3 files changed

+13
-66
lines changed

.github/workflows/pr_check.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
- {python: "3.8", toxenv: "py38"}
3131
- {python: "3.9", toxenv: "py39"}
3232
- {python: "3.10", toxenv: "py310"}
33+
- {python: "3.11", toxenv: "py311"}
34+
- {python: "3.11", toxenv: "codestyle"}
3335

3436
steps:
3537
- uses: actions/checkout@v3
@@ -43,6 +45,11 @@ jobs:
4345
unzip ignite.zip -d /opt
4446
mv /opt/apache-ignite-slim-${IGNITE_VERSION}-bin /opt/ignite
4547
mv /opt/ignite/libs/optional/ignite-log4j2 /opt/ignite/libs/
48+
49+
- name: Install tox
50+
run: |
51+
pip install tox
52+
4653
- name: Run tests
4754
run: |
4855
pip install tox

.travis.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

tests/custom/test_timeouts.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# limitations under the License.
1515
import asyncio
1616
import sys
17-
import time
18-
from asyncio.exceptions import TimeoutError, InvalidStateError
17+
from asyncio import TimeoutError, InvalidStateError
1918

2019
import pytest
2120

@@ -73,10 +72,12 @@ async def test_cancellation_on_slow_response(event_loop, proxy, invalid_states_e
7372
c = AioClient(partition_aware=False)
7473
async with c.connect("127.0.0.1", 10802):
7574
cache = await c.get_cache("test")
76-
proxy.slow_response = True
75+
proxy.discard_response = True # Simulate slow response by discarding it
76+
7777
with pytest.raises(TimeoutError):
7878
await asyncio.wait_for(cache.put(1, 2), 0.1)
7979

80+
proxy.discard_response = False
8081
assert len(invalid_states_errors) == 0
8182

8283

@@ -96,15 +97,14 @@ async def test_cancellation_on_disconnect(event_loop, proxy, invalid_states_erro
9697

9798
class ProxyServer:
9899
"""
99-
Proxy for simulating slow or discarding response ignite server
100-
Set `slow_response`, `discard_response` to `True` to simulate these conditions.
100+
Proxy for simulating discarding response from ignite server
101+
Set `discard_response` to `True` to simulate this condition.
101102
Call `disconnect_peers()` in order to simulate lost connection to Ignite server.
102103
"""
103104
def __init__(self, local_host, remote_host):
104105
self.local_host = local_host
105106
self.remote_host = remote_host
106107
self.peers = {}
107-
self.slow_response = False
108108
self.discard_response = False
109109
self.server = None
110110

@@ -206,7 +206,4 @@ def data_received(self, data):
206206
if self.proxy.discard_response:
207207
return
208208

209-
if self.proxy.slow_response:
210-
time.sleep(0.5)
211-
212209
self.proxy_protocol.transport.write(data)

0 commit comments

Comments
 (0)