Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wazuh one_manager_agent system tests are failing due to KeyError: 'managers' while is executed using one_manager_agent_env mark #4763

Closed
pro-akim opened this issue Dec 12, 2023 · 2 comments · Fixed by #4782
Assignees
Labels

Comments

@pro-akim
Copy link
Member

pro-akim commented Dec 12, 2023

Running system test in v4.8.0-alpha1
In one_manager_agent environment test could not be executed using the mark one_manager_agent_env showing the following error:

test_cluster/test_correct_merged_file_generation/test_correct_merged_file_generation.py 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/akim/.local/lib/python3.10/site-packages/_pytest/main.py", line 268, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/akim/.local/lib/python3.10/site-packages/_pytest/main.py", line 322, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/akim/.local/lib/python3.10/site-packages/_pytest/main.py", line 347, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/akim/.local/lib/python3.10/site-packages/_pytest/runner.py", line 111, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/home/akim/.local/lib/python3.10/site-packages/_pytest/runner.py", line 130, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/home/akim/.local/lib/python3.10/site-packages/_pytest/runner.py", line 221, in call_and_report
INTERNALERROR>     report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/akim/Desktop/wazuh-qa/tests/system/conftest.py", line 132, in pytest_runtest_makereport
INTERNALERROR>     for host in host_manager.get_inventory()['managers']['hosts']:
INTERNALERROR> KeyError: 'managers'

Several times were executed in different machines (EC2, local) however, the error has persisted.

On the other hand, running test_cluster/test_correct_merged_file_generation/test_correct_merged_file_generation.py separated from the rest of the tests (without the pytest -m) is working ok.

Further research is required.

@wazuhci wazuhci moved this to Triage in Release 4.8.0 Dec 12, 2023
@pro-akim pro-akim changed the title Wazuh one_manager_agent system tests are failing due to KeyError: 'managers' Wazuh one_manager_agent system tests are failing due to KeyError: 'managers' while is executed using one_manager_agent_env tag Dec 12, 2023
@pro-akim pro-akim changed the title Wazuh one_manager_agent system tests are failing due to KeyError: 'managers' while is executed using one_manager_agent_env tag Wazuh one_manager_agent system tests are failing due to KeyError: 'managers' while is executed using one_manager_agent_env mark Dec 12, 2023
@wazuhci wazuhci moved this from Triage to Backlog in Release 4.8.0 Dec 18, 2023
@Deblintrake09 Deblintrake09 self-assigned this Dec 18, 2023
@wazuhci wazuhci moved this from Backlog to In progress in Release 4.8.0 Dec 18, 2023
@wazuhci wazuhci moved this from In progress to In review in Release 4.8.0 Dec 19, 2023
@wazuhci wazuhci moved this from In review to Pending review in Release 4.8.0 Dec 19, 2023
@wazuhci wazuhci moved this from Pending review to In review in Release 4.8.0 Dec 20, 2023
@pro-akim
Copy link
Member Author

Review Notes

LGTM

@wazuhci wazuhci moved this from In review to Pending final review in Release 4.8.0 Dec 20, 2023
@davidjiglesias
Copy link
Member

LGTM

@wazuhci wazuhci moved this from Pending final review to Done in Release 4.8.0 Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants