Skip to content

Commit

Permalink
Use dorun (map .. instead of unused-ret-val (vmap ... and util/sp…
Browse files Browse the repository at this point in the history
…y instead of dprint.
  • Loading branch information
stevana committed Apr 22, 2020
1 parent 6c5a32f commit f34b363
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions jepsen/src/jepsen/generator/interpreter.clj
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
(do (doseq [[thread queue] invocations]
(.put ^ArrayBlockingQueue queue {:type :exit}))
; Wait for exit
(util/discard-ret-val (mapv (comp deref :future) workers))
(dorun (map (comp deref :future) workers))
(persistent! history)))

; Nothing we can do right now. Let's try to complete something.
Expand Down Expand Up @@ -268,7 +268,7 @@
; We only try to cancel each worker *once*--if we try to cancel
; multiple times, we might interrupt a worker while it's in the finally
; block, cleaning up its client.
(util/discard-ret-val (mapv (comp future-cancel :future) workers))
(dorun (map (comp future-cancel :future) workers))
; If for some reason *that* doesn't work, we ask them all to exit via
; their queue.
(loop [unfinished workers]
Expand Down
10 changes: 3 additions & 7 deletions jepsen/src/jepsen/os/centos.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Common tasks for CentOS boxes."
(:require [clojure.set :as set]
[clojure.tools.logging :refer [info]]
[jepsen.util :refer [meh]]
[jepsen.util :as u]
[jepsen.os :as os]
[jepsen.control :as c]
[jepsen.control.util :as cu]
Expand Down Expand Up @@ -43,10 +43,6 @@
(catch Exception e
(update!))))

(defmacro dprint [x]
`((fn [x#] ; XXX: 'Could not resolve var: do
x#) ~x))

(defn installed
"Given a list of centos packages (strings, symbols, keywords, etc), returns
the set of packages which are installed, as strings."
Expand All @@ -58,7 +54,7 @@
(map (comp second (partial re-find #"(.*)\.[^\-]+")))
set
((partial clojure.set/intersection pkgs))
dprint)))
u/spy)))

(defn uninstall!
"Removes a package or packages."
Expand Down Expand Up @@ -155,7 +151,7 @@

(if (not= true (installed-start-stop-daemon?)) (install-start-stop-daemon!) (info "start-stop-daemon already installed"))

(meh (net/heal! (:net test) test)))
(u/meh (net/heal! (:net test) test)))

(teardown! [_ test node]))

Expand Down

0 comments on commit f34b363

Please sign in to comment.