This is an automated email from the ASF dual-hosted git repository.
yihaochen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git
The following commit(s) were added to refs/heads/master by this push:
new 21286b9 Support CI container logs (#185)
21286b9 is described below
commit 21286b93923f24d7f18cf4370734246c24f25da5
Author: Superskyyy <[email protected]>
AuthorDate: Thu Feb 17 20:37:00 2022 -0500
Support CI container logs (#185)
---
.github/workflows/CI.yaml | 2 +-
protocol | 2 +-
skywalking/plugins/__init__.py | 6 ++-
tests/plugin/conftest.py | 43 +++++++++++-----------
.../data/sw_elasticsearch/test_elasticsearch.py | 2 +-
tests/plugin/data/sw_kafka/test_kafka.py | 2 +-
.../data/sw_mysqlclient/services/consumer.py | 2 +-
.../plugin/data/sw_mysqlclient/test_mysqlclient.py | 2 +-
tests/plugin/data/sw_psycopg/services/consumer.py | 2 +-
tests/plugin/data/sw_psycopg/test_psycopg.py | 2 +-
tests/plugin/data/sw_psycopg2/services/consumer.py | 2 +-
tests/plugin/data/sw_psycopg2/test_psycopg2.py | 2 +-
tests/plugin/data/sw_pymongo/services/consumer.py | 6 +--
tests/plugin/data/sw_pymongo/test_pymongo.py | 2 +-
tests/plugin/data/sw_pymysql/services/consumer.py | 2 +-
tests/plugin/data/sw_pymysql/test_pymysql.py | 2 +-
tests/plugin/data/sw_rabbitmq/test_rabbitmq.py | 2 +-
tests/plugin/data/sw_redis/services/consumer.py | 2 +-
tests/plugin/data/sw_redis/test_redis.py | 2 +-
tests/plugin/docker-compose.base.yml | 4 +-
tests/plugin/http/sw_aiohttp/test_aiohttp.py | 2 +-
tests/plugin/http/sw_http/test_http.py | 2 +-
tests/plugin/http/sw_http_wsgi/test_http_wsgi.py | 2 +-
tests/plugin/http/sw_requests/services/consumer.py | 2 +-
tests/plugin/http/sw_requests/test_request.py | 2 +-
tests/plugin/http/sw_urllib3/test_urllib3.py | 2 +-
tests/plugin/web/sw_django/services/consumer.py | 2 +-
tests/plugin/web/sw_django/test_django.py | 2 +-
tests/plugin/web/sw_falcon/services/consumer.py | 2 +-
tests/plugin/web/sw_falcon/test_falcon.py | 2 +-
tests/plugin/web/sw_fastapi/services/consumer.py | 2 +-
tests/plugin/web/sw_fastapi/test_fastapi.py | 2 +-
tests/plugin/web/sw_flask/services/consumer.py | 4 +-
tests/plugin/web/sw_flask/test_flask.py | 4 +-
tests/plugin/web/sw_pyramid/test_pyramid.py | 2 +-
tests/plugin/web/sw_sanic/services/consumer.py | 2 +-
tests/plugin/web/sw_sanic/test_sanic.py | 2 +-
tests/plugin/web/sw_tornado/services/consumer.py | 2 +-
tests/plugin/web/sw_tornado/test_tornado.py | 2 +-
39 files changed, 69 insertions(+), 64 deletions(-)
diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml
index 31d3937..12a0de3 100644
--- a/.github/workflows/CI.yaml
+++ b/.github/workflows/CI.yaml
@@ -59,7 +59,7 @@ jobs:
name: Plugin and Unit Tests
needs: prep-plugin-and-unit-tests
runs-on: ubuntu-latest
- timeout-minutes: 60
+ timeout-minutes: 30
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
diff --git a/protocol b/protocol
index 21492e4..2955202 160000
--- a/protocol
+++ b/protocol
@@ -1 +1 @@
-Subproject commit 21492e496b797567d0e127f4510509baf73e10fd
+Subproject commit 29552022b01a55ec197641f569f19c1648d49acd
diff --git a/skywalking/plugins/__init__.py b/skywalking/plugins/__init__.py
index d8298cf..55b22d3 100644
--- a/skywalking/plugins/__init__.py
+++ b/skywalking/plugins/__init__.py
@@ -59,7 +59,11 @@ def install():
plugin.install()
logger.debug('Successfully installed plugin %s', modname)
except Exception:
- logger.warning('failed to install plugin %s', modname)
+ logger.warning(
+ 'plugin %s failed to install, please disregard this warning '
+ 'if the corresponding package was not used in your project',
+ modname
+ )
traceback.print_exc() if logger.isEnabledFor(logging.DEBUG) else
None
diff --git a/tests/plugin/conftest.py b/tests/plugin/conftest.py
index 4a43e25..5a3bb18 100644
--- a/tests/plugin/conftest.py
+++ b/tests/plugin/conftest.py
@@ -40,9 +40,7 @@ def prepare():
@pytest.fixture
-def docker_compose(request, prepare, version):
- # type: (FixtureRequest, Callable, str) -> None
-
+def docker_compose(request: FixtureRequest, prepare: Callable, version: str)
-> None:
module = request.module
cwd = dirname(inspect.getfile(module))
@@ -50,25 +48,26 @@ def docker_compose(request, prepare, version):
with open(os.path.join(cwd, 'requirements.txt'), mode='w') as req:
req.write(version)
- compose = DockerCompose(filepath=cwd)
-
- compose.start()
+ with DockerCompose(filepath=cwd) as compose:
+ exception = None
+ exception_delay = 0
+ stdout, stderr = None, None
+ for _ in range(10):
+ try:
+ time.sleep(10)
+ prepare()
+ exception = None
+ break
+ except Exception as e:
+ exception_delay += 10
+ exception = e
+ stdout, stderr = compose.get_logs()
- exception = None
- exception_delay = 100
- for _ in range(0, 10):
- try:
- prepare()
- exception = None
- break
- except Exception as e:
- time.sleep(10)
- exception = e
- if exception:
- time.sleep(exception_delay)
- compose.stop()
- raise Exception(f"""Wait time exceeded {exception_delay} secs.
Exception {exception}""")
+ if exception:
+ print(f'STDOUT:\n{stdout.decode("utf-8")}')
+ print('==================================')
+ print(f'STDERR:\n{stderr.decode("utf-8")}')
- yield compose
+ raise Exception(f"""Wait time exceeded {exception_delay} secs.
Exception {exception}""")
- compose.stop()
+ yield compose
diff --git a/tests/plugin/data/sw_elasticsearch/test_elasticsearch.py
b/tests/plugin/data/sw_elasticsearch/test_elasticsearch.py
index 738f626..0709ec0 100644
--- a/tests/plugin/data/sw_elasticsearch/test_elasticsearch.py
+++ b/tests/plugin/data/sw_elasticsearch/test_elasticsearch.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_kafka/test_kafka.py
b/tests/plugin/data/sw_kafka/test_kafka.py
index a383c5a..30f9f02 100644
--- a/tests/plugin/data/sw_kafka/test_kafka.py
+++ b/tests/plugin/data/sw_kafka/test_kafka.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_mysqlclient/services/consumer.py
b/tests/plugin/data/sw_mysqlclient/services/consumer.py
index 3085092..a86b6e1 100644
--- a/tests/plugin/data/sw_mysqlclient/services/consumer.py
+++ b/tests/plugin/data/sw_mysqlclient/services/consumer.py
@@ -25,7 +25,7 @@ if __name__ == '__main__':
@app.route('/users', methods=['POST', 'GET'])
def application():
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
return jsonify(res.json())
PORT = 9090
diff --git a/tests/plugin/data/sw_mysqlclient/test_mysqlclient.py
b/tests/plugin/data/sw_mysqlclient/test_mysqlclient.py
index f306fb2..130b3db 100644
--- a/tests/plugin/data/sw_mysqlclient/test_mysqlclient.py
+++ b/tests/plugin/data/sw_mysqlclient/test_mysqlclient.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_psycopg/services/consumer.py
b/tests/plugin/data/sw_psycopg/services/consumer.py
index 3085092..a86b6e1 100644
--- a/tests/plugin/data/sw_psycopg/services/consumer.py
+++ b/tests/plugin/data/sw_psycopg/services/consumer.py
@@ -25,7 +25,7 @@ if __name__ == '__main__':
@app.route('/users', methods=['POST', 'GET'])
def application():
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
return jsonify(res.json())
PORT = 9090
diff --git a/tests/plugin/data/sw_psycopg/test_psycopg.py
b/tests/plugin/data/sw_psycopg/test_psycopg.py
index a8f284d..a07c987 100644
--- a/tests/plugin/data/sw_psycopg/test_psycopg.py
+++ b/tests/plugin/data/sw_psycopg/test_psycopg.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_psycopg2/services/consumer.py
b/tests/plugin/data/sw_psycopg2/services/consumer.py
index 3085092..a86b6e1 100644
--- a/tests/plugin/data/sw_psycopg2/services/consumer.py
+++ b/tests/plugin/data/sw_psycopg2/services/consumer.py
@@ -25,7 +25,7 @@ if __name__ == '__main__':
@app.route('/users', methods=['POST', 'GET'])
def application():
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
return jsonify(res.json())
PORT = 9090
diff --git a/tests/plugin/data/sw_psycopg2/test_psycopg2.py
b/tests/plugin/data/sw_psycopg2/test_psycopg2.py
index d6f954d..8d17c93 100644
--- a/tests/plugin/data/sw_psycopg2/test_psycopg2.py
+++ b/tests/plugin/data/sw_psycopg2/test_psycopg2.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_pymongo/services/consumer.py
b/tests/plugin/data/sw_pymongo/services/consumer.py
index 610494e..04eafbc 100644
--- a/tests/plugin/data/sw_pymongo/services/consumer.py
+++ b/tests/plugin/data/sw_pymongo/services/consumer.py
@@ -25,9 +25,9 @@ if __name__ == '__main__':
@app.route('/users', methods=['POST', 'GET'])
def application():
- requests.get('http://provider:9091/insert_many')
- requests.get('http://provider:9091/find_one')
- res = requests.get('http://provider:9091/delete_one')
+ requests.get('http://provider:9091/insert_many', timeout=5)
+ requests.get('http://provider:9091/find_one', timeout=5)
+ res = requests.get('http://provider:9091/delete_one', timeout=5)
return jsonify(res.json())
PORT = 9090
diff --git a/tests/plugin/data/sw_pymongo/test_pymongo.py
b/tests/plugin/data/sw_pymongo/test_pymongo.py
index 3b2b81a..1b81139 100644
--- a/tests/plugin/data/sw_pymongo/test_pymongo.py
+++ b/tests/plugin/data/sw_pymongo/test_pymongo.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_pymysql/services/consumer.py
b/tests/plugin/data/sw_pymysql/services/consumer.py
index 3085092..a86b6e1 100644
--- a/tests/plugin/data/sw_pymysql/services/consumer.py
+++ b/tests/plugin/data/sw_pymysql/services/consumer.py
@@ -25,7 +25,7 @@ if __name__ == '__main__':
@app.route('/users', methods=['POST', 'GET'])
def application():
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
return jsonify(res.json())
PORT = 9090
diff --git a/tests/plugin/data/sw_pymysql/test_pymysql.py
b/tests/plugin/data/sw_pymysql/test_pymysql.py
index 12ca166..24eac28 100644
--- a/tests/plugin/data/sw_pymysql/test_pymysql.py
+++ b/tests/plugin/data/sw_pymysql/test_pymysql.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_rabbitmq/test_rabbitmq.py
b/tests/plugin/data/sw_rabbitmq/test_rabbitmq.py
index e9ab381..4debe6f 100644
--- a/tests/plugin/data/sw_rabbitmq/test_rabbitmq.py
+++ b/tests/plugin/data/sw_rabbitmq/test_rabbitmq.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/data/sw_redis/services/consumer.py
b/tests/plugin/data/sw_redis/services/consumer.py
index 3085092..a86b6e1 100644
--- a/tests/plugin/data/sw_redis/services/consumer.py
+++ b/tests/plugin/data/sw_redis/services/consumer.py
@@ -25,7 +25,7 @@ if __name__ == '__main__':
@app.route('/users', methods=['POST', 'GET'])
def application():
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
return jsonify(res.json())
PORT = 9090
diff --git a/tests/plugin/data/sw_redis/test_redis.py
b/tests/plugin/data/sw_redis/test_redis.py
index a3ca1b9..a28c8f2 100644
--- a/tests/plugin/data/sw_redis/test_redis.py
+++ b/tests/plugin/data/sw_redis/test_redis.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/docker-compose.base.yml
b/tests/plugin/docker-compose.base.yml
index 5afb457..e101cd6 100644
--- a/tests/plugin/docker-compose.base.yml
+++ b/tests/plugin/docker-compose.base.yml
@@ -19,7 +19,7 @@ version: '2.1'
services:
collector:
- image:
ghcr.io/apache/skywalking-agent-test-tool/mock-collector:5acb890f225ca37ee60675ce3e330545e23e3cbc
+ image:
ghcr.io/apache/skywalking-agent-test-tool/mock-collector:092c6a3c753684b5a301baf5bcb1965f2dfaf79d
ports:
- 19876:19876
- 12800:12800
@@ -40,6 +40,8 @@ services:
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: collector:19876
SW_AGENT_LOGGING_LEVEL: DEBUG
+ # Agent test tool does not support profiling, TODO: address in e2e ref:
#155
+ SW_AGENT_PROFILE_ACTIVE: 'False'
networks:
- beyond
command: ['python3', '/entrypoint.py']
diff --git a/tests/plugin/http/sw_aiohttp/test_aiohttp.py
b/tests/plugin/http/sw_aiohttp/test_aiohttp.py
index 1e72a89..3e93276 100644
--- a/tests/plugin/http/sw_aiohttp/test_aiohttp.py
+++ b/tests/plugin/http/sw_aiohttp/test_aiohttp.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture # pyre-ignore
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/skywalking')
+ return lambda *_: requests.get('http://0.0.0.0:9090/skywalking', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/http/sw_http/test_http.py
b/tests/plugin/http/sw_http/test_http.py
index d9317ba..13895f8 100644
--- a/tests/plugin/http/sw_http/test_http.py
+++ b/tests/plugin/http/sw_http/test_http.py
@@ -25,7 +25,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.post('http://0.0.0.0:9090')
+ return lambda *_: requests.post('http://0.0.0.0:9090', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/http/sw_http_wsgi/test_http_wsgi.py
b/tests/plugin/http/sw_http_wsgi/test_http_wsgi.py
index 4a2a1f1..2bf98cc 100644
--- a/tests/plugin/http/sw_http_wsgi/test_http_wsgi.py
+++ b/tests/plugin/http/sw_http_wsgi/test_http_wsgi.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.post('http://0.0.0.0:9090')
+ return lambda *_: requests.post('http://0.0.0.0:9090', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/http/sw_requests/services/consumer.py
b/tests/plugin/http/sw_requests/services/consumer.py
index db0d10e..a6db142 100644
--- a/tests/plugin/http/sw_requests/services/consumer.py
+++ b/tests/plugin/http/sw_requests/services/consumer.py
@@ -28,7 +28,7 @@ if __name__ == '__main__':
self.send_header('Content-Type', 'application/json; charset=utf-8')
self.end_headers()
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
self.wfile.write(str(res.json()).encode('utf8'))
PORT = 9090
diff --git a/tests/plugin/http/sw_requests/test_request.py
b/tests/plugin/http/sw_requests/test_request.py
index 8108326..19b2c23 100644
--- a/tests/plugin/http/sw_requests/test_request.py
+++ b/tests/plugin/http/sw_requests/test_request.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.post('http://0.0.0.0:9090')
+ return lambda *_: requests.post('http://0.0.0.0:9090', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/http/sw_urllib3/test_urllib3.py
b/tests/plugin/http/sw_urllib3/test_urllib3.py
index 9316d1e..082cd33 100644
--- a/tests/plugin/http/sw_urllib3/test_urllib3.py
+++ b/tests/plugin/http/sw_urllib3/test_urllib3.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/web/sw_django/services/consumer.py
b/tests/plugin/web/sw_django/services/consumer.py
index 43ef0de..77272ca 100644
--- a/tests/plugin/web/sw_django/services/consumer.py
+++ b/tests/plugin/web/sw_django/services/consumer.py
@@ -30,7 +30,7 @@ settings.configure(
def index(request):
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
return JsonResponse(res.json())
diff --git a/tests/plugin/web/sw_django/test_django.py
b/tests/plugin/web/sw_django/test_django.py
index 0ef92a6..e719090 100644
--- a/tests/plugin/web/sw_django/test_django.py
+++ b/tests/plugin/web/sw_django/test_django.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2')
+ return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2',
timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/web/sw_falcon/services/consumer.py
b/tests/plugin/web/sw_falcon/services/consumer.py
index 49cbf7d..7575ec7 100644
--- a/tests/plugin/web/sw_falcon/services/consumer.py
+++ b/tests/plugin/web/sw_falcon/services/consumer.py
@@ -20,7 +20,7 @@ import requests
@hug.get('/users')
def get():
- res = requests.get('http://provider:9091/users')
+ res = requests.get('http://provider:9091/users', timeout=5)
return res.json()
diff --git a/tests/plugin/web/sw_falcon/test_falcon.py
b/tests/plugin/web/sw_falcon/test_falcon.py
index 17aa61f..9d93407 100644
--- a/tests/plugin/web/sw_falcon/test_falcon.py
+++ b/tests/plugin/web/sw_falcon/test_falcon.py
@@ -28,7 +28,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/web/sw_fastapi/services/consumer.py
b/tests/plugin/web/sw_fastapi/services/consumer.py
index d4dfd93..91fe524 100644
--- a/tests/plugin/web/sw_fastapi/services/consumer.py
+++ b/tests/plugin/web/sw_fastapi/services/consumer.py
@@ -25,7 +25,7 @@ if __name__ == '__main__':
@app.get('/users')
async def application():
- res = requests.get('http://provider:9091/users')
+ res = requests.get('http://provider:9091/users', timeout=5)
return res.json()
uvicorn.run(app, host='0.0.0.0', port=9090)
diff --git a/tests/plugin/web/sw_fastapi/test_fastapi.py
b/tests/plugin/web/sw_fastapi/test_fastapi.py
index 1f4e3d4..db79f76 100644
--- a/tests/plugin/web/sw_fastapi/test_fastapi.py
+++ b/tests/plugin/web/sw_fastapi/test_fastapi.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2')
+ return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2',
timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/web/sw_flask/services/consumer.py
b/tests/plugin/web/sw_flask/services/consumer.py
index 7e0a4f0..ce1cbfa 100644
--- a/tests/plugin/web/sw_flask/services/consumer.py
+++ b/tests/plugin/web/sw_flask/services/consumer.py
@@ -31,13 +31,13 @@ if __name__ == '__main__':
@runnable(op='/test')
def post():
- requests.post('http://provider:9091/users')
+ requests.post('http://provider:9091/users', timeout=5)
from threading import Thread
t = Thread(target=post)
t.start()
- res = requests.post('http://provider:9091/users')
+ res = requests.post('http://provider:9091/users', timeout=5)
t.join()
diff --git a/tests/plugin/web/sw_flask/test_flask.py
b/tests/plugin/web/sw_flask/test_flask.py
index f252438..13a5e79 100644
--- a/tests/plugin/web/sw_flask/test_flask.py
+++ b/tests/plugin/web/sw_flask/test_flask.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2')
+ return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2',
timeout=5)
class TestPlugin(TestPluginBase):
@@ -35,6 +35,6 @@ class TestPlugin(TestPluginBase):
def test_plugin(self, docker_compose, version):
self.validate()
- response = requests.get('http://0.0.0.0:9090/users')
+ response = requests.get('http://0.0.0.0:9090/users', timeout=5)
assert response.status_code == 200
assert response.json()['correlation'] == 'correlation'
diff --git a/tests/plugin/web/sw_pyramid/test_pyramid.py
b/tests/plugin/web/sw_pyramid/test_pyramid.py
index 95b1d9f..822e11b 100644
--- a/tests/plugin/web/sw_pyramid/test_pyramid.py
+++ b/tests/plugin/web/sw_pyramid/test_pyramid.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/pyramid')
+ return lambda *_: requests.get('http://0.0.0.0:9090/pyramid', timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/web/sw_sanic/services/consumer.py
b/tests/plugin/web/sw_sanic/services/consumer.py
index a2ae35b..9225923 100644
--- a/tests/plugin/web/sw_sanic/services/consumer.py
+++ b/tests/plugin/web/sw_sanic/services/consumer.py
@@ -24,7 +24,7 @@ if __name__ == '__main__':
@app.route('/users', methods=['GET'])
async def application(req):
- res = requests.get('http://provider:9091/users')
+ res = requests.get('http://provider:9091/users', timeout=5)
return response.json(res.json())
PORT = 9090
diff --git a/tests/plugin/web/sw_sanic/test_sanic.py
b/tests/plugin/web/sw_sanic/test_sanic.py
index 3413f4a..857e5b7 100644
--- a/tests/plugin/web/sw_sanic/test_sanic.py
+++ b/tests/plugin/web/sw_sanic/test_sanic.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2')
+ return lambda *_:
requests.get('http://0.0.0.0:9090/users?test=test1&test=test2&test2=test2',
timeout=5)
class TestPlugin(TestPluginBase):
diff --git a/tests/plugin/web/sw_tornado/services/consumer.py
b/tests/plugin/web/sw_tornado/services/consumer.py
index bc2c2e3..5e672f5 100644
--- a/tests/plugin/web/sw_tornado/services/consumer.py
+++ b/tests/plugin/web/sw_tornado/services/consumer.py
@@ -22,7 +22,7 @@ if __name__ == '__main__':
class MainHandler(tornado.web.RequestHandler):
def get(self):
- res = requests.get('http://provider:9091/users')
+ res = requests.get('http://provider:9091/users', timeout=5)
self.write(res.text)
def make_app():
diff --git a/tests/plugin/web/sw_tornado/test_tornado.py
b/tests/plugin/web/sw_tornado/test_tornado.py
index 15693af..80fd7c7 100644
--- a/tests/plugin/web/sw_tornado/test_tornado.py
+++ b/tests/plugin/web/sw_tornado/test_tornado.py
@@ -27,7 +27,7 @@ from tests.plugin.base import TestPluginBase
@pytest.fixture
def prepare():
# type: () -> Callable
- return lambda *_: requests.get('http://0.0.0.0:9090/users')
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
class TestPlugin(TestPluginBase):