You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the migrate module directly (instead of the CLI) in jest test setups and teardowns (up on setup, down on teardown), and jest was hanging after the down migrations ran.
I noticed that migrateUp and migrateDown never close their connections after executing.
After adding the following finally blocks to each usage, jest stopped hanging, and its process was able to exit cleanly:
.finally(function(){returnconnection.close();});
I'm pretty sure finally isn't supported everywhere yet, but the same can be accomplished via including the same in both a then and a catch. EDIT: actually, it's using the promises returned by rethink, which are bluebird promises (and thus, support finally).
The text was updated successfully, but these errors were encountered:
@vinicius0026: I saw your issue introducing rethinkdb-migrate after I posted this issue. I couldn't immediately tell whether yours suffers from this same issue, but it's probably worth checking! 😄
Hey @jrnail23, sure you can take a look at rethinkdb-migrate. Make sure to check our tests scripts, where we do just what you suggested here and close the connection.
I'm using the migrate module directly (instead of the CLI) in jest test setups and teardowns (up on setup, down on teardown), and jest was hanging after the down migrations ran.
I noticed that migrateUp and migrateDown never close their connections after executing.
After adding the following
finally
blocks to each usage, jest stopped hanging, and its process was able to exit cleanly:I'm pretty sure
finally
isn't supported everywhere yet, but the same can be accomplished via including the same in both athen
and acatch
. EDIT: actually, it's using the promises returned by rethink, which are bluebird promises (and thus, supportfinally
).The text was updated successfully, but these errors were encountered: