llvm-project/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
Michael Buch 0a3b376015 [lldb][test] Skip TestLaunchProcessPosixSpawn.py
Fails on public green dragon arm64 bot with:
```
08:53:39  "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/dsymutil"  -o "fat.out.dSYM" "fat.out"
08:53:39  warning: no debug symbols in executable (-arch x86_64)
08:53:39  warning: no debug symbols in executable (-arch x86_64h)
08:53:39  warning: no debug symbols in executable (-arch arm64)
08:53:39
08:53:39
08:53:39  runCmd: file -arch x86_64 /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/macosx/posix_spawn/TestLaunchProcessPosixSpawn.test_apple_silicon/fat.out
08:53:39
08:53:39  warning: (x86_64) /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/macosx/posix_spawn/TestLaunchProcessPosixSpawn.test_apple_silicon/fat.out empty dSYM file detected, dSYM was created with an executable with no debug info.
08:53:39  output: Current executable set to '/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/macosx/posix_spawn/TestLaunchProcessPosixSpawn.test_apple_silicon/fat.out' (x86_64).
08:53:39
08:53:39
08:53:39  <bound method SBProcess.Kill of SBProcess: pid = 73406, state = exited, threads = 0, executable = fat.out>: success
08:53:39
08:53:39  FAIL: LLDB (/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang-arm64) :: test_apple_silicon (TestLaunchProcessPosixSpawn.TestLaunchProcessPosixSpawn)
08:53:39  runCmd: settings clear --all
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set symbols.enable-external-lookup false
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set target.inherit-tcc true
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set target.disable-aslr false
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set target.detach-on-error false
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set target.auto-apply-fixits false
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set plugin.process.gdb-remote.packet-timeout 60
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set symbols.clang-modules-cache-path "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-lldb/lldb-api"
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set use-color false
08:53:39
08:53:39  output:
08:53:39
08:53:39  runCmd: settings set show-statusline false
08:53:39
08:53:39  output:
08:53:39
08:53:39  UNSUPPORTED: LLDB (/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang-arm64) :: test_haswell (TestLaunchProcessPosixSpawn.TestLaunchProcessPosixSpawn) (Current CPU is not Haswell)
08:53:39  Restore dir to: /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/test
08:53:39  ======================================================================
08:53:39  FAIL: test_apple_silicon (TestLaunchProcessPosixSpawn.TestLaunchProcessPosixSpawn)
08:53:39  ----------------------------------------------------------------------
08:53:39  Traceback (most recent call last):
08:53:39    File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 160, in wrapper
08:53:39      return func(*args, **kwargs)
08:53:39    File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py", line 72, in test_apple_silicon
08:53:39      self.run_arch(exe, "x86_64")
08:53:39    File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py", line 48, in run_arch
08:53:39      self.assertTrue(error.Success(), str(error))
08:53:39  AssertionError: False is not true : error: process exited with status -1 (lost connection)
08:53:39  Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang
08:53:39  ----------------------------------------------------------------------
08:53:39  Ran 2 tests in 5.686s
08:53:39
08:53:39  FAILED (failures=1, skipped=1)
```
2026-02-10 09:13:40 +00:00

75 lines
2.2 KiB
Python

import contextlib
import os
from os.path import exists
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
def haswell():
features = subprocess.check_output(["sysctl", "machdep.cpu"])
return "AVX2" in features.decode("utf-8")
def apple_silicon():
features = subprocess.check_output(["sysctl", "machdep.cpu"])
return "Apple M" in features.decode("utf-8")
def rosetta_debugserver_installed():
import platform
version = platform.mac_ver()
# Workaround for an undiagnosed problem on green dragon.
if version[0] == '15.5':
return False
return exists("/Library/Apple/usr/libexec/oah/debugserver")
class TestLaunchProcessPosixSpawn(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def no_haswell(self):
if not haswell():
return "Current CPU is not Haswell"
return None
def no_apple_silicon(self):
if not apple_silicon():
return "Current CPU is not Apple Silicon"
return None
def run_arch(self, exe, arch):
self.runCmd("target create -arch {} {}".format(arch, exe))
target = self.dbg.GetSelectedTarget()
launch_info = target.GetLaunchInfo()
error = lldb.SBError()
process = target.Launch(launch_info, error)
self.assertTrue(error.Success(), str(error))
self.assertState(process.GetState(), lldb.eStateExited)
self.assertIn("slice: {}".format(arch), process.GetSTDOUT(1000))
@skipUnlessDarwin
@skipIfDarwinEmbedded
@skipIfLLVMTargetMissing("AArch64")
@skipIfLLVMTargetMissing("X86")
@skipTestIfFn(no_haswell)
def test_haswell(self):
self.build()
exe = self.getBuildArtifact("fat.out")
self.run_arch(exe, "x86_64")
self.run_arch(exe, "x86_64h")
@skipUnlessDarwin
@skipIf(bugnumber="rdar://170040996")
@skipIfDarwinEmbedded
@skipIfLLVMTargetMissing("AArch64")
@skipIfLLVMTargetMissing("X86")
@skipTestIfFn(no_apple_silicon)
def test_apple_silicon(self):
self.build()
exe = self.getBuildArtifact("fat.out")
if rosetta_debugserver_installed():
self.run_arch(exe, "x86_64")
self.run_arch(exe, "arm64")