Fix aarch64 test (#1007)
This commit is contained in:
parent
4c075e07e4
commit
0f723a1e7c
4 changed files with 142 additions and 156 deletions
|
|
@ -60,6 +60,9 @@ if [ "$BABASHKA_STATIC" = "true" ]; then
|
|||
args+=("--libc=musl"
|
||||
# see https://github.com/oracle/graal/issues/3398
|
||||
"-H:CCompilerOption=-Wl,-z,stack-size=2097152")
|
||||
else
|
||||
# see https://github.com/oracle/graal/issues/3737
|
||||
args+=("-H:+StaticExecutableWithDynamicLibC")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@
|
|||
(is (instance? java.net.http.WebSocket$Builder (ws-client/websocket-builder))))
|
||||
|
||||
(deftest async-smoke-test
|
||||
(when-not (and
|
||||
(= "aarch64" (System/getenv "BABASHKA_ARCH"))
|
||||
(= "true" (System/getenv "BABASHKA_STATIC")))
|
||||
(is (= 200 (:status @(client/send-async {:uri "https://www.clojure.org" :method :get}))))))
|
||||
(is (= 200 (:status @(client/send-async {:uri "https://www.clojure.org" :method :get})))))
|
||||
|
||||
(defn ws-handler [{:keys [init] :as opts} req]
|
||||
(when init (init req))
|
||||
|
|
@ -28,9 +25,6 @@
|
|||
(try ~@body (finally (s# :timeout 100)))))
|
||||
|
||||
(deftest websockets-smoke-test
|
||||
(when-not (and
|
||||
(= "aarch64" (System/getenv "BABASHKA_ARCH"))
|
||||
(= "true" (System/getenv "BABASHKA_STATIC")))
|
||||
(with-ws-server {:on-receive #(httpkit.server/send! %1 %2)}
|
||||
(is (= "zomg websockets!"
|
||||
(let [p (promise)
|
||||
|
|
@ -46,4 +40,4 @@
|
|||
(ws-client/send "zomg websockets!"))
|
||||
(try (deref p 5000 ::timeout)
|
||||
(finally
|
||||
(ws-client/close ws)))))))))
|
||||
(ws-client/close ws))))))))
|
||||
|
|
|
|||
|
|
@ -239,19 +239,12 @@
|
|||
"HttpClient$Redirect/NEVER"
|
||||
:always
|
||||
"HttpClient$Redirect/ALWAYS")))]
|
||||
;; TODO: make graalvm repro of never-ending request with redirect always on linux aarch64 (+ musl?)
|
||||
(when-not (and (= "aarch64" (System/getenv "BABASHKA_ARCH"))
|
||||
(= "linux" (System/getenv "BABASHKA_PLATFORM")))
|
||||
(println "Testing redirect always")
|
||||
(is (= 200 (bb (redirect-prog :always)))))
|
||||
(is (= 200 (bb (redirect-prog :always))))
|
||||
(println "Testing redirect never")
|
||||
(is (= 302 (bb (redirect-prog :never))))))
|
||||
|
||||
(deftest ssl-context-test
|
||||
;; TODO: investigate aarch64 issue
|
||||
(when-not
|
||||
(and (= "aarch64" (System/getenv "BABASHKA_ARCH"))
|
||||
(= "linux" (System/getenv "BABASHKA_PLATFORM")))
|
||||
(is (= {:expired "java.security.cert.CertificateExpiredException"
|
||||
:revoked 200 ;; TODO: fix, "sun.security.cert.CertificateRevokedException"
|
||||
:self-signed "sun.security.provider.certpath.SunCertPathBuilderException"
|
||||
|
|
@ -336,7 +329,7 @@
|
|||
(map (fn [[k req]]
|
||||
[k (-> (.send client req handler)
|
||||
(.statusCode))]))
|
||||
(into {})))))))))
|
||||
(into {}))))))))
|
||||
|
||||
;; HttpRequest
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@
|
|||
(timbre/swap-config! (constantly old-config))))
|
||||
|
||||
(deftest logging-test
|
||||
(when-not (and (= "true" (System/getenv "BABASHKA_STATIC"))
|
||||
(= "aarch64" (System/getenv "BABASHKA_ARCH")))
|
||||
(let [res (tu/bb nil (pr-str program))]
|
||||
(is (= 17 (count (re-seq #"\[dude:.\]" res))))
|
||||
(is (= 6 (count (re-seq #"DEBUG" res))))
|
||||
|
|
@ -74,7 +72,7 @@
|
|||
nil
|
||||
program)
|
||||
res (slurp temp-file)]
|
||||
(is (str/includes? res "hello"))))))
|
||||
(is (str/includes? res "hello")))))
|
||||
|
||||
(def readable-prog
|
||||
'(do
|
||||
|
|
@ -103,8 +101,6 @@
|
|||
(timbre/set-level! :debug)))
|
||||
|
||||
(deftest readable-logging-test
|
||||
(when-not (and (= "true" (System/getenv "BABASHKA_STATIC"))
|
||||
(= "aarch64" (System/getenv "BABASHKA_ARCH")))
|
||||
(let [res (tu/bb nil (pr-str readable-prog))]
|
||||
(testing "spied value is returned and printed (and printed from println even though spyf level isn't enabled)"
|
||||
(is (= 5 (count (re-seq #"abc,def,ghi" res)))))
|
||||
|
|
@ -113,4 +109,4 @@
|
|||
(testing "strings logged are printed readably"
|
||||
(is (= 3 (count (re-seq #"\"test warn\"" res)))))
|
||||
(testing "lists are printed readably"
|
||||
(is (= 2 (count (re-seq #"\(\\a \\b\)" res))))))))
|
||||
(is (= 2 (count (re-seq #"\(\\a \\b\)" res)))))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue