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

Add retry to version check in logs #6502

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/suite/test_build_info.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import logging
import time

import pytest
import yaml
Expand All @@ -18,10 +19,15 @@ def test_build_version(self, ingress_controller, kube_apis, ingress_controller_p
chart = yaml.safe_load(f)
ic_ver = chart["appVersion"]
print(f"NIC version from chart: {ic_ver}")

_info = self.send_build_info(kube_apis, ingress_controller_prerequisites)
_version = _info[_info.find("Version=") + len("Version=") : _info.rfind("GitCommit=")]
count = 0
while "Version=" not in _info and count < 5:
vepatel marked this conversation as resolved.
Show resolved Hide resolved
_info = self.send_build_info(kube_apis, ingress_controller_prerequisites)
count += 1
time.sleep(1)
_version = _info[_info.find("Version=") + len("Version=") : _info.rfind("Commit=")]
logging.info(_version)
print(f"Version from pod logs: {_version}")
assert _version != " "
assert ic_ver in _version

Expand Down