FIX: Don't reuse redis connections in different threads in tests

FIX: Don’t reuse redis connections in different threads in tests

Redis connections aren’t threadsafe since they have state, (watched keys).

diff --git a/spec/components/distributed_mutex_spec.rb b/spec/components/distributed_mutex_spec.rb
index 95588c1..ddce89a 100644
--- a/spec/components/distributed_mutex_spec.rb
+++ b/spec/components/distributed_mutex_spec.rb
@@ -12,7 +12,7 @@ describe DistributedMutex do
 
   it "allows only one mutex object to have the lock at a time" do
     mutexes = (1..10).map do
-      DistributedMutex.new(key)
+      DistributedMutex.new(key, redis: DiscourseRedis.new)
     end
 
     x = 0

GitHub sha: b76a1df2

1 Like