]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: avoid intermittent failures on a debuginfod test
authorAndrew Burgess <aburgess@redhat.com>
Sun, 27 Oct 2024 08:55:16 +0000 (08:55 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Sun, 27 Oct 2024 09:06:29 +0000 (09:06 +0000)
I saw a failure in gdb.debuginfod/build-id-no-debug-warning.exp which
I could only produce one time.

Normally the test output looks like this:

  file /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug
  Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug...
  Downloading separate debug info for /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug...
  Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.client_cache/0c30f589cc4f2c0fb22c8914d042ddf39c9a3885/debuginfo...
  (gdb) PASS: gdb.debuginfod/build-id-no-debug-warning.exp: local_debuginfod: debuginfod running, info downloaded, no war

But one time I saw this:

  file /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug
  Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug...
  Downloading 6.77 K separate debug info for /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug...
  Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.client_cache/0c30f589cc4f2c0fb22c8914d042ddf39c9a3885/debuginfo...
  (gdb) FAIL: gdb.debuginfod/build-id-no-debug-warning.exp: local_debuginfod: debuginfod running, info downloaded, no warnings

The difference is the "Downloading separate debug info for ..." line
has gained an extra '6.77 K' component.  When I got the FAIL the
machine was under heavy load, so I suspect everything was running
pretty slow.  I think the size is only added when the debuginfod
download is taking its time.

Anyway, the test in question is not expecting to see a size, which is
why it failed.

Every other debuginfod test does allow for an optional size being
printed, so lets update this test to also accept an optional size,
this should prevent failures like this in the future.

gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp

index 0819aaeec728e880ac1448586d5b2d5b1467a10f..8d7581fc6f7ccbb81f6c14e43ed4aac8f5eb4840 100644 (file)
@@ -139,7 +139,7 @@ proc_with_prefix local_debuginfod { } {
     gdb_test "file ${build_id_debug_file}" \
        [multi_line \
             "Reading symbols from ${build_id_debug_file}\\.\\.\\." \
-            "Downloading separate debug info for ${build_id_debug_file}\\.\\.\\." \
+            "Downloading\[^\r\n\]*separate debug info for ${build_id_debug_file}\\.\\.\\." \
             "Reading symbols from ${cache}/\[^\r\n\]+\\.\\.\\.(?:\r\nExpanding full symbols from \[^\r\n\]+)*"] \
        "debuginfod running, info downloaded, no warnings"
 }