                         try? subServer.readAndRespond()
                     }
                 } catch {
-                    NSLog("httpServer: \(error)")
+                    if (serverActive) { // Ignore errors thrown on shutdown
+                        NSLog("httpServer: \(error)")
+                    }
                 }
             }
             serverPort = -2

        return _HTTPServer(socket: connection)
    }

    public func request() throws -> _HTTPRequest {

        var reader = _SocketDataReader(socket: tcpSocket)


    override class func tearDown() {
        serverActive = false
        try? testServer?.stop()
        super.tearDown()
    }
}
