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

Re: [PATCH v2] ssh signing: don't detach the filename strbuf from key_file tempfile

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jul 7, 2025, 15:26 UTC
Message-ID
<7130651b-76a6-4eb1-93cf-c9e237d398d7@gmail.com>
In-Reply-To
<DB5W4LH0MI5K.EJ0IILQ1IWR@redoste.xyz>
On 07/07/2025 15:25, redoste wrote:
Show 12 quoted lines
> On Mon Jul 7, 2025 at 11:35 CEST, Phillip Wood wrote:
>> On 07/07/2025 10:02, Patrick Steinhardt wrote:
>>> I think this exported environment variable now leaks into subsequent
>>> tests, doesn't it? We may want to do it in a subshell.
>>
>> That's a very good point.
> Sure thing, I took inspiration from the previous ssh-agent test and it
> exports the ssh-agent variables without spawning a subshell, so I
> figured it was fine, but it was only because test_when_finished will
> fail in a subshell.
> I guess it's probably fine to leak only the ssh-agent variables
> accross tests and keep TMPDIR in a subshell.

Hopefully having the ssh-agent variables set after the agent has been killed doesn't affect the later tests

Show 13 quoted lines
>> The idiomatic way to test for an empty file is "test_file_is_empty
>> <file>" which avoids spawning wc.
> Thanks, I will update this.
> 
>> As this test is an abridged version of the other test that uses
>> ssh-agent I think it would be more efficient to tweak that test to check
>> there are no temporary files left over. Our test suite is slow and
>> tweaking an existing test to improve our coverage instead of adding a
>> new test means we don't make it any slower than necessary.
> I moved this test out of the other ssh-agent one according to the advice
> from brian on the previous version. I agree that spawning multiple
> ssh-agent is definitly not the best for speed, but is it worth it to
> make the test failure less clear?

test_file_is_empty will print a diagnostic message if it fails so it should be clear what has caused the test failure

> I feel like it's not the best to keep checks for temporary files clean
> up in a test that (initially) only claims to sign commits.

You can always tweak the test title if you want. The way I see it is that the changes that are being tested are related to commit signing as the invariant that we want to assert is that temporary files are cleaned up after signing commits.

Thanks
Phillip
Previous: redosteNext: redoste
Message 15 of 21 in “ssh signing: don't detach the filename strbuf from key_file tempfile”
  1. ssh signing: don't detach the filename strbuf from key_file tempfileredoste, Jul 4, 2025
  2. Jeff KingJul 5, 2025
  3. brian m. carlsonJul 5, 2025
  4. redosteJul 5, 2025
  5. redosteJul 5, 2025
  6. brian m. carlsonJul 6, 2025
  7. Jeff KingJul 6, 2025
  8. redosteJul 6, 2025
  9. redosteJul 6, 2025
  10. ssh signing: don't detach the filename strbuf from key_file tempfileredoste, Jul 6, 2025
  11. brian m. carlsonJul 6, 2025
  12. Patrick SteinhardtJul 7, 2025
  13. Phillip WoodJul 7, 2025
  14. redosteJul 7, 2025
  15. Phillip WoodJul 7, 2025
  16. redosteJul 7, 2025
  17. Phillip WoodJul 7, 2025
  18. ssh signing: don't detach the filename strbuf from key_file tempfileredoste, Jul 7, 2025
  19. Junio C HamanoJul 7, 2025
  20. Patrick SteinhardtJul 8, 2025
  21. Phillip WoodJul 8, 2025

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.