 
 (defn- redis-backed-tests*
   [async?]
-  (let [db-config  {:pool {} :spec {:uri "redis://localhost:6379/"}}
+  (let [ip @docker-default-machine-ip
+        db-config  {:pool {}
+                    :spec {:uri (str "redis://" ip ":6379/")}} ;; localhost won't work on the mac
         key-name "atom:state"
         init {:x 1 :y 2}
         key-exists? #(ut/redis-key-exists? db-config key-name)


(defn- postgres-backed-tests*
  [async?]
  (let [db-spec {:classname   "org.postgresql.Driver"
                 :subprotocol "postgresql"
                 :subname     "//localhost:5432/atomDB"
                 :user        "dimitris"
                 :password    "secret"}
        table-name "atom_state"

            [duratom.core :refer :all]
            [duratom.utils :as ut]
            [taoensso.nippy :as nippy]
            [clojure.java
             [shell :as shell]
             [io :as io]]
            [clojure.string :as str])
  (:import (clojure.lang Agent)))

(defonce docker-default-machine-ip
  ;; `localhost` which works on Ubuntu simply won't work on MacOS.
  ;; we need the public IP of the docker-machine - `default` in this case.
  ;; this tends to be 192.168.99.100, but we can easily check via `docker-machine ip default`
  (delay
    (or (try
          (some-> (shell/sh "docker-machine" "ip" "default")
                  :out
                  str/trim-newline)
          (catch Throwable _))
        ;; per https://devilbox.readthedocs.io/en/latest/howto/docker-toolbox/find-docker-toolbox-ip-address.html
        "192.168.99.100")))

(defn- common*
  [dura exists? async?]
