ansible/event-driven-ansible

Tests are failing on power (ppc64le arch and x86 rhel8/9): Assertion and address already in use /Max retries exceeded with url

ashwinik30 opened this issue · 6 comments

  • ansible version

ansible [core 2.14.2]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.13 (main, Jun 15 2022, 11:39:48) [GCC 8.5.0 20210514 (Red Hat 8.5.0-13)] (/usr/bin/python3.9)
jinja version = 3.1.2
libyaml = False

  • Operating System:

NAME="Red Hat Enterprise Linux"
VERSION="8.7 (Ootpa)"

Also tested on
NAME="Red Hat Enterprise Linux"
VERSION="9.1.0 (Ootpa)"

*Arch :
ppc64le , x86

Description
Building upstream repo (event-driven-ansible )on power machine which needs to be pass successfully.
Tried testing on different Os such as rhel8/rhel9 on power and faced same testcase failing result

  • power result(ppc64le):

3 failed, 10 passed, 4 warnings, 1 error in 29.70s

  • x86 result

3 failed, 10 passed, 4 warnings, 1 error in 29.70s

  • s390x result:

3 failed, 10 passed, 4 warnings, 1 error in 29.70s

What I Did


**Summury of commands:**

1. git clone https://github.com/ansible/event-driven-ansible.git
2. cd event-driven-ansible
3. pip3 install kafka asyncmock aiokafka boto3 aiobotocore
4. pytest


**output**:
------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------
Running command:  ansible-rulebook -i /root/event-driven-ansible/tests/integration/default_inventory.yml --rulebook /root/event-driven-ansible/tests/integration/event_source_webhook/test_webhook_rules.yml --debug
Running command:  ansible-rulebook -i /root/event-driven-ansible/tests/integration/default_inventory.yml --rulebook /root/event-driven-ansible/tests/integration/event_source_webhook/test_webhook_rules.yml --debug
===================================================================== warnings summary ======================================================================
tests/unit/event_source/test_alertmanager.py::test_post_endpoint_with_default
/root/event-driven-ansible/plugins/event_source/alertmanager.py:66: DeprecationWarning: The dpath.util package is being deprecated. All util functions have been moved to dpath package top level.
 alerts = util.get(

tests/unit/event_source/test_alertmanager.py::test_post_endpoint_with_default
tests/unit/event_source/test_alertmanager.py::test_post_endpoint_with_default
tests/unit/event_source/test_alertmanager.py::test_post_endpoint_with_options
/root/event-driven-ansible/plugins/event_source/alertmanager.py:81: DeprecationWarning: The dpath.util package is being deprecated. All util functions have been moved to dpath package top level.
 host = util.get(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================== short test summary info ==================================================================
**FAILED** tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_sanity[default_port] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /webhook (Caused by NewConnectionEr...
**FAILED** tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_sanity[custom_port] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5001): Max retries exceeded with url: /webhook (Caused by NewConnectionEr...
**FAILED** tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_with_busy_port - AssertionError: assert 'address already in use' in ''
**ERROR** tests/integration/event_source_kafka/test_kafka_source.py::test_kafka_source_sanity - FileNotFoundError: [Errno 2] No such file or directory: 'docker-compose'
==================================================== 3 failed, 10 passed, 4 warnings, 1 error in 29.70s =====================================================
[root@ibm-p9z-23-lp6 event-driven-ansible]#

attaching log file for reference
eda_output_on_power.txt

Hi @ashwinik30,
**ERROR** tests/integration/event_source_kafka/test_kafka_source.py::test_kafka_source_sanity - FileNotFoundError: [Errno 2] No such file or directory: 'docker-compose'

It looks like you are missing docker-compose on the system. We do not include it in test_requirements.txt, it's up to the user how to install it (system package manager, pip etc). I recommend installing the Python based docker-compose via pip, since we've had mixed results with the Go implementation.

We've also recently updated the docs, so please give it another try following these instructions: https://github.com/ansible/event-driven-ansible/blob/main/CONTRIBUTING.md#running-tests-for-source-plugins

@ttuffin
Do docker-compose is also related to this error
FAILED tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_sanity[default_port] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /webhook (Caused by NewConnectionEr...
FAILED tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_sanity[custom_port] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5001): Max retries exceeded with url: /webhook (Caused by NewConnectionEr...
FAILED tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_with_busy_port - AssertionError: assert 'address already in use' in ''

@ttuffin
Installing docker-compose
I am still getting same error

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================== short test summary info ==================================================================
FAILED tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_sanity[default_port] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /webhook (Caused by NewConnectionEr...
FAILED tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_sanity[custom_port] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5001): Max retries exceeded with url: /webhook (Caused by NewConnectionEr...
FAILED tests/integration/event_source_webhook/test_webhook_source.py::test_webhook_source_with_busy_port - AssertionError: assert 'address already in use' in ''
ERROR tests/integration/event_source_kafka/test_kafka_source.py::test_kafka_source_sanity - subprocess.CalledProcessError: Command '['docker-compose', 'up', '-d']' returned non-zero exit status 1.
=============================================== 3 failed, 19 passed, 4 warnings, 1 error in 69.21s (0:01:09) ================================================
[root@ibm-p9z-18-lp3 event-driven-ansible]#

FYI @ttuffin Also I needed to do below change for power to pass below tests

FAILED tests/integration/event_source_url_check/test_url_check_source.py::test_url_check_source_sanity[valid_endpoint] - Failed: Timeout >5.0s
FAILED tests/integration/event_source_url_check/test_url_check_source.py::test_url_check_source_sanity[invalid_endpoint] - Failed: Timeout >5.0s
FAILED tests/integration/event_source_url_check/test_url_check_source.py::test_url_check_source_error_handling - Failed: Timeout >5.0s

Increasing timeout 5 to 30 for power as getting timeout error

git diff
+++ b/tests/integration/utils.py
-DEFAULT_TEST_TIMEOUT: int = 5
+DEFAULT_TEST_TIMEOUT: int = 30

After incresing timeout tests got passed

Tested on power
All tests got passed
Getting error related to kafka

ERROR tests/integration/event_source_kafka/test_kafka_source.py::test_kafka_source_sanity - subprocess.CalledProcessError: Command '['docker-compose', 'up', '-d']' returned non-zero exit status 1.

as image being used is not multi arch