-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb][test] XcodeSDKModuleTests: remove non-deterministic source mapping checks #129526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb][test] XcodeSDKModuleTests: remove non-deterministic source mapping checks #129526
Conversation
…ping checks This assertion was added to check that `RegisterXcodeSDK` will correctly update the source mappings of the module. However, the source mapping will only get updated if the command-line invocation of `xcrun` succeeded. Even if `xcrun` failed to find an SDK, the source mappings would get an entry (see https://github.com/llvm/llvm-project/blob/f6212c1cd3d8b827c7d7e2f6cf54b135c27eacc6/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm#L424-L444). But if the shell invocation itself failed, then the mappings are not updated. This means depending on how slow `xcrun` is on a given host, this test may fail. On my machine this happens consistently in debug and release builds. This patch removes this flakey assertion. We unfortunately lost some test coverage here but I'm not sure there's great alternatives unless we either: 1. Mock the `xcrun` call somehow (we could maybe pass a callable around which defaults to `xcrun` in non-test code?) 2. Make a `xcrun` time-out not an error either?
@llvm/pr-subscribers-lldb Author: Michael Buch (Michael137) ChangesThis assertion was added to check that llvm-project/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm Lines 424 to 444 in f6212c1
xcrun is on a given host, this test may fail. On my machine this happens consistently in debug and release builds.
This patch removes this flakey assertion. We unfortunately lost some test coverage here but I'm not sure there's great alternatives unless we either:
Full diff: https://github.com/llvm/llvm-project/pull/129526.diff 1 Files Affected:
diff --git a/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp b/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp
index fc008ca7011e4..b3bf4d9219d3e 100644
--- a/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp
+++ b/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp
@@ -116,11 +116,8 @@ TEST_F(XcodeSDKModuleTests, TestModuleGetXcodeSDK) {
SymbolFileDWARF &sym_file = dwarf_cu->GetSymbolFileDWARF();
CompUnitSP comp_unit = sym_file.GetCompileUnitAtIndex(0);
ASSERT_TRUE(static_cast<bool>(comp_unit.get()));
- ModuleSP module = t.GetModule();
- ASSERT_EQ(module->GetSourceMappingList().GetSize(), 0u);
XcodeSDK sdk = sym_file.ParseXcodeSDK(*comp_unit);
ASSERT_EQ(sdk.GetType(), XcodeSDK::Type::MacOSX);
- ASSERT_EQ(module->GetSourceMappingList().GetSize(), 1u);
}
TEST_F(XcodeSDKModuleTests, TestSDKPathFromDebugInfo_InvalidSDKPath) {
|
…ping checks (llvm#129526) This assertion was added to check that `RegisterXcodeSDK` will correctly update the source mappings of the module. However, the source mapping will only get updated if the `Host::RunShellCommand` call to `xcrun` succeeded. Even if `xcrun` failed to find an SDK, the source mappings would get an entry. But if the shell invocation itself failed, then the mappings are not updated (see https://github.com/llvm/llvm-project/blob/f6212c1cd3d8b827c7d7e2f6cf54b135c27eacc6/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm#L424-L444). This means depending on how slow `xcrun` is on a given host, this test may fail. On my machine this happens consistently in debug and release builds. This patch removes this flakey assertion. We unfortunately lost some test coverage here but I'm not sure there's great alternatives unless we either: 1. Mock the `xcrun` call somehow (we could maybe pass a callable around which defaults to `xcrun` in non-test code?) 2. Make a `xcrun` time-out not an error either?
This assertion was added to check that
RegisterXcodeSDK
will correctly update the source mappings of the module. However, the source mapping will only get updated if theHost::RunShellCommand
call toxcrun
succeeded. Even ifxcrun
failed to find an SDK, the source mappings would get an entry. But if the shell invocation itself failed, then the mappings are not updated (seellvm-project/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
Lines 424 to 444 in f6212c1
xcrun
is on a given host, this test may fail. On my machine this happens consistently in debug and release builds.This patch removes this flakey assertion. We unfortunately lost some test coverage here but I'm not sure there's great alternatives unless we either:
xcrun
call somehow (we could maybe pass a callable around which defaults toxcrun
in non-test code?)xcrun
time-out not an error either?