git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [BUG] test_must_fail: does not correctly detect failures - Was Git 2.16.0-rc2 Test Summary on NonStop

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Jan 15, 2018, 14:25 UTC
Message-ID
<001b01d38e0c$ba16e250$2e44a6f0$@nexbridge.com>
In-Reply-To
<499fb29f-ca34-8d28-256d-896107c29a3e@kdbg.org>
On January 15, 2018 2:06 AM, Johannes Sixt wrote:
Show 27 quoted lines
> Am 15.01.2018 um 03:37 schrieb Randall S. Becker:
> > On January 14, 2018 4:33 PM, I wrote:
> >> The exotic error code coming back from perl is 162. I can muck with
> >> it, if there was a value more useful to git.
> >> *  553          } else if (WIFEXITED(status)) {
> >> *  554                  code = WEXITSTATUS(status);
> >> (eInspect 3,887):p code
> >> $4 = 162
> >>
> >> The perl code uses die to terminate with a non-specific non-zero error
> code.
> >> What it seems is that there is an assumed value that the git tests
> >> depend on, but perl.org describes the following:
> >>
> >> "die raises an exception. Inside an eval the error message is stuffed
> >> into $@ and the eval is terminated with the undefined value. If the
> >> exception is outside of all enclosing evals, then the uncaught
> >> exception prints LIST to STDERR and exits with a non-zero value. If
> >> you need to exit the process with a specific exit code, see exit."
> 
> I take "die exits with non-zero" as a piece of information for the
> *users* so that they can write "if perl foo.pl; then something; fi" in shell
> scripts. I do *not* interpret it as leeway for implementers of perl to choose
> any random value as exit code. Choosing 162 just to be funky would be
> short-sighted. [I'm saying all this without knowing how perl specifies 'die'
> beyond the paragraph you cited. Perhaps there's more about 'die' that
> justifies exit code 162.] I'd say that the perl port is broken.
I agree that 162 is wrong. Its interpretation is 128+signal, which clearly does not happen in this case. On the platform, if the perl script is via stdin, 162 or 169 are returned. If via file (perl file.pl), 255 comes back. The port has issues. I have an opened a bug report with the platform developers. Usual non-Open Source timeframes to fix apply. ☹
Show 16 quoted lines
> >>
> >> So it seems that we might need to either not use die or change the
> >> tests not to care about the exit code for specific tests involving perl.
> Suggestions?
> >
> > Sadly, while changing the funky 162 completion code to 255 works fine
> > for t9001, it causes a bunch of other tests to fail (parts of
> > 1308 and most of 1404). I can't tall whether this is test suite or
> > code related but I'm caught in the middle. Going to the platform
> > developers may eventually get the fix for t9001 (fixing perl), but
> > otherwise, I'm not sure why changing 162 to 255 causes 1308 and 1404
> > to blow so badly. In any event, I'm putting this away for a few days
> > due to $DAYJOB.
> 
> Why do you not choose 1? He, on my Linux box perl -e die exits with 255.
> So...
Choosing 1 is an option. I can try that, but I'm not sure it's going to help the test situation more than choosing 255 to replace 162. 

Cheers, Randall

Previous: Johannes SixtNext: brian m. carlson
Message 7 of 9 in “[BUG] test_must_fail: does not correctly detect failures - Was Git 2.16.0-rc2 Test Summary on NonStop”
  1. Randall S. BeckerJan 13, 2018
  2. Randall S. BeckerJan 14, 2018
  3. Johannes SixtJan 14, 2018
  4. Randall S. BeckerJan 14, 2018
  5. Randall S. BeckerJan 15, 2018
  6. Johannes SixtJan 15, 2018
  7. Randall S. BeckerJan 15, 2018
  8. brian m. carlsonJan 16, 2018
  9. Randall S. BeckerJan 16, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.