unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Subject: Re: [PATCH] test: redirect STDIN from /dev/tty
Date: Tue, 21 May 2019 21:24:24 -0400	[thread overview]
Message-ID: <87sgt78enr.fsf@fifthhorseman.net> (raw)
In-Reply-To: <20190521201702.28754-1-tomi.ollila@iki.fi>

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

On Tue 2019-05-21 23:17:02 +0300, Tomi Ollila wrote:
> Without this stdin may be anything that parent process provided for it.

I'm fine with this change -- i can confirm that it avoids the hanging
problem on debian stable for me.

please merge either this, or
id:20190521010304.417-1-dkg@fifthhorseman.net . i don't think we need
both.

Tomi's step here is a "big hammer" approach by comparison with my patch
targeting gdb itself, but it's also simple and elegant -- stdin from
outside the test suite has no business interfering with the tests.

> Test processes might have tried to read something from it, which would
> have caused undeterministic behavior.

My only (weak, nagging) concern is that this change may err on the side
of "too much determinism", in the sense that different stdin setups
might more accurately represent "real world" use cases of notmuch than
stdin being mapped to /dev/null.

However, if those different configurations that we happen to get from
random people invoking the test suite in different ways are actually
important, then the test suite should probably try to explicitly
enumerate those cases, and test them regardless of the environment in
which the test suite is run.

> E.g. gdb(1) tries to do tty related ioctls on fd 0 (and fd 1 and fd 2,
> but those are redirected to 'test.output' before test runs).

For the record, these problems were only with moreutils parallel when
used in combination with a specific version of gdb.

if gdb (or some other subprocess (gpg, i'm looking at you)) were to try
to monkey around with /dev/tty, i think even with this "big
hammer" fix, it could do so, because we haven't isolated the tests from
the "controlling terminal" (see tty(4)).

But again, if we run into that, that is probably worth an independent
fix (with "setsid --wait" or something like that, ugh).

        --dkg

PS if we merge this change, does it mean that we can/should remove the
   -tty /dev/null stuff from T380-atomicity.sh?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2019-05-22  1:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 20:17 [PATCH] test: redirect STDIN from /dev/tty Tomi Ollila
2019-05-22  1:24 ` Daniel Kahn Gillmor [this message]
2019-05-22  1:56 ` David Bremner
2019-05-22  5:29   ` Tomi Ollila
2019-05-22 11:49     ` 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=87sgt78enr.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /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).