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

Re: [PATCH 3/3] scalar: only warn when background maintenance fails

From
Derrick Stolee <derrickstolee@github.com>
Date
Jan 27, 2023, 22:14 UTC
Message-ID
<7070bd26-3020-5a17-2f51-2df9ae00df8c@github.com>
In-Reply-To
<65b1735b-7ea6-5f7c-e1d9-6c986c7beb1d@github.com>
On 1/27/2023 5:06 PM, Victoria Dye wrote:
Show 8 quoted lines
> Derrick Stolee via GitGitGadget wrote:
>>  	if (toggle_maintenance(1))
>> -		return error(_("could not turn on maintenance"));
>> +		warning(_("could not turn on maintenance"));
> 
> Should we do the same thing for 'unregister_dir()'? Unlike 'register_dir()',
> it doesn't break immediately (and finishes removing the enlistment), but it
> still returns a nonzero error code from 'scalar unregister'.

The interesting thing about unregister_dir() is that toggle_maintenance(0) "turns of maintenance" by removing the maintenance.repo config value pointing to this repository, not by removing the maintenance schedule. Thus, we don't get the failure in the same way.

Show 10 quoted lines
>> -test_expect_success 'scalar clone fails when background maintenance fails' '
>> +test_expect_success 'scalar clone warns when background maintenance fails' '
>>  	GIT_TEST_MAINT_SCHEDULER="crontab:false,launchctl:false,schtasks:false" \
>> -		test_must_fail scalar clone "file://$(pwd)/to-clone" maint-fail 2>err &&
>> +		scalar clone "file://$(pwd)/to-clone" maint-fail 2>err &&
>>  	grep "could not turn on maintenance" err
>>  '
> 
> Similarly, it might be nice to show how 'scalar unregister' behaves when
> maintenance fails in the tests.
 
And the way I found out was by making the same tests, but since
they actually never failed or listed a warning (for this reason)
I left it out.

Thanks, -Stolee

Previous: Victoria DyeNext: Derrick Stolee via GitGitGadget
Message 14 of 16 in “Allow scalar to succeed despite maintenance failures”
  1. 0/3 Allow scalar to succeed despite maintenance failuresDerrick Stolee via GitGitGadget, Jan 27, 2023
  2. 3/3 scalar: only warn when background maintenance failsDerrick Stolee via GitGitGadget, Jan 27, 2023
  3. Junio C HamanoJan 27, 2023
  4. Derrick StoleeJan 27, 2023
  5. Junio C HamanoJan 28, 2023
  6. Derrick StoleeJan 30, 2023
  7. Junio C HamanoJan 30, 2023
  8. Victoria DyeJan 30, 2023
  9. Junio C HamanoJan 30, 2023
  10. Derrick StoleeJan 30, 2023
  11. Victoria DyeJan 27, 2023
  12. Derrick StoleeJan 30, 2023
  13. Victoria DyeJan 27, 2023
  14. Derrick StoleeJan 27, 2023
  15. 2/3 t921*: test scalar behavior starting maintenanceDerrick Stolee via GitGitGadget, Jan 27, 2023
  16. 1/3 t: allow 'scalar' in test_must_failDerrick Stolee via GitGitGadget, Jan 27, 2023

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.