joaotavora / yasnippet

A template system for Emacs
http://joaotavora.github.io/yasnippet/
2.81k stars 311 forks source link

delete-numberless-inner-snippet-issue-562 test failure (non-deterministic) #1185

Closed Apteryks closed 10 months ago

Apteryks commented 10 months ago

Hi,

The following test failure was reported by the GNU Guix CI in https://ci.guix.gnu.org/build/3341166/details, with output:

starting phase `check'
Running 89 tests (2024-01-21 11:07:22+0000, selector ‘t’)
   failed   1/89  another-example-for-issue-271 (0.000541 sec)
   passed   2/89  auto-fill-with-multiparagraph (0.000729 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed   3/89  auto-next-field (0.028592 sec)
   passed   4/89  basic-indentation (0.001848 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed   5/89  basic-jit-loading (0.104532 sec)

[yas] Prepared just-in-time loading of snippets successfully.
[yas] Prepared just-in-time loading of snippets successfully.

   passed   6/89  basic-jit-loading-with-compiled-snippets (0.061486 sec)
   passed   7/89  be-careful-when-escaping-in-yas-selected-text (0.000598 sec)
   passed   8/89  be-careful-when-escaping-in-yas-selected-text-2 (0.000305 sec)

[yas] Prepared just-in-time loading of snippets successfully.
[yas] Error in condition evaluation: Symbol’s value as variable is void: yas--barbaz

   passed   9/89  complicated-yas-key-syntaxes (0.026154 sec)
   passed  10/89  deep-nested-mirroring-issue-351 (0.003190 sec)
   passed  11/89  delete-nested-simple-field-issue-824 (0.000644 sec)
Test delete-numberless-inner-snippet-issue-562 backtrace:
  signal(ert-test-failed (((should (looking-at "blable")) :form (looki
  ert-fail(((should (looking-at "blable")) :form (looking-at "blable")
  (if (unwind-protect (setq value-127 (apply fn-125 args-126)) (setq f
  (let (form-description-129) (if (unwind-protect (setq value-127 (app
  (let ((value-127 'ert-form-evaluation-aborted-128)) (let (form-descr
  (let* ((fn-125 #'looking-at) (args-126 (condition-case err (let ((si
  (progn (yas-minor-mode 1) (yas-expand-snippet "${3:${test}bla}$0${2:
  (unwind-protect (progn (yas-minor-mode 1) (yas-expand-snippet "${3:$
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current
  (closure (t) nil (let ((temp-buffer (generate-new-buffer " *temp*" t
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name delete-numberless-inner-snippet-issue
  ert-run-or-rerun-test(#s(ert--stats :selector t :tests ... :test-map
  ert-run-tests(t #f(compiled-function (event-type &rest event-args) #
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-l" "yasnippet-tests.el" "-f" "ert-run-tests-batch-
  command-line()
  normal-top-level()
Test delete-numberless-inner-snippet-issue-562 condition:
    (ert-test-failed
     ((should
       (looking-at "blable"))
      :form
      (looking-at "blable")
      :value nil))
   FAILED  12/89  delete-numberless-inner-snippet-issue-562 (0.000667 sec) at yasnippet-tests.el:284
Mark set
   passed  13/89  do-clear-on-yank-issue-515 (0.000733 sec)
   passed  14/89  dont-clear-on-partial-deletion-issue-515 (0.000597 sec)
   passed  15/89  escape-backquotes (0.000277 sec)
   passed  16/89  escape-backslashes (0.000221 sec)
   passed  17/89  escape-closing-brace (0.000297 sec)
   passed  18/89  escape-dollar (0.000229 sec)
   passed  19/89  escape-some-elisp-with-backslashes (0.000246 sec)
   passed  20/89  escape-some-elisp-with-strings (0.000267 sec)
   passed  21/89  escaping-for-lsp-style-snippet-syntax (0.000575 sec)
   passed  22/89  example-for-issue-271 (0.000713 sec)
   passed  23/89  example-for-issue-404 (0.002963 sec)
   passed  24/89  example-for-issue-404-c-mode (0.001773 sec)
   passed  25/89  example-for-issue-474 (0.001720 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  26/89  expand-with-unused-yas-selected-text (0.028632 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  27/89  extra-modes-parenthood (0.023518 sec)
   passed  28/89  field-navigation (0.000643 sec)
   passed  29/89  ignore-trailing-whitespace (0.000113 sec)
   passed  30/89  indent-cc-mode (0.028976 sec)
   passed  31/89  indent-cc-mode-2 (0.001871 sec)
   passed  32/89  indent-mirrors-on-complex-update (0.002898 sec)
   passed  33/89  indent-mirrors-on-update (0.001559 sec)
   passed  34/89  indent-org-property (0.332249 sec)
   passed  35/89  indent-snippet-mode (0.001233 sec)
   passed  36/89  indentation-markers (0.000657 sec)
   passed  37/89  insert-snippet-with-backslashes-in-active-field (0.000467 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  38/89  issue-492-and-494 (0.002355 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  39/89  issue-504-tricky-jit (0.005388 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  40/89  loading-with-cyclic-parenthood (0.032091 sec)
   passed  41/89  middle-of-buffer-snippet-insertion (0.000273 sec)
   passed  42/89  mirror-with-transformation (0.001237 sec)
   passed  43/89  mirror-with-transformation-and-autofill (0.029586 sec)
   passed  44/89  mirrors-adjacent-to-fields-with-nested-mirrors (0.004681 sec)
   passed  45/89  nested-placeholders-kill-superfield (0.000572 sec)
   passed  46/89  nested-placeholders-use-subfield (0.000581 sec)
   passed  47/89  nested-snippet-expansion-1 (0.000446 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  48/89  nested-snippet-expansion-2 (0.007787 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  49/89  nested-snippet-expansion-3 (0.008749 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  50/89  nested-snippet-expansion-4 (0.005055 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  51/89  nested-snippet-expansion-5-nested-delete (0.005309 sec)
   passed  52/89  primary-field-transformation (0.001286 sec)
   failed  53/89  protection-overlay-no-cheating (0.000405 sec)
   passed  54/89  simple-mirror (0.001024 sec)
   passed  55/89  single-line-multi-mirror-indentation (0.000753 sec)
   passed  56/89  single-line-multi-mirror-indentation-2 (0.005239 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  57/89  snippet-exit-hooks (0.033500 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  58/89  snippet-exit-hooks-bindings (0.031026 sec)
   passed  59/89  snippet-load-uuid (0.029269 sec)

[yas] Snippets loaded successfully.

   passed  60/89  snippet-lookup (0.044566 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  61/89  snippet-mirror-bindings (0.031209 sec)

[yas] Snippet "foo" loaded for .
[yas] Snippet "foo" loaded for .
[yas] Snippet "bar" loaded for .
[yas] Snippet "bar" loaded for .

   passed  62/89  snippet-save (0.032142 sec)
   passed  63/89  snippet-with-multiline-mirrors-issue-665 (0.010564 sec)
   passed  64/89  string-match-with-subregexp-in-embedded-elisp (0.000259 sec)
   passed  65/89  string-match-with-subregexp-in-mirror-transformations (0.002536 sec)

[yas] Don't know anything about menu entry yas-ignore-item
[yas] Snippets loaded successfully.

   passed  66/89  test-group-menus (0.043339 sec)

[yas] Don't know anything about menu entry yas-ignore-item
[yas] Snippets loaded successfully.
[yas] Don't know anything about menu entry yas-ignore-item
[yas] Snippets loaded successfully.
[yas] Don't know anything about menu entry yas-ignore-item
[yas] Snippets loaded successfully.

   passed  67/89  test-group-menus-twisted (0.067435 sec)
[yas] Prepared just-in-time loading of snippets (but no snippets found).
   passed  68/89  test-rebindings (0.000628 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  69/89  test-yas-activate-extra-modes (0.034754 sec)

[yas] Don't know anything about menu entry yas-ignore-item
[yas] Snippets loaded successfully.

   passed  70/89  test-yas-define-menu (0.043084 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  71/89  test-yas-in-org (0.030838 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  72/89  test-yas-tab-binding (0.029548 sec)

[yas] Prepared just-in-time loading of snippets successfully.
Undo

   passed  73/89  undo-indentation-1 (0.004765 sec)

[yas] Prepared just-in-time loading of snippets successfully.
Undo

   passed  74/89  undo-indentation-2 (0.004567 sec)

[yas] Prepared just-in-time loading of snippets successfully.
Undo

   passed  75/89  undo-indentation-multiline-1 (0.016091 sec)

[yas] Prepared just-in-time loading of snippets successfully.
Undo

   passed  76/89  undo-indentation-multiline-2 (0.005436 sec)

[yas] Prepared just-in-time loading of snippets successfully.
Undo
Undo
Redo

   passed  77/89  undo-redo (0.004500 sec)

[yas] Prepared just-in-time loading of snippets successfully.
Undo

   passed  78/89  undo-revive-and-do-again (0.004810 sec)

[yas] Snippets loaded successfully.

   passed  79/89  visiting-compiled-snippets (0.102670 sec)
   passed  80/89  yas-also-indent-empty-lines (0.001033 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  81/89  yas-expand-command-snippet (0.004041 sec)
   passed  82/89  yas-indent-first-line (0.000566 sec)
   passed  83/89  yas-indent-first-line-fixed (0.000474 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  84/89  yas-lookup-snippet-with-env (0.004073 sec)
   passed  85/89  yas-mirror-many-fields (0.002635 sec)
   passed  86/89  yas-no-memory-of-bad-snippet (0.000380 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  87/89  yas-org-native-tab-in-source-block-emacs-lisp (0.037143 sec)

[yas] Prepared just-in-time loading of snippets successfully.

   passed  88/89  yas-org-native-tab-in-source-block-text (0.039264 sec)
   passed  89/89  yas-unload (0.235414 sec)

Ran 89 tests, 88 results as expected, 1 unexpected (2024-01-21 11:07:24+0000, 1.799397 sec)
2 expected failures

1 unexpected results:
   FAILED  delete-numberless-inner-snippet-issue-562
monnier commented 10 months ago

Test delete-numberless-inner-snippet-issue-562 condition: (ert-test-failed ((should (looking-at "blable")) :form (looking-at "blable") :value nil))

Hmm... I can't see any (looking-at "blable") in the yasnippet-tests.el file. Neither in master nor in 0.14.0, so I have no idea where this comes from.

Apteryks commented 10 months ago

Hm, on my side:

$ grep -rin blable /gnu/store/majhq681xa00sxyhpnqs4xl8q597gb99-emacs-yasnippet-0.14.0-checkout
/gnu/store/majhq681xa00sxyhpnqs4xl8q597gb99-emacs-yasnippet-0.14.0-checkout/yasnippet-tests.el:289:    (should (looking-at "testblable"))
/gnu/store/majhq681xa00sxyhpnqs4xl8q597gb99-emacs-yasnippet-0.14.0-checkout/yasnippet-tests.el:292:    (should (looking-at "blable"))
Apteryks commented 10 months ago

Ah, the ble -> blabe is caused by a patch carried in GNU Guix named "emacs-yasnippet-fix-tests.patch". I'll experiment without them or update to master.

Apteryks commented 10 months ago

A new tag would be nice, but in the meantime I bumped the package to its latest commit and dropped that old patch.

monnier commented 10 months ago

Ha, it didn't occur to me that you'd have such a patch. I was looking through the history and searching through the macros trying to figure out how on earth you ended up with that code :-)

Apteryks commented 10 months ago

Ah! Apologies for the confusion! Thanks for looking at my report!