[Lldb-commits] [lldb] r233306 - Fix test failures caused by order of initialization.

Zachary Turner zturner at google.com
Thu Mar 26 11:54:21 PDT 2015


Author: zturner
Date: Thu Mar 26 13:54:21 2015
New Revision: 233306

URL: http://llvm.org/viewvc/llvm-project?rev=233306&view=rev
Log:
Fix test failures caused by order of initialization.

tear down hooks run as part of Base.tearDown().  Some of these
hooks rely on accessing the debugger instance.  So although it
looks awkward, we need to call "del self.dbg" after calling
Base.tearDown().

Modified:
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=233306&r1=233305&r2=233306&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Thu Mar 26 13:54:21 2015
@@ -1918,11 +1918,13 @@ class TestBase(Base):
         if lldb.post_flight:
             lldb.post_flight(self)
 
-        del self.dbg
-
         # Do this last, to make sure it's in reverse order from how we setup.
         Base.tearDown(self)
 
+        # This must be the last statement, otherwise teardown hooks or other
+        # lines might depend on this still being active.
+        del self.dbg
+
     def switch_to_thread_with_stop_reason(self, stop_reason):
         """
         Run the 'thread list' command, and select the thread with stop reason as





More information about the lldb-commits mailing list