Require fresh collector evidence in Kubernetes smoke
All checks were successful
deploy / deploy (push) Successful in 15s
All checks were successful
deploy / deploy (push) Successful in 15s
This commit is contained in:
parent
38c7811252
commit
9fc523c0a7
1 changed files with 9 additions and 1 deletions
|
|
@ -136,6 +136,13 @@ def get_collector_pod(exclude_names=None):
|
|||
raise TimeoutError(f'no ready collector pod found; last pods={last}')
|
||||
|
||||
|
||||
def pod_start_epoch(pod):
|
||||
timestamp = pod.get('status', {}).get('startTime') or pod.get('metadata', {}).get('creationTimestamp')
|
||||
if not timestamp:
|
||||
return 0
|
||||
return dt.datetime.fromisoformat(timestamp.replace('Z', '+00:00')).timestamp()
|
||||
|
||||
|
||||
def exec_python(pod, code, args):
|
||||
command = [kubectl, '-n', namespace, 'exec', '-i', pod, '--', 'python3', '-', *args]
|
||||
proc, item = capture(command, input_text=code, timeout=wait_seconds + 60)
|
||||
|
|
@ -414,7 +421,8 @@ try:
|
|||
if rollout['exit_code'] != 0:
|
||||
raise RuntimeError('collector deployment rollout is not healthy')
|
||||
pod_name, pod_obj = get_collector_pod()
|
||||
before = wait_for_valid_collector(pod_name, 0, 'initial')
|
||||
initial_after_mtime = max(0, pod_start_epoch(pod_obj) - 5)
|
||||
before = wait_for_valid_collector(pod_name, initial_after_mtime, 'initial')
|
||||
before_mtime = before['mtime']
|
||||
old_file = before['output_files'][0]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue