mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-02 10:41:59 +01:00
In API test, there is a dead loop in checking GC status, it's fixed in this PR and add log inmformation in the loop. (#7643)
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
45210f7c40
commit
9019864446
@ -143,15 +143,17 @@ class System(base.Base):
|
|||||||
def validate_gc_job_status(self, gc_id, expected_gc_status, **kwargs):
|
def validate_gc_job_status(self, gc_id, expected_gc_status, **kwargs):
|
||||||
get_gc_status_finish = False
|
get_gc_status_finish = False
|
||||||
timeout_count = 20
|
timeout_count = 20
|
||||||
while not (get_gc_status_finish):
|
while timeout_count > 0:
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
status = self.get_gc_status_by_id(gc_id, **kwargs)
|
status = self.get_gc_status_by_id(gc_id, **kwargs)
|
||||||
|
print("GC job No: {}, status: {}".format(timeout_count, status.job_status))
|
||||||
if status.job_status == expected_gc_status:
|
if status.job_status == expected_gc_status:
|
||||||
get_gc_status_finish = True
|
get_gc_status_finish = True
|
||||||
|
break
|
||||||
timeout_count = timeout_count - 1
|
timeout_count = timeout_count - 1
|
||||||
|
|
||||||
if not (get_gc_status_finish):
|
if not (get_gc_status_finish):
|
||||||
raise Exception("Scan image result is not as expected {} actual scan status is {}".format(expected_scan_status, actual_scan_status))
|
raise Exception("GC status is not as expected '{}' actual GC status is '{}'".format(expected_gc_status, status.job_status))
|
||||||
|
|
||||||
def validate_deletion_success(self, gc_id, **kwargs):
|
def validate_deletion_success(self, gc_id, **kwargs):
|
||||||
log_content = self.get_gc_log_by_id(gc_id, **kwargs)
|
log_content = self.get_gc_log_by_id(gc_id, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user