Subject: bug#76187: closed (Re: bug#76187: vc-git-test-dir-branch-headers failure on Fedora)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 17 Feb 2025 21:12:01 +0000

Your bug report

#76187: vc-git-test-dir-branch-headers failure on Fedora

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76187: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76187
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#76187: vc-git-test-dir-branch-headers failure on Fedora
From: Kévin Le Gouguec <[email-masked]>
To: Dmitry Gutov <[email-masked]>
Cc: [email-masked], Eli Zaretskii <[email-masked]>, Paul Eggert <[email-masked]>
Date: Mon, 17 Feb 2025 22:11:02 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Dmitry Gutov <[email-masked]> writes:

>> Paul Eggert<[email-masked]> writes:
>> 
>>> On 2025-02-15 14:17, Kévin Le Gouguec wrote:
>>>> Either fixes the issue, as far as I can validate.  I still have a slight
>>>> preference for the second one
>>> ... and the second one tests faster, so that's a good argument for going with it.
>> Right.
>> Waiting on Dmitry's thoughts before installing; OT1H I have no qualms
>> about this testcase invoking backend functions directly (just noticed
>> that there is a precedent, e.g. vc-git-test-annotate-time), OTOH maybe
>> this is not a practice we want to encourage.
>
> Thanks for the investigation, and I agree that the patch that "ditches vc-dir entirely" is TRT.
>
> The vc-<backend>-tests.el files are supposed (or at least are allowed) to test backend-specific functionality.

Thanks for weighing in on this!  I therefore installed the patch that
invokes vc-git-dir-extra-headers directly.  Boldly closing this now.

> We currently call vc-dir from vc-bzr-tests as well (helps with code coverage) - which BTW has this workaround:
>
>       (while (vc-dir-busy)
>         (sit-for 0.1))

