public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tromey@adacore.com>,
	 Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v3 0/2] Write DWARF index cache files in background
Date: Fri, 03 Mar 2023 09:41:28 -0700	[thread overview]
Message-ID: <87o7p9aitj.fsf@tromey.com> (raw)
In-Reply-To: <1154aa3c-4ef9-80ef-c551-35a9ce8bf294@simark.ca> (Simon Marchi's message of "Fri, 24 Feb 2023 16:44:34 -0500")

Simon> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created
Simon> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is there

I can't reliably reproduce this.

However, I believe the problem is that because the cache file is written
in the background, the test is racy.

I think the appended should fix it.  This just mirrors something done in
test_cache_enabled_hit, and the idea is that waiting for gdb to exit
ensures that the cache file will have been written.

Tom

diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index 0614d4ee2db..d9a6145b5df 100644
--- a/gdb/testsuite/gdb.base/index-cache.exp
+++ b/gdb/testsuite/gdb.base/index-cache.exp
@@ -157,6 +157,9 @@ proc_with_prefix test_cache_enabled_miss { cache_dir } {
 
     lassign [ls_host $cache_dir] ret files_before
 
+    # Just to populate the cache.
+    run_test_with_flags $cache_dir on {}
+
     run_test_with_flags $cache_dir on {
 
 	lassign [ls_host $cache_dir] ret files_after

  parent reply	other threads:[~2023-03-03 16:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 16:45 Tom Tromey
2022-12-19 16:45 ` [PATCH v3 1/2] Only use the per-BFD object to write a DWARF index Tom Tromey
2022-12-19 16:45 ` [PATCH v3 2/2] Write the DWARF index in the background Tom Tromey
2023-02-24 18:46 ` [PATCH v3 0/2] Write DWARF index cache files in background Tom Tromey
2023-02-24 21:44   ` Simon Marchi
2023-03-02 15:51     ` Tom Tromey
2023-03-03 16:41     ` Tom Tromey [this message]
2023-03-03 17:22       ` Simon Marchi
2023-03-03 17:29         ` Tom Tromey
2023-03-03 17:52           ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7p9aitj.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).