emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master cfa50d3 4/5: ; Tracing for eieio-test random failur


From: Noam Postavsky
Subject: [Emacs-diffs] master cfa50d3 4/5: ; Tracing for eieio-test random failure (Bug#24503)
Date: Sun, 3 Dec 2017 15:41:03 -0500 (EST)

branch: master
commit cfa50d30f2876ca30158082e9a91d19e804a7e09
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    ; 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.
---
 test/Makefile.in                                | 10 ++++++++--
 test/lisp/emacs-lisp/eieio-tests/eieio-tests.el | 22 ++++++++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/test/Makefile.in b/test/Makefile.in
index 17ab36f..ffbb065 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -146,8 +146,14 @@ endif
        $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
 
 ## Save logs, and show logs for failed tests.
-WRITE_LOG = $(if $(and ${EMACS_HYDRA_CI}, $(findstring tramp, $@)), |& tee $@, 
> $@ 2>&1) \
-               || { STAT=$$?; cat $@; exit $$STAT; }
+WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
+ifdef EMACS_HYDRA_CI
+## On Hydra, always show logs for certain problematic tests.
+lisp/emacs-lisp/eieio-tests/eieio-tests.log \
+lisp/net/tramp-tests.log \
+lisp/url/url-tramp-test.log \
+: WRITE_LOG = 2>&1 | tee $@
+endif
 
 ifeq ($(TEST_LOAD_EL), yes)
 testloadfile = $*.el
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el 
b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index fbdb989..454f2aa 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.")
   (should (= (length (eieio-build-class-alist 'opt-test1 nil)) 2))
   (should (= (length (eieio-build-class-alist 'opt-test1 t)) 1)))
 
+(mapatoms (lambda (a)
+            (when (and (fboundp a)
+                       (string-match "\\`cl--?generic"
+                                     (symbol-name a)))
+              (trace-function-background a))))
+
 (defclass eieio--testing () ())
 
 (defmethod constructor :static ((_x eieio--testing) newname &rest _args)
   (list newname 2))
 
+(defun eieio-test-dump-trace ()
+  (message "%s" (with-current-buffer "*trace-output*"
+                  (goto-char (point-min))
+                  (while (re-search-forward "[\0-\010\013-\037]" nil t)
+                    (insert (prog1 (format "\\%03o" (char-before))
+                              (delete-char -1))))
+                  (buffer-string))))
+(eieio-test-dump-trace)
+
 (ert-deftest eieio-test-37-obsolete-name-in-constructor ()
   ;; FIXME repeated intermittent failures on hydra (bug#24503)
-  (skip-unless (not (getenv "EMACS_HYDRA_CI")))
-  (should (equal (eieio--testing "toto") '("toto" 2))))
+  (with-current-buffer "*trace-output*"
+    (erase-buffer))
+  (unwind-protect
+      (should (equal (eieio--testing "toto") '("toto" 2)))
+    (eieio-test-dump-trace)))
 
 (ert-deftest eieio-autoload ()
   "Tests to see whether reftex-auc has been autoloaded"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]