This illustrates a problem I'm having when running the tests.  Randomly, I'll get a "socket connection" error while running the tests, and in random places... but all when I'm trying to write to the RethinkDB database.

I think it has something to do with the way the database is set up when running the tests, or perhaps an issue with the way the tests are being run.  It's a different sort of environment than the website, as I've never had this error come up when using the site.

In the meantime, I found that injecting a short sleep between tests allows the tests to run more consistently.  And in this case, when I'm doing two writes immediately after each other, a sleep made the errors go away.