Skip to content

Commit

Permalink
Reset Hystrix after tests have run.
Browse files Browse the repository at this point in the history
Without the resets, running the tests more than once will fail due to
collapser instance caching behind the scenes.
  • Loading branch information
daveray committed Jul 20, 2013
1 parent 9de91ee commit cc2246a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
(ns com.netflix.hystrix.core-test
(:use com.netflix.hystrix.core)
(:require [clojure.test :refer [deftest testing is are use-fixtures]])
(:import [com.netflix.hystrix HystrixExecutable]
(:import [com.netflix.hystrix Hystrix HystrixExecutable]
[com.netflix.hystrix.strategy.concurrency HystrixRequestContext]))

; reset hystrix after each execution, for consistency and sanity
(defn reset-fixture
[f]
(try
(f)
(finally
(Hystrix/reset))))

(use-fixtures :once reset-fixture)

; wrap each test in hystrix context
(defn request-context-fixture
[f]
Expand Down

0 comments on commit cc2246a

Please sign in to comment.