From: Pedro Alves <pedro@palves.net>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/testsuite] Fix race in gdb.threads/detach-step-over.exp
Date: Fri, 16 Dec 2022 12:41:14 +0000 [thread overview]
Message-ID: <0755efda-fea9-10d6-d138-d2857429218e@palves.net> (raw)
In-Reply-To: <20221213140237.32325-1-tdevries@suse.de>
On 2022-12-13 2:02 p.m., Tom de Vries via Gdb-patches wrote:
> Once in a while I run into:
> ...
> FAIL: gdb.threads/detach-step-over.exp: \
> breakpoint-condition-evaluation=host: target-non-stop=off: non-stop=off: \
> displaced=off: iter 1: all threads running
> ...
>
> In can easily reproduce this by doing:
> ...
> # Wait a bit, to give time for the threads to hit the
> # breakpoint.
> - sleep 1
>
> return true
> ...
>
> Fix this by counting the running threads in a loop, effectively allowing 10
> seconds (instead of 1) for the threads to start running, but only sleeping if
> needed.
>
> Reduces total execution time from 1m27s to 56s.
Cool, thanks. I've run into this race too once in a while, but never managed to find time
to look into it.
LGTM, with just one nit:
> + if { $interrupted == 0 } {
Just a bit below we have:
if {!$interrupted} {
I'd rather the same form is used in both places, and I think the second form is better.
prev parent reply other threads:[~2022-12-16 12:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 14:02 Tom de Vries
2022-12-16 12:41 ` Pedro Alves [this message]
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=0755efda-fea9-10d6-d138-d2857429218e@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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).