Closed YannisMarios closed 7 years ago
Why are you draining every time? If you don't it should work no?
So when should i drain? I mean ok in these tests I could write a method to drain the pool like this...
after(async () => { role.drainPool(); });
But when this goes in production when should I drain the pool?
Let's say this API class instance makes writes to the database...drains the pool and then immediately after another class instance let's say Group tries to write to the database...
This would give the same error...
It is not clear to me when I should drain the pool
On Thu, Jun 1, 2017, 08:10 Michel notifications@github.com wrote:
Why are you draining every time? If you don't it should work no?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neumino/rethinkdbdash/issues/336#issuecomment-305390659, or mute the thread https://github.com/notifications/unsubscribe-auth/AKxC0oKwz2SgzdWfvekBeB-APXSQxctYks5r_kfdgaJpZM4NrAt6 .
+1
You should never drain the pool I think. You want to drain it when you want your program to never run a query again.
Hello everybody, I have the following issue and I was wondering if anyone can help me:
my package.json scripts section:
My database config:
utility to export rethinkdbdash (db.util.server.js)
My class is (role.model.server.js)
My test (role.model.server.test.js):
Test save runs ok and saves the doc in the database Test get gives error:
as you can see in my class above I am draining the pool after each call to the database...
This is a known problem with this driver and automated tests, has anyone managed to solve this issue?
I know I shouldn't test against a real database but I haven't found a way to mock rethinkdb with sinon or any other tool. Any suggestions on how to mock rethinkdb are welcome.
Thank you