emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/cider 6ab8988996: Increase nrepl response timeout in integ


From: ELPA Syncer
Subject: [nongnu] elpa/cider 6ab8988996: Increase nrepl response timeout in integration tests
Date: Wed, 4 Jan 2023 07:58:58 -0500 (EST)

branch: elpa/cider
commit 6ab8988996e8c4aa654c758e2073c1377cbe9159
Author: ikappaki <ikappaki@users.noreply.github.com>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>

    Increase nrepl response timeout in integration tests
    
    It also removes a noise buffer from integration tests diagnostics.
---
 nrepl-client.el                            |  2 +-
 test/integration/integration-test-utils.el | 21 +++++--
 test/integration/integration-tests.el      | 89 ++++++++++++++++--------------
 3 files changed, 63 insertions(+), 49 deletions(-)

diff --git a/nrepl-client.el b/nrepl-client.el
index b0d554ed5f..36673a237a 100644
--- a/nrepl-client.el
+++ b/nrepl-client.el
@@ -951,7 +951,7 @@ If TOOLING, use the tooling session rather than the 
standard session."
                    (time-less-p
                     nrepl-sync-request-timeout
                     (time-subtract nil time0)))
-          (error "Sync nREPL request timed out %s" request)))
+          (error "Sync nREPL request timed out %s after %s secs." request 
nrepl-sync-request-timeout)))
       ;; Clean up the response, otherwise we might repeatedly ask for input.
       (nrepl-dict-put response "status" (remove "need-input" status))
       (accept-process-output nil 0.01))
