Skip to content

Commit 75e93ec

Browse files
committed
[lldb][TerminalTest] Fix assertion failure
D152712 replaced `llvm::sys::RetryAfterSignal(-1, ::open)` with `FileSystem::Instance().Open` for bionic in PseudoTerminal::OpenSecondary, and FileSystem::Instance() is failing with assertion on arm Linux. The assertion should be FileSystem re-initialization check, therefore the hypothesis is that TerminalTest tests are initializing FileSystem instance repeatedly. Use SubsystemRAII<FileSystem> to ensure tearing down the FileSystem instance. Differential Revision: https://reviews.llvm.org/D153091
1 parent 96ed1bd commit 75e93ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lldb/unittests/Host/posix/TerminalTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "lldb/Host/FileSystem.h"
910
#include "lldb/Host/PseudoTerminal.h"
1011
#include "lldb/Host/Terminal.h"
1112
#include "llvm/Testing/Support/Error.h"
13+
#include "TestingSupport/SubsystemRAII.h"
1214

1315
#include "gmock/gmock.h"
1416
#include "gtest/gtest.h"
@@ -20,6 +22,7 @@ using namespace lldb_private;
2022

2123
class TerminalTest : public ::testing::Test {
2224
protected:
25+
SubsystemRAII<FileSystem> subsystems;
2326
PseudoTerminal m_pty;
2427
int m_fd;
2528
Terminal m_term;

0 commit comments

Comments
 (0)