diff --git a/common/generate_combined_report.py b/common/generate_combined_report.py index 1328f64..7f5e34f 100755 --- a/common/generate_combined_report.py +++ b/common/generate_combined_report.py @@ -284,10 +284,10 @@ def generate_combined_report(results_dir): if os.path.exists(cpu_stress_marker_file): with open(cpu_stress_marker_file, 'r') as f: marker_content = f.read() - if 'CPU_STRESS=RUNNING' in marker_content or 'PID=' in marker_content: - cpu_stress_status = 'success' # Assume success if marker exists - elif 'STATUS=FAILED' in marker_content: + if 'STATUS=FAILED' in marker_content: cpu_stress_status = 'failed' + elif 'CPU_STRESS=RUNNING' in marker_content or 'PID=' in marker_content: + cpu_stress_status = 'success' # Read CPU stress log content cpu_stress_log_file = os.path.join(results_dir, 'cpu_stress.log') @@ -304,10 +304,10 @@ def generate_combined_report(results_dir): if os.path.exists(gpu_stress_marker_file): with open(gpu_stress_marker_file, 'r') as f: marker_content = f.read() - if 'GPU_STRESS=RUNNING' in marker_content or 'PID=' in marker_content: - gpu_stress_status = 'success' # Assume success if marker exists - elif 'STATUS=FAILED' in marker_content: + if 'STATUS=FAILED' in marker_content: gpu_stress_status = 'failed' + elif 'GPU_STRESS=RUNNING' in marker_content or 'PID=' in marker_content: + gpu_stress_status = 'success' # Read GPU stress log content gpu_stress_log_file = os.path.join(results_dir, 'gpu_stress.log') diff --git a/cpu/cpu_test.sh b/cpu/cpu_test.sh index fa15fa2..8ab6093 100755 --- a/cpu/cpu_test.sh +++ b/cpu/cpu_test.sh @@ -37,6 +37,14 @@ echo "CPU stress test started (PID: $STRESS_PID)" # Update marker file with PID for the main script to kill later echo "PID=${STRESS_PID}" >> "${RESULTS_DIR}/cpu_stress_marker.txt" +# stress-ng can exit straight away (unsupported option, cgroup limit, no memory). +# Record that so the report doesn't count a test that never ran as a pass. +sleep 1 +if ! kill -0 "${STRESS_PID}" 2>/dev/null; then + echo "STATUS=FAILED" >> "${RESULTS_DIR}/cpu_stress_marker.txt" + echo "CPU stress test exited immediately, see cpu_stress.log" +fi + # Keep running until killed by main script wait $STRESS_PID 2>/dev/null diff --git a/gpu/gpu_test.sh b/gpu/gpu_test.sh index 8864794..fb50a79 100755 --- a/gpu/gpu_test.sh +++ b/gpu/gpu_test.sh @@ -103,6 +103,20 @@ echo "PIDs: $PID_LIST" # Update marker file with PIDs for the main script to kill later echo "PID=${PID_LIST}" >> "${RESULTS_DIR}/gpu_stress_marker.txt" +# glmark2 exits straight away without a working GL context. Record that so the +# report doesn't count a test that never ran as a pass. +sleep 1 +GPU_STRESS_ALIVE=false +for PID in $PID_LIST; do + if kill -0 "$PID" 2>/dev/null; then + GPU_STRESS_ALIVE=true + fi +done +if [ "$GPU_STRESS_ALIVE" = false ]; then + echo "STATUS=FAILED" >> "${RESULTS_DIR}/gpu_stress_marker.txt" + echo "GPU stress processes exited immediately, see gpu_stress.log" +fi + # Show countdown dialog using yad if available if [ "$YAD_AVAILABLE" = true ]; then # Calculate timeout in seconds