fix stat pid not exist

Change-Id: I42cae99bace50347157efb4a5e4b62ee968541d6
Signed-off-by: leiguangyu <leiguangyu@huawei.com>
This commit is contained in:
leiguangyu 2024-11-07 20:47:41 +08:00
parent b1ffd8daa8
commit 0c2e81c79e

View File

@ -18,7 +18,6 @@
#include <cinttypes>
#include <condition_variable>
#include <mutex>
#include <random>
#include <regex>
#include <sstream>
#include <thread>
@ -2258,7 +2257,7 @@ HWTEST_F(SubCommandStatTest, CheckPidAndApp, TestSize.Level1)
}
std::string cmd = "stat -p " + std::to_string(existPid + rand() % 100 + 1) + " -d 2";
EXPECT_EQ(Command::DispatchCommand(cmd), false);
StdoutRecord stdoutRecord;
stdoutRecord.Start();
const auto startTime = chrono::steady_clock::now();