diff options
author | Frederic Riss <friss@apple.com> | 2019-08-26 17:14:05 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2019-08-26 17:14:05 +0000 |
commit | 7305397a142a60d104e02ef1046b4289f957da95 (patch) | |
tree | f5a22cb38ddf6d56cd93b535afb07898b379857d /lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py | |
parent | 2511b5a4638a3bb519b9b50dabf172ba93962cba (diff) | |
download | bcm5719-llvm-7305397a142a60d104e02ef1046b4289f957da95.tar.gz bcm5719-llvm-7305397a142a60d104e02ef1046b4289f957da95.zip |
TestFunctionStarts.py: add synchronization
We have started to see the no_binary version of this test
fail. The reason is that the binary was being removed
before the spawn actually launched the inferior. Add a
simple filesystem based synchronization to avoid this race.
llvm-svn: 369930
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py b/lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py index 840954f7f95..65708765d39 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py +++ b/lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py @@ -43,8 +43,20 @@ class FunctionStartsTestCase(TestBase): except CalledProcessError as cmd_error: self.fail("Strip failed: %d"%(cmd_error.returncode)) - popen = self.spawnSubprocess(exe) + # Use a file as a synchronization point between test and inferior. + pid_file_path = lldbutil.append_to_process_working_directory(self, + "token_pid_%d" % (int(os.getpid()))) + self.addTearDownHook( + lambda: self.run_platform_command( + "rm %s" % + (pid_file_path))) + + popen = self.spawnSubprocess(exe, [pid_file_path]) self.addTearDownHook(self.cleanupSubprocesses) + + # Wait until process has fully started up. + pid = lldbutil.wait_for_file_on_target(self, pid_file_path) + if in_memory: remove_file(exe) @@ -68,7 +80,8 @@ class FunctionStartsTestCase(TestBase): thread = threads[0] self.assertTrue(thread.num_frames > 1, "Couldn't backtrace.") name = thread.frame[1].GetFunctionName() - self.assertEqual("___lldb_unnamed_symbol1$$StripMe", name, "Frame name not synthetic") + self.assertTrue(name.startswith("___lldb_unnamed_symbol")) + self.assertTrue(name.endswith("$$StripMe")) |