diff --git a/test/integration/integration-test-utils.el 
b/test/integration/integration-test-utils.el
index ff61e3656a..ef4389618a 100644
--- a/test/integration/integration-test-utils.el
+++ b/test/integration/integration-test-utils.el
@@ -30,13 +30,22 @@
 (require 'buttercup)
 (require 'cider)
 (require 'cl-lib)
+(require 'seq)
 
 (defun cider-itu-dump-all-buffers-contents ()
-  "Print out the contents of all buffers."
-  (dolist (buff (buffer-list))
-    (message "\n:BUFFER %S" (buffer-name  buff))
-    (with-current-buffer buff
-      (message "%s\n" (buffer-substring-no-properties (point-min) 
(point-max))))))
+  "Print out the contents of all live buffers.
+
+It excludes some unrelated noisy buffers:
+
+1. Tar data buffers created by `tar-mode`."
+  (let ((filtered (seq-remove (lambda (buf)
+                          ;; created when unpacking packages
+                          (string-prefix-p " *tar-data" (buffer-name buf)))
+                        (buffer-list))))
+    (dolist (buff filtered)
+      (message "\n:BUFFER %S" (buffer-name buff))
+      (with-current-buffer buff
+        (message "%s\n" (buffer-substring-no-properties (point-min) 
(point-max)))))))
 
 (defmacro with-cider-test-sandbox (&rest body)
   "Run BODY inside sandbox, with key cider global vars restored on exit.
@@ -46,7 +55,7 @@ buffer.
 Only the following variables are currently restored, please add more as the
 test coverage increases:
 
-`cider-connected-hook`."
+1. `cider-connected-hook`."
   (declare (indent 0))
   `(let (;; for dynamic vars, just use a binding under the same name, so that
          ;; the global value is not modified.
diff --git a/test/integration/integration-tests.el 
b/test/integration/integration-tests.el
index 27e0448bd5..482fe60002 100644
--- a/test/integration/integration-tests.el
+++ b/test/integration/integration-tests.el
@@ -103,57 +103,60 @@
                (deps-edn (expand-file-name "deps.edn" project-dir)))
           (write-region "{}" nil deps-edn)
 
-          (with-temp-buffer
-            ;; set default directory to temp project
-            (setq-local default-directory project-dir)
+          (let (;; some times responses on GH CI slow runners might take more
+                ;; than the default timeout period to complete.
+                (nrepl-sync-request-timeout (+ nrepl-sync-request-timeout 10)))
 
-            (let* (;; Get a gv reference so as to poll if the client has
-                   ;; connected to the nREPL server.
-                   (client-is-connected* 
(cider-itu-nrepl-client-connected-ref-make!))
+            (with-temp-buffer
+              ;; set default directory to temp project
+              (setq-local default-directory project-dir)
 
-                   ;; jack in and get repl buffer
-                   (nrepl-proc (cider-jack-in-clj `()))
-                   (nrepl-buf (process-buffer nrepl-proc)))
+              (let* (;; Get a gv reference so as to poll if the client has
+                     ;; connected to the nREPL server.
+                     (client-is-connected* 
(cider-itu-nrepl-client-connected-ref-make!))
 
-              ;; wait until the client has successfully connected to the
-              ;; nREPL server. High duration since on windows it takes a
-              ;; long time to startup
-              (cider-itu-poll-until (eq (gv-deref client-is-connected*) 
'connected) 90)
+                     ;; jack in and get repl buffer
+                     (nrepl-proc (cider-jack-in-clj `()))
+                     (nrepl-buf (process-buffer nrepl-proc)))
 
-              ;; give it some time to setup the clj REPL
-              (cider-itu-poll-until (cider-repls 'clj nil) 90)
+                ;; wait until the client has successfully connected to the
+                ;; nREPL server. High duration since on windows it takes a
+                ;; long time to startup
+                (cider-itu-poll-until (eq (gv-deref client-is-connected*) 
'connected) 90)
 
-              ;; send command to the REPL, and push stdout/stderr to
-              ;; corresponding eval-xxx variables.
-              (let ((repl-buffer (cider-current-repl))
-                    (eval-err '())
-                    (eval-out '()))
-                (expect repl-buffer :not :to-be nil)
+                ;; give it some time to setup the clj REPL
+                (cider-itu-poll-until (cider-repls 'clj nil) 90)
 
-                ;; send command to the REPL
-                (cider-interactive-eval
-                 ;; ask REPL to return a string that uniquely identifies it.
-                 "(print :clojure? (some? (clojure-version)))"
-                 (lambda (return)
-                   (nrepl-dbind-response
-                       return
-                       (out err)
-                     (when err (push err eval-err))
-                     (when out (push out eval-out)))) )
+                ;; send command to the REPL, and push stdout/stderr to
+                ;; corresponding eval-xxx variables.
+                (let ((repl-buffer (cider-current-repl))
+                      (eval-err '())
+                      (eval-out '()))
+                  (expect repl-buffer :not :to-be nil)
 
-                ;; wait for a response to come back.
-                (cider-itu-poll-until (or eval-err eval-out) 10)
+                  ;; send command to the REPL
+                  (cider-interactive-eval
+                   ;; ask REPL to return a string that uniquely identifies it.
+                   "(print :clojure? (some? (clojure-version)))"
+                   (lambda (return)
+                     (nrepl-dbind-response
+                         return
+                         (out err)
+                       (when err (push err eval-err))
+                       (when out (push out eval-out)))) )
 
-                ;; ensure there are no errors and response is as expected.
-                (expect eval-err :to-equal '())
-                (expect eval-out :to-equal '(":clojure? true"))
+                  ;; wait for a response to come back.
+                  (cider-itu-poll-until (or eval-err eval-out) 10)
 
-                ;; exit the REPL.
-                (cider-quit repl-buffer)
+                  ;; ensure there are no errors and response is as expected.
+                  (expect eval-err :to-equal '())
+                  (expect eval-out :to-equal '(":clojure? true"))
 
-                ;; wait for the REPL to exit
-                (cider-itu-poll-until (not (eq (process-status nrepl-proc) 
'run)) 15)
-                (expect (member (process-status nrepl-proc) '(exit 
signal))))))))))
+                  ;; exit the REPL.
+                  (cider-quit repl-buffer)
+                  ;; wait for the REPL to exit
+                  (cider-itu-poll-until (not (eq (process-status nrepl-proc) 
'run)) 15)
+                  (expect (member (process-status nrepl-proc) '(exit 
signal)))))))))))
 
   (it "to leiningen"
     (with-cider-test-sandbox
@@ -292,7 +295,9 @@
             (shell-command "npm install")
             (message ":npm-install :done"))
 
-          (let ((cider-preferred-build-tool 'shadow-cljs)
+          (let (;; some times responses on GH CI slow runners might take more 
than the default
+                ;; timeout period to complete
+                (nrepl-sync-request-timeout (+ nrepl-sync-request-timeout 10))
                 ;; request for a node repl, so that shadow forks one.
                 (cider-shadow-default-options ":node-repl"))
 



reply via email to

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