unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH] test: avoid hanging older gdb under GNU timeout and moreutils parallel
Date: Mon, 20 May 2019 23:32:20 -0300	[thread overview]
Message-ID: <87sgt8tu4r.fsf@tethera.net> (raw)
In-Reply-To: <20190521010304.417-1-dkg@fifthhorseman.net>

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

>
> A marginally cleaner patch be to consistently use gdb with either one
> of:
>
>  * -tty /dev/null
>  * < /dev/null
>
> in all of T050, T060, and T070.  But T070 can't use "< /dev/null"
> because it needs stdin.  And when i tried to use "-tty /dev/null" in
> T050 and T060, i got test suite failures that i wasn't able to
> understand.
>

I don't have any understanding to offer, but I wonder if most/all of our
use of gdb could be replaced by writing simple shim libraries and using
LD_PRELOAD.  I did a quick proof of concept (at end) for one of the tests in
T070-insert.sh. This would require switching at least some of the test
to use the notmuch-shared binary. 

I don't know if relying on LD_PRELOAD is particularly portable. Various
linux distros should be OK, and a quick look at the FreeBSD docs suggest
it might be ok. MacOS would probably need some extra work, as
usual. OTOH, I'm not sure how well (if at all) the gdb based tests work
on MacOS.

In practice the following would presumably be generated by the test
script.

/* gcc -Wall -O2 -fpic -shared -ldl -o shim.so shim.c */
/* LD_PRELOAD=../shim.sh ../../notmuch-shared --config=./notmuch-config insert < foo */
#include "notmuch.h"
#include <stdio.h>

notmuch_status_t
notmuch_database_index_file (notmuch_database_t *notmuch,
			     const char *filename,
			     notmuch_indexopts_t *indexopts,
			     notmuch_message_t **message_ret)
{
    printf("calling notmuch_database_index_file\n");
    return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}

  reply	other threads:[~2019-05-21  2:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 10:45 parallel tests broken on Debian stable David Bremner
2019-05-20 17:27 ` Daniel Kahn Gillmor
2019-05-20 18:55   ` Tomi Ollila
2019-05-20 21:45     ` Daniel Kahn Gillmor
2019-05-20 23:49   ` Daniel Kahn Gillmor
2019-05-21  0:44     ` Daniel Kahn Gillmor
2019-05-21  1:03       ` [PATCH] test: avoid hanging older gdb under GNU timeout and moreutils parallel Daniel Kahn Gillmor
2019-05-21  2:32         ` David Bremner [this message]
2019-05-21 15:45           ` Daniel Kahn Gillmor
2019-05-21  6:12         ` Tomi Ollila
2019-05-21 15:50           ` Daniel Kahn Gillmor
2019-05-21 20:23             ` Tomi Ollila
2021-10-30 19:30 ` parallel tests broken on Debian stable David Bremner

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=87sgt8tu4r.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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).