]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rados/test.sh: Create XML report for timeout tests
authorKamoltat Sirivadhna <ksirivad@redhat.com>
Sat, 28 Jun 2025 20:06:52 +0000 (20:06 +0000)
committerKamoltat Sirivadhna <ksirivad@redhat.com>
Wed, 2 Jul 2025 20:59:11 +0000 (20:59 +0000)
Currently the failure description in teuthology doesn't
give us much detail rather than COMMAND_FAILURE when
the test timedout, this is because when we timeout and
kill the process there are no XML files generated, therefore,
this commit will create an XML file report when we decide
to timeout and kill the long running test process.

Fixes: https://tracker.ceph.com/issues/70772
Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
qa/workunits/rados/test.sh

index 41096528563ba1bd498efec7689a7318fa355a98..09f3980928804bea9844c8bd30369b4d0fc5193a 100755 (executable)
@@ -119,6 +119,28 @@ do
         if [ $waited -ge $max_wait ]; then
         # Process timed out
         echo "ERROR: Test $t ($pid) - TIMED OUT after $max_wait seconds"
+
+        # Create fallback XML file
+        xml_path="$GTEST_OUTPUT_DIR/$t.xml"
+        if [[ $t == neorados_* ]]; then
+            xml_path="$GTEST_OUTPUT_DIR/neorados_$t.xml"
+        fi
+
+        echo "Creating fallback XML report at $xml_path"
+        cat > "$xml_path" << EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuites tests="1" failures="1" disabled="0" errors="0" time="${max_wait}.000" timestamp="$(date -Iseconds)" name="AllTests">
+  <testsuite name="Timeout" tests="1" failures="1" disabled="0" errors="0" time="${max_wait}.000">
+    <testcase name="UnknownTestCase" status="timeout" time="${max_wait}.000" classname="${t}">
+      <failure message="Test suite timed out after ${max_wait} seconds" type="timeout">
+        The test suite ${t} (PID ${pid}) exceeded the maximum allowed execution time of ${max_wait} seconds.
+        Unable to determine which specific test case was running when the timeout occurred.
+        Please check the logs for more details, this may indicate a hang, deadlock, or extremely slow performance.
+      </failure>
+    </testcase>
+  </testsuite>
+</testsuites>
+EOF
         kill -9 $pid 2>/dev/null || true
         ret=1
         break