Merge branch 'ds/scalar-ignore-cron-error'

Allow "scalar" to warn but continue when its periodic maintenance
feature cannot be enabled.

* ds/scalar-ignore-cron-error:
  scalar: only warn when background maintenance fails
  t921*: test scalar behavior starting maintenance
  t: allow 'scalar' in test_must_fail
This commit is contained in:
Junio C Hamano 2023-02-08 09:14:42 -08:00
commit 3fe6612d4c
4 changed files with 15 additions and 2 deletions

View File

@ -262,7 +262,7 @@ static int register_dir(void)
return error(_("could not set recommended config"));
if (toggle_maintenance(1))
return error(_("could not turn on maintenance"));
warning(_("could not turn on maintenance"));
if (have_fsmonitor_support() && start_fsmonitor_daemon()) {
return error(_("could not start the FSMonitor daemon"));

View File

@ -104,6 +104,13 @@ test_expect_success FSMONITOR_DAEMON 'scalar register starts fsmon daemon' '
test_cmp_config -C test/src true core.fsmonitor
'
test_expect_success 'scalar register warns when background maintenance fails' '
git init register-repo &&
GIT_TEST_MAINT_SCHEDULER="crontab:false,launchctl:false,schtasks:false" \
scalar register register-repo 2>err &&
grep "could not turn on maintenance" err
'
test_expect_success 'scalar unregister' '
git init vanish/src &&
scalar register vanish/src &&

View File

@ -174,4 +174,10 @@ test_expect_success 'progress without tty' '
cleanup_clone $enlistment
'
test_expect_success 'scalar clone warns when background maintenance fails' '
GIT_TEST_MAINT_SCHEDULER="crontab:false,launchctl:false,schtasks:false" \
scalar clone "file://$(pwd)/to-clone" maint-fail 2>err &&
grep "could not turn on maintenance" err
'
test_done

View File

@ -1016,7 +1016,7 @@ test_must_fail_acceptable () {
fi
case "$1" in
git|__git*|test-tool|test_terminal)
git|__git*|scalar|test-tool|test_terminal)
return 0
;;
*)