Skip to content

Commit f9338db

Browse files
authored
[lldb][test] XcodeSDKModuleTests: remove non-deterministic source mapping checks (#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?
1 parent 3ff6fb6 commit f9338db

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,8 @@ TEST_F(XcodeSDKModuleTests, TestModuleGetXcodeSDK) {
116116
SymbolFileDWARF &sym_file = dwarf_cu->GetSymbolFileDWARF();
117117
CompUnitSP comp_unit = sym_file.GetCompileUnitAtIndex(0);
118118
ASSERT_TRUE(static_cast<bool>(comp_unit.get()));
119-
ModuleSP module = t.GetModule();
120-
ASSERT_EQ(module->GetSourceMappingList().GetSize(), 0u);
121119
XcodeSDK sdk = sym_file.ParseXcodeSDK(*comp_unit);
122120
ASSERT_EQ(sdk.GetType(), XcodeSDK::Type::MacOSX);
123-
ASSERT_EQ(module->GetSourceMappingList().GetSize(), 1u);
124121
}
125122

126123
TEST_F(XcodeSDKModuleTests, TestSDKPathFromDebugInfo_InvalidSDKPath) {

0 commit comments

Comments
 (0)