Skip to content

Commit

Permalink
Added a reset of Hystrix.currentCommand to Hystrix.reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Jacobs committed Jan 14, 2015
1 parent ff0dd95 commit 07ae6d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private static void _reset() {
HystrixCircuitBreaker.Factory.reset();
HystrixPlugins.reset();
HystrixPropertiesFactory.reset();
currentCommand.set(new LinkedList<HystrixCommandKey>());
}

private static ThreadLocal<LinkedList<HystrixCommandKey>> currentCommand = new ThreadLocal<LinkedList<HystrixCommandKey>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

import com.netflix.hystrix.HystrixCommand.Setter;
import com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStrategy;

public class HystrixTest {
@Before
public void reset() {
Hystrix.reset();
}

@Test
public void testNotInThread() {
assertNull(Hystrix.getCurrentThreadExecutingCommand());
Expand Down

0 comments on commit 07ae6d2

Please sign in to comment.