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

test_metrics_endpoint fails to confirm metrics target #138

Closed
orfeas-k opened this issue Dec 2, 2024 · 2 comments · Fixed by #145
Closed

test_metrics_endpoint fails to confirm metrics target #138

orfeas-k opened this issue Dec 2, 2024 · 2 comments · Fixed by #145
Labels
bug Something isn't working

Comments

@orfeas-k
Copy link
Contributor

orfeas-k commented Dec 2, 2024

Bug Description

During metrics endpoint assertion, integration tests fail with:

    assert target_data["state"] == "up", f"target for {app.name} is not in {target_data['state']}"
AssertionError: target for metacontroller-operator is not in unknown

This is probably because

To Reproduce

Rerun CI

Environment

Microk8s 1.29, juju 3.4

Relevant Log Output

=================================== FAILURES ===================================
_____________________________ test_metrics_enpoint _____________________________
Traceback (most recent call last):
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 341, in from_call
    result: Optional[TResult] = func()
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 262, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
    raise e
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
    item.runtest()
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/pytest_asyncio/plugin.py", line 532, in inner
    _loop.run_until_complete(task)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/tests/integration/test_charm.py", line 67, in test_metrics_enpoint
    await assert_metrics_endpoint(app, metrics_port=9999, metrics_path="/metrics")
  File "/home/runner/work/metacontroller-operator/metacontroller-operator/.tox/integration/lib/python3.8/site-packages/charmed_kubeflow_chisme/testing/cos_integration.py", line 463, in assert_metrics_endpoint
    assert target_data["state"] == "up", f"target for {app.name} is not in {target_data['state']}"
AssertionError: target for metacontroller-operator is not in unknown

Additional Context

No response

@orfeas-k orfeas-k added the bug Something isn't working label Dec 2, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-6630.

This message was autogenerated

@orfeas-k
Copy link
Contributor Author

After all, this was fixed by implementing a tenacity retry by default in chisme in canonical/charmed-kubeflow-chisme#124 and then release a new version and bring it in the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant