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

RE: [Possible Breakage] t1308 - Bad return value from test-tool

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Feb 10, 2019, 00:15 UTC
Message-ID
<000001d4c0d5$c972ad90$5c5808b0$@nexbridge.com>
In-Reply-To
<20190209233246.GB7135@sigill.intra.peff.net>
On February 9, 2019 18:33, Jeff King wrote:
Show 9 quoted lines
> On Sat, Feb 09, 2019 at 01:08:01PM -0500, Randall S. Becker wrote:
> 
> > > It sounds like you might need to set FREAD_READS_DIRECTORIES in your
> > > config.mak.
> >
> > Setting FREAD_READS_DIRECTORIES = UnfortunatelyYes
> 
> Silly question, but you did rebuild after setting that, not just re-run the tests,
> right?
Yes make was run, but some doofus (me) did not run make tests first, so test-tool was out of date, post reconfigure. When just a code change is made, test-tool gets build. I was/am confused.
Show 28 quoted lines
> > still results in
> >
> > Value not found for "foo.bar"
> > test_expect_code: command exited with 1, we wanted 2 test-tool config
> > configset_get_value foo.bar a-directory not ok 23 - proper error on
> directory "files"
> > #
> > #               echo "Error (-1) reading configuration file a-directory." >expect
> &&
> > #               mkdir a-directory &&
> > #               test_expect_code 2 test-tool config configset_get_value foo.bar
> a-directory 2>output &&
> > #               grep "^warning:" output &&
> > #               grep "^Error" output >actual &&
> > #               test_cmp expect actual
> > #
> >
> > I don't think that helped. While fopen can open a directory, fread
> > does not return any data in this platform. readdir or nftw/ftw are
> > pretty much the only options. However, the code still goes down the
> > goto exit1 path in this situation.
> 
> Hrm. That's the exact case FREAD_READS_DIRECTORIES is supposed to help.
> It does an fstat() after fopen()ing the file to see if it points to a directory, and
> if so closes it immediately and returns EISDIR.
> 
> Can you confirm via debugger (or printf statements) that we make it into
> git_fopen, and what the resulting st.st_mode we see looks like?
It did not get into git_fopen at all. Subtest 1 did, but that's no surprise.
t1308 is passes now, finally. Patch coming.

Thanks for the help, Randall

Previous: Jeff King
Message 5 of 5 in “[Possible Breakage] t1308 - Bad return value from test-tool”
  1. Randall S. BeckerFeb 8, 2019
  2. Jeff KingFeb 9, 2019
  3. Randall S. BeckerFeb 9, 2019
  4. Jeff KingFeb 9, 2019
  5. Randall S. BeckerFeb 10, 2019

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.