Closed mikecmpbll closed 2 years ago
should close #277 i think.
Any tips to implement this until this is merged?
Any tips to implement this until this is merged?
you can stick this monkey patch in config/initializers/
module ActsAsTenant
def self.test_tenant=(tenant)
Thread.current[:test_tenant] = tenant
end
def self.test_tenant
Thread.current[:test_tenant]
end
end
Thanks a lot for this @mikecmpbll. That makes perfect sense and I'm pretty sure I ran into the same issue before.
At the moment test_tenant causes problems for system tests which run the server and the test in separate threads. By using Thread.current we get different test_tenant per thread.
This should also enable parrallel tests in threads.