Re: bailing out in tap tests nearly always a bad idea - Mailing list pgsql-hackers

From Andres Freund
Subject Re: bailing out in tap tests nearly always a bad idea
Date
Msg-id 20220214174620.bt35ruq3qnzddhtu@alap3.anarazel.de
Whole thread Raw
In response to Re: bailing out in tap tests nearly always a bad idea  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Responses Re: bailing out in tap tests nearly always a bad idea
Re: bailing out in tap tests nearly always a bad idea
List pgsql-hackers
Hi,

On 2022-02-14 16:08:42 +0000, Dagfinn Ilmari Mannsåker wrote:
> die()-ing is the correct way to abort a single test script.

There's really no way to nice way to abort without the "Dubious, test returned
255 (wstat 65280, 0xff00)" stuff?

Even just getting rid of the "Tests were run but no plan was declared and
done_testing() was not seen." noise would be helpful. So I think using a fatal
error routine that forced a failure to be recognized via ok(0, 'fatal error')
and then does done_testing() would be better...


> t/die-immediately.t .... aieee at t/die-immediately.t line 1.
> t/die-immediately.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
> No subtests run

Hm. Looks different when a test is including our test helpers.

t/000_die_pg_test_utils.pl .. Dubious, test returned 25 (wstat 6400, 0x1900)
No subtests run
t/000_die_test_more.pl ...... error at t/000_die_test_more.pl line 2.
t/000_die_test_more.pl ...... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run

So I think we broke something... I think it's the log file redirection stuff
in INIT.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Mark all GUC variable as PGDLLIMPORT
Next
From: Robert Haas
Date:
Subject: Re: bailing out in tap tests nearly always a bad idea