(🤦 Would that I had thought of grepping the tests for vc-dir(-busy),
instead of reinventing the square wheel and wasting everyone's time…)

Subject: vc-git-test-dir-branch-headers failure on Fedora
From: Paul Eggert <[email-masked]>
To: Emacs bug reports <[email-masked]>
Date: Mon, 10 Feb 2025 14:58:31 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On Fedora 41 x86-64 with the current Emacs master (commit 
4936a8d5acbfee2dee6d903400eba48cb2e3a6a7) I occasionally see failures of 
the vc-git-test-dir-branch-headers test. Usually it works. Here are the 
two failures I've seen.

The first was with a "make -j5 check" so it may have been a collision 
with some other test:

>   GEN      lisp/vc/ediff-diff-tests.log
>   GEN      lisp/vc/ediff-ptch-tests.log
>   GEN      lisp/vc/log-edit-tests.log
>   GEN      lisp/vc/smerge-mode-tests.log
>   GEN      lisp/vc/vc-bzr-tests.log
>   GEN      lisp/vc/vc-cvs-tests.log
>   GEN      lisp/vc/vc-git-tests.log
>   GEN      lisp/vc/vc-hg-tests.log
>   GEN      lisp/vc/vc-tests.log
>   GEN      lisp/version-tests.log
>   GEN      lisp/wdired-tests.log
>   GEN      lisp/which-key-tests.log
>   GEN      lisp/whitespace-tests.log
>   ELC+ELN  lisp/wid-edit-tests.elc
> Running 8 tests (2025-02-10 14:40:44-0800, selector `(not (or (tag :expensive-test) (tag :unstable)))')
>    passed  1/8  vc-git-test-annotate-time (0.006682 sec)
> Test vc-git-test-dir-branch-headers backtrace:
>   signal(error ("Failed (status 128): git --no-pager checkout -b featu
>   error("Failed (%s): %s" "status 128" "git --no-pager checkout -b fea
>   vc-do-command(t 0 "git" nil "--no-pager" "checkout" "-b" "feature/fo
>   apply(vc-do-command t 0 "git" nil "--no-pager" ("checkout" "-b" "fea
>   vc-git-command(t 0 nil "checkout" "-b" "feature/foo" "master")
>   apply(vc-git-command t 0 nil ("checkout" "-b" "feature/foo" "master"
>   vc-git-test--run("checkout" "-b" "feature/foo" "master")
>   #f(compiled-function () #<bytecode 0xca76da6649814e1>)()
>   #f(compiled-function () #<bytecode 0xf56a36e7feeaf22>)()
>   handler-bind-1(#f(compiled-function () #<bytecode 0xf56a36e7feeaf22>
>   ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
>   ert-run-test(#s(ert-test :name vc-git-test-dir-branch-headers :docum
>   ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
>   ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
>   ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
>   ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
>   eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
>   command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
>   command-line()
>   normal-top-level()
> Test vc-git-test-dir-branch-headers condition:
>     (error
>      "Failed (status 128): git --no-pager checkout -b feature/foo master .")
>    FAILED  2/8  vc-git-test-dir-branch-headers (0.349513 sec) at lisp/vc/vc-git-tests.el:146
>    passed  3/8  vc-git-test-program-version-apple (0.000109 sec)
>    passed  4/8  vc-git-test-program-version-general (0.000061 sec)
>    passed  5/8  vc-git-test-program-version-invalid-leading-dot (0.000059 sec)
>    passed  6/8  vc-git-test-program-version-invalid-leading-string (0.000052 sec)
>    passed  7/8  vc-git-test-program-version-other (0.000088 sec)
>    passed  8/8  vc-git-test-program-version-windows (0.000060 sec)
> 
> Ran 8 tests, 7 results as expected, 1 unexpected (2025-02-10 14:40:45-0800, 0.544882 sec)
> 
> 1 unexpected results:
>    FAILED  vc-git-test-dir-branch-headers
> 
> make[3]: *** [Makefile:185: lisp/vc/vc-git-tests.log] Error 1
>   GEN      lisp/x-dnd-tests.log
>   GEN      lisp/xdg-tests.log

The second failure was with "make lisp/vc/vc-git-tests" in the test 
directory. I repeatedly ran that test, and it failed on the 20th 
execution as follows:

> make[1]: Entering directory '/home/eggert/src/gnu/emacs/static-checking/test'
>   GEN      lisp/vc/vc-git-tests.log
> Running 8 tests (2025-02-10 14:50:43-0800, selector `(not (tag :unstable))')
>    passed  1/8  vc-git-test-annotate-time (0.006192 sec)
> Test vc-git-test-dir-branch-headers backtrace:
>   signal(error ("Failed (status 128): git --no-pager checkout -b featu
>   error("Failed (%s): %s" "status 128" "git --no-pager checkout -b fea
>   vc-do-command(t 0 "git" nil "--no-pager" "checkout" "-b" "feature/ba
>   apply(vc-do-command t 0 "git" nil "--no-pager" ("checkout" "-b" "fea
>   vc-git-command(t 0 nil "checkout" "-b" "feature/bar" "--track" "mast
>   apply(vc-git-command t 0 nil ("checkout" "-b" "feature/bar" "--track
>   (progn (apply 'vc-git-command t 0 nil args) (buffer-string))
>   (unwind-protect (progn (apply 'vc-git-command t 0 nil args) (buffer-
>   (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
>   (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current
>   vc-git-test--run("checkout" "-b" "feature/bar" "--track" "master")
>   (progn (vc-git-test--run "clone" origin-repo clone-repo) (vc-dir clo
>   (unwind-protect (progn (vc-git-test--run "clone" origin-repo clone-r
>   (let* ((coding-system-for-write nil) (temp-file (file-name-as-direct
>   (let ((main-branch (vc-git-test--start-branch))) (let* ((coding-syst
>   (let ((default-directory origin-repo) (process-environment (append '
>   (progn (let ((default-directory origin-repo) (process-environment (a
>   (unwind-protect (progn (let ((default-directory origin-repo) (proces
>   (let* ((coding-system-for-write nil) (temp-file (file-name-as-direct
>   #f(lambda () [t] (let* ((fn-25 #'executable-find) (args-26 (conditio
>   #f(compiled-function () #<bytecode 0x97dde0d98f0ae9a>)()
>   handler-bind-1(#f(compiled-function () #<bytecode 0x97dde0d98f0ae9a>
>   ert--run-test-internal(#s(ert--test-execution-info :test ... :result
>   ert-run-test(#s(ert-test :name vc-git-test-dir-branch-headers :docum
>   ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
>   ert-run-tests((not (tag :unstable)) #f(compiled-function (event-type
>   ert-run-tests-batch((not (tag :unstable)))
>   ert-run-tests-batch-and-exit((not (tag :unstable)))
>   eval((ert-run-tests-batch-and-exit '(not (tag :unstable))) t)
>   command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
>   command-line()
>   normal-top-level()
> Test vc-git-test-dir-branch-headers condition:
>     (error
>      "Failed (status 128): git --no-pager checkout -b feature/bar --track master .")
>    FAILED  2/8  vc-git-test-dir-branch-headers (0.316582 sec) at lisp/vc/vc-git-tests.el:146
>    passed  3/8  vc-git-test-program-version-apple (0.000139 sec)
>    passed  4/8  vc-git-test-program-version-general (0.000085 sec)
>    passed  5/8  vc-git-test-program-version-invalid-leading-dot (0.000079 sec)
>    passed  6/8  vc-git-test-program-version-invalid-leading-string (0.000114 sec)
>    passed  7/8  vc-git-test-program-version-other (0.000076 sec)
>    passed  8/8  vc-git-test-program-version-windows (0.000075 sec)
> 
> Ran 8 tests, 7 results as expected, 1 unexpected (2025-02-10 14:50:44-0800, 0.508602 sec)
> 
> 1 unexpected results:
>    FAILED  vc-git-test-dir-branch-headers
> 
> make[1]: *** [Makefile:185: lisp/vc/vc-git-tests.log] Error 1
> make[1]: Leaving directory '/home/eggert/src/gnu/emacs/static-checking/test'
> make: *** [Makefile:251: lisp/vc/vc-git-tests] Error 2