aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-11-30 20:51:07 -0500
committerNoam Postavsky2017-12-03 15:39:02 -0500
commitcfa50d30f2876ca30158082e9a91d19e804a7e09 (patch)
treeabca833b43f9194d6fa0c8fb0410db91da768d7f
parent6e0008890ffcfdcd0a8fc827c7108907bfb25d0a (diff)
downloademacs-cfa50d30f2876ca30158082e9a91d19e804a7e09.tar.gz
emacs-cfa50d30f2876ca30158082e9a91d19e804a7e09.zip
; Tracing for eieio-test random failure (Bug#24503)
* test/Makefile.in [EMACS_HYDRA_CI]: Always show log for eieio-tests. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (top-level): Trace cl-generic functions. (eieio-test-dump-trace): New function. (eieio-test-37-obsolete-name-in-constructor): Use it.
-rw-r--r--test/Makefile.in10
-rw-r--r--test/lisp/emacs-lisp/eieio-tests/eieio-tests.el22
2 files changed, 28 insertions, 4 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 17ab36f5af5..ffbb065ec69 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -146,8 +146,14 @@ endif
146 $(AM_V_ELC)$(emacs) -f batch-byte-compile $< 146 $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
147 147
148## Save logs, and show logs for failed tests. 148## Save logs, and show logs for failed tests.
149WRITE_LOG = $(if $(and ${EMACS_HYDRA_CI}, $(findstring tramp, $@)), |& tee $@, > $@ 2>&1) \ 149WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
150 || { STAT=$$?; cat $@; exit $$STAT; } 150ifdef EMACS_HYDRA_CI
151## On Hydra, always show logs for certain problematic tests.
152lisp/emacs-lisp/eieio-tests/eieio-tests.log \
153lisp/net/tramp-tests.log \
154lisp/url/url-tramp-test.log \
155: WRITE_LOG = 2>&1 | tee $@
156endif
151 157
152ifeq ($(TEST_LOAD_EL), yes) 158ifeq ($(TEST_LOAD_EL), yes)
153testloadfile = $*.el 159testloadfile = $*.el
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index fbdb9896a40..454f2aaca0e 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
@@ -887,15 +887,33 @@ Subclasses to override slot attributes.")
887 (should (= (length (eieio-build-class-alist 'opt-test1 nil)) 2)) 887 (should (= (length (eieio-build-class-alist 'opt-test1 nil)) 2))
888 (should (= (length (eieio-build-class-alist 'opt-test1 t)) 1))) 888 (should (= (length (eieio-build-class-alist 'opt-test1 t)) 1)))
889 889
890(mapatoms (lambda (a)
891 (when (and (fboundp a)
892 (string-match "\\`cl--?generic"
893 (symbol-name a)))
894 (trace-function-background a))))
895
890(defclass eieio--testing () ()) 896(defclass eieio--testing () ())
891 897
892(defmethod constructor :static ((_x eieio--testing) newname &rest _args) 898(defmethod constructor :static ((_x eieio--testing) newname &rest _args)
893 (list newname 2)) 899 (list newname 2))
894 900
901(defun eieio-test-dump-trace ()
902 (message "%s" (with-current-buffer "*trace-output*"
903 (goto-char (point-min))
904 (while (re-search-forward "[\0-\010\013-\037]" nil t)
905 (insert (prog1 (format "\\%03o" (char-before))
906 (delete-char -1))))
907 (buffer-string))))
908(eieio-test-dump-trace)
909
895(ert-deftest eieio-test-37-obsolete-name-in-constructor () 910(ert-deftest eieio-test-37-obsolete-name-in-constructor ()
896 ;; FIXME repeated intermittent failures on hydra (bug#24503) 911 ;; FIXME repeated intermittent failures on hydra (bug#24503)
897 (skip-unless (not (getenv "EMACS_HYDRA_CI"))) 912 (with-current-buffer "*trace-output*"
898 (should (equal (eieio--testing "toto") '("toto" 2)))) 913 (erase-buffer))
914 (unwind-protect
915 (should (equal (eieio--testing "toto") '("toto" 2)))
916 (eieio-test-dump-trace)))
899 917
900(ert-deftest eieio-autoload () 918(ert-deftest eieio-autoload ()
901 "Tests to see whether reftex-auc has been autoloaded" 919 "Tests to see whether reftex-auc has been autoloaded"