Tests: In test_dbserver, use conn.recv_maybe() and assert(dg is not None).
Use instead of conn.recv() to improve debug messages.