]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/test_socket: fix dispatch_sockets() unexpected exception 33482/head
authorluo rixin <luorixin@huawei.com>
Sat, 22 Feb 2020 09:57:46 +0000 (17:57 +0800)
committerluo rixin <luorixin@huawei.com>
Mon, 2 Mar 2020 12:16:24 +0000 (20:16 +0800)
In the test test_unexpected_down(), there is client running on CPU0
and server runing on CPU1, the server maybe finished before the client
(client and other workloads share CPU0), so client couldn't read data
and throws "dispatch_sockets(): cb_client() got unexpected exception
std::system_error (error crimson::net:4, read eof)"

Signed-off-by: luo rixin <luorixin@huawei.com>
src/test/crimson/test_socket.cc

index cb44373f8de58e2966c3003981a0a1c357cbba07..5d1458ba4a2e3280d4956baefe09a4a50e37f3ee 100644 (file)
@@ -373,7 +373,13 @@ future<> test_read_write() {
 future<> test_unexpected_down() {
   logger.info("test_unexpected_down()...");
   return SocketFactory::dispatch_sockets(
-    [] (auto cs) { return Connection::dispatch_rw_bounded(cs, 128, true); },
+    [] (auto cs) { 
+      return Connection::dispatch_rw_bounded(cs, 128, true
+        ).handle_exception_type([] (const std::system_error& e) {
+        logger.debug("test_unexpected_down(): client get error {}", e);
+        ceph_assert(e.code() == error::read_eof);
+      });
+    },
     [] (auto ss) { return Connection::dispatch_rw_unbounded(ss); }
   ).then([] {
     logger.info("test_unexpected_down() ok\n");