From 3159b9dacf545134b1f85829d059123d5d71474a Mon Sep 17 00:00:00 2001 From: alesapin Date: Fri, 19 Mar 2021 21:53:09 +0300 Subject: [PATCH] Disable zookeeper logger Better --- tests/jepsen.nukeeper/src/jepsen/nukeeper/main.clj | 6 +++++- tests/jepsen.nukeeper/test/jepsen/nukeeper_test.clj | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/jepsen.nukeeper/src/jepsen/nukeeper/main.clj b/tests/jepsen.nukeeper/src/jepsen/nukeeper/main.clj index feca05d8190..b7f2bb0b98b 100644 --- a/tests/jepsen.nukeeper/src/jepsen/nukeeper/main.clj +++ b/tests/jepsen.nukeeper/src/jepsen/nukeeper/main.clj @@ -27,7 +27,9 @@ [clojure.java.io :as io] [zookeeper.data :as data] [zookeeper :as zk]) - (:import (org.apache.zookeeper ZooKeeper KeeperException KeeperException$BadVersionException))) + (:import (org.apache.zookeeper ZooKeeper KeeperException KeeperException$BadVersionException) + (ch.qos.logback.classic Level) + (org.slf4j Logger LoggerFactory))) (defn cluster-config [test node config-template] @@ -175,6 +177,8 @@ "Handles command line arguments. Can either run a test, or a web server for browsing results." [& args] + (.setLevel + (LoggerFactory/getLogger "org.apache.zookeeper") Level/OFF) (cli/run! (merge (cli/single-test-cmd {:test-fn nukeeper-test :opt-spec cli-opts}) (cli/test-all-cmd {:tests-fn (partial all-tests nukeeper-test) diff --git a/tests/jepsen.nukeeper/test/jepsen/nukeeper_test.clj b/tests/jepsen.nukeeper/test/jepsen/nukeeper_test.clj index 1981e01ebcb..db84ff33ee3 100644 --- a/tests/jepsen.nukeeper/test/jepsen/nukeeper_test.clj +++ b/tests/jepsen.nukeeper/test/jepsen/nukeeper_test.clj @@ -2,7 +2,9 @@ (:require [clojure.test :refer :all] [jepsen.nukeeper.utils :refer :all] [zookeeper :as zk] - [zookeeper.data :as data])) + [zookeeper.data :as data]) + (:import (ch.qos.logback.classic Level) + (org.slf4j Logger LoggerFactory))) (defn multicreate [conn] @@ -14,6 +16,8 @@ (deftest a-test (testing "nukeeper connection" + (.setLevel + (LoggerFactory/getLogger "org.apache.zookeeper") Level/OFF) (let [conn (zk/connect "localhost:9181" :timeout-msec 5000)] ;(println (take 10 (zk-range))) ;(multidelete conn)