From: Lucian Petrut Date: Thu, 14 Sep 2023 11:08:36 +0000 (+0000) Subject: test/dokan: avoid unnecessary wait X-Git-Tag: v19.0.0~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53456%2Fhead;p=ceph.git test/dokan: avoid unnecessary wait One of the dokan tests expects some mount operations to fail. The issue is that it polls the mount location for 10s, which is unnecessary. We'll update the test to check the mount process exit code instead. This basically reduces the dokan test duration by about 20s. Signed-off-by: Lucian Petrut --- diff --git a/src/test/dokan/dokan.cc b/src/test/dokan/dokan.cc index eaa26557fe88..baef44a49b65 100644 --- a/src/test/dokan/dokan.cc +++ b/src/test/dokan/dokan.cc @@ -157,7 +157,18 @@ void map_dokan_with_maxpath( const char* mountpoint, uint64_t max_path_len) { - SubProcess* new_mount = new SubProcess("ceph-dokan"); + SubProcess* new_mount = nullptr; + + bool expect_failure = max_path_len < 256 || max_path_len > 4096; + if (expect_failure) { + new_mount = new SubProcessTimed( + "ceph-dokan", + SubProcess::CLOSE, SubProcess::CLOSE, SubProcess::CLOSE, + MOUNT_POLL_ATTEMPT * MOUNT_POLL_INTERVAL_MS / 1000); + } else { + new_mount = new SubProcess("ceph-dokan"); + } + new_mount->add_cmd_args("map", "--debug", "--dokan-stderr", "--win-vol-name", "TestCeph", "--win-vol-serial", TEST_VOL_SERIAL, @@ -167,10 +178,10 @@ void map_dokan_with_maxpath( *mount = new_mount; ASSERT_EQ(new_mount->spawn(), 0); - if (256 <= max_path_len && max_path_len <= 4096) { - ASSERT_EQ(wait_for_mount(mountpoint), 0); + if (expect_failure) { + ASSERT_NE(0, new_mount->join()); } else { - ASSERT_NE(wait_for_mount(mountpoint), 0); + ASSERT_EQ(wait_for_mount(mountpoint), 0); } }