]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/subprocess: add missing space in SubshellKilled subcommand 69949/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Mon, 6 Jul 2026 08:06:09 +0000 (01:06 -0700)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Mon, 6 Jul 2026 08:06:09 +0000 (01:06 -0700)
9abf2388f24 rewrote "sh -c cat" as SHELL "-c cat", which concatenates
to "/bin/sh-c cat", so the subshell tries to execute a non-existent
"/bin/sh-c". The test still passed because the SIGTERM sent by kill()
usually wins the race against the shell startup; under CI load the
shell occasionally prints

  /bin/sh: line 1: /bin/sh-c: No such file or directory

into the stderr pipe first, ASSERT_TRUE(buf.empty()) fails, and the
skipped join() turns this into a SIGABRT in ~SubProcess().

Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
src/test/test_subprocess.cc

index c6415c4864a1e0b99e6698a72b71977d7994070a..6f2542895b04ddec0247ac85278f5e0a3a9d3159 100644 (file)
@@ -258,7 +258,7 @@ TEST(SubProcessTimed, SubshellNoTimeout)
 TEST(SubProcessTimed, SubshellKilled)
 {
   SubProcessTimed sh(SHELL, SubProcess::PIPE, SubProcess::PIPE, SubProcess::PIPE, 10);
-  sh.add_cmd_args("-c", SHELL "-c cat", NULL);
+  sh.add_cmd_args("-c", SHELL " -c cat", NULL);
   ASSERT_EQ(sh.spawn(), 0);
   std::string msg("etaoin shrdlu");
   int n = write(sh.get_stdin(), msg.c_str(), msg.size());