diff --git a/tests/tst-tcp.cc b/tests/tst-tcp.cc
index 331e8e9c104233b0330cdd1ccf2ba2cae555f223..3b39dbbd47fa9efcaed176cd95f7cd415cc128ed 100644
--- a/tests/tst-tcp.cc
+++ b/tests/tst-tcp.cc
@@ -130,6 +130,7 @@ void tcp_test_client::test_thread::do_connection()
             throw runtime_error("data mismatch");
         }
     }
+    socket.close();
     lock_dropper.unlock(); // really, locks
     ++_client._connections_completed;
     if (_client.done()) {