forked from HAL9000/cleveragents-core
fix(test): remove retry masking and output filtering in database integration test
- Remove silent retry logic in Run Python Script that masked intermittent failures by retrying on empty stdout + non-zero RC - Change output filter from 'in' to 'startswith' so only lines beginning with log prefixes are filtered, not lines containing them mid-string - Remove [error from the filter list so error lines are never silently discarded from test output Fixes #898
This commit is contained in:
@@ -760,16 +760,6 @@ Run Python Script
|
||||
${temp_file}= Evaluate (lambda t: (__import__('os').close(t[0]), t[1])[-1])(__import__('tempfile').mkstemp(suffix='.py', dir='/tmp'))
|
||||
Create File ${temp_file} ${full_code}
|
||||
${result}= Run Process ${PYTHON} ${temp_file} timeout=60s stderr=STDOUT env:PYTHONWARNINGS=ignore env:PYTHONDONTWRITEBYTECODE=1
|
||||
# Retry once when the process was likely killed by a signal (OOM / CPU
|
||||
# starvation under heavy parallel CI load). A signal-killed process
|
||||
# produces empty stdout because its output buffer is never flushed.
|
||||
IF ${result.rc} != 0
|
||||
${stdout_len}= Get Length ${result.stdout}
|
||||
IF ${stdout_len} == 0
|
||||
Sleep 3s reason=Retrying after transient subprocess failure (rc=${result.rc})
|
||||
${result}= Run Process ${PYTHON} ${temp_file} timeout=60s stderr=STDOUT env:PYTHONWARNINGS=ignore env:PYTHONDONTWRITEBYTECODE=1
|
||||
END
|
||||
END
|
||||
Remove File ${temp_file}
|
||||
# Check if process failed and log stderr if present
|
||||
IF ${result.rc} != 0
|
||||
@@ -782,7 +772,7 @@ Run Python Script
|
||||
FOR ${line} IN @{lines}
|
||||
${stripped}= Strip String ${line}
|
||||
# Skip debug/logging lines
|
||||
IF '${stripped}' != '' and not '[debug' in '${stripped}' and not '[info' in '${stripped}' and not '[warning' in '${stripped}' and not '[error' in '${stripped}'
|
||||
IF '${stripped}' != '' and not '${stripped}'.startswith('[debug') and not '${stripped}'.startswith('[info') and not '${stripped}'.startswith('[warning')
|
||||
Append To List ${filtered_lines} ${stripped}
|
||||
END
|
||||
END
|
||||
|
||||
Reference in New Issue
Block a user