Skip to content

Commit 1bd5734

Browse files
authored
add retry to version check in logs (#6502)
1 parent 6856eb6 commit 1bd5734

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/suite/test_build_info.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22
import logging
3+
import time
34

45
import pytest
56
import yaml
@@ -18,10 +19,15 @@ def test_build_version(self, ingress_controller, kube_apis, ingress_controller_p
1819
chart = yaml.safe_load(f)
1920
ic_ver = chart["appVersion"]
2021
print(f"NIC version from chart: {ic_ver}")
21-
2222
_info = self.send_build_info(kube_apis, ingress_controller_prerequisites)
23-
_version = _info[_info.find("Version=") + len("Version=") : _info.rfind("GitCommit=")]
23+
count = 0
24+
while "Version=" not in _info and count < 5:
25+
_info = self.send_build_info(kube_apis, ingress_controller_prerequisites)
26+
count += 1
27+
time.sleep(1)
28+
_version = _info[_info.find("Version=") + len("Version=") : _info.rfind("Commit=")]
2429
logging.info(_version)
30+
print(f"Version from pod logs: {_version}")
2531
assert _version != " "
2632
assert ic_ver in _version
2733

0 commit comments

Comments
 (0)