diff --git a/lldb/test/API/commands/platform/process/list/TestProcessList.py b/lldb/test/API/commands/platform/process/list/TestProcessList.py index 5daf5dc49b52a..683b62e56e171 100644 --- a/lldb/test/API/commands/platform/process/list/TestProcessList.py +++ b/lldb/test/API/commands/platform/process/list/TestProcessList.py @@ -23,8 +23,10 @@ def test_process_list_with_args(self): exe = self.getBuildArtifact("TestProcess") # Spawn a new process - popen = self.spawnSubprocess(exe, args=["arg1", "--arg2", "arg3"]) - - substrs = [str(popen.pid), "TestProcess arg1 --arg2 arg3"] + sync_file = lldbutil.append_to_process_working_directory(self, + "ready.txt") + popen = self.spawnSubprocess(exe, args=[sync_file, "arg1", "--arg2", "arg3"]) + lldbutil.wait_for_file_on_target(self, sync_file) + substrs = [str(popen.pid), "TestProcess", "arg1 --arg2 arg3"] self.expect("platform process list -v", substrs=substrs) diff --git a/lldb/test/API/commands/platform/process/list/main.cpp b/lldb/test/API/commands/platform/process/list/main.cpp index da43e60155ea0..955f6e4382d20 100644 --- a/lldb/test/API/commands/platform/process/list/main.cpp +++ b/lldb/test/API/commands/platform/process/list/main.cpp @@ -1,9 +1,9 @@ -#include - #include +#include #include int main(int argc, char const *argv[]) { + std::ofstream(argv[1]).close(); std::this_thread::sleep_for(std::chrono::seconds(30)); return 0; }