This revision was automatically updated to reflect the committed changes.
Closed by commit rL269168: Rewriting TestMultithreaded.py to solve flakyness on 
Linux (authored by ravitheja).

Changed prior to commit:
  http://reviews.llvm.org/D20091?vs=56671&id=56870#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20091

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp

Index: 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
===================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
@@ -18,7 +18,6 @@
 // listener thread control
 extern atomic<bool> g_done;
 
-multithreaded_queue<string> g_thread_descriptions;
 multithreaded_queue<string> g_frame_functions;
 
 extern SBListener g_listener;
@@ -30,39 +29,30 @@
     if (got_event) {
       if (!event.IsValid())
         throw Exception("event is not valid in listener thread");
-
-      // send process description
-      SBProcess process = SBProcess::GetProcessFromEvent(event);
-      SBStream description;
-
-      for (int i = 0; i < process.GetNumThreads(); ++i) {
-        // send each thread description
-        description.Clear();
-        SBThread thread = process.GetThreadAtIndex(i);
-        thread.GetDescription(description);
-        g_thread_descriptions.push(description.GetData());
-
-        // send each frame function name
-        uint32_t num_frames = thread.GetNumFrames();
-        for(int j = 0; j < num_frames; ++j) {
-          const char* function_name = 
thread.GetFrameAtIndex(j).GetSymbol().GetName();
-          if (function_name)
-            g_frame_functions.push(function_name);
+        // send process description
+        SBProcess process = SBProcess::GetProcessFromEvent(event);
+        SBStream description;
+
+        for (int i = 0; i < process.GetNumThreads(); ++i) {
+            // send each thread description
+            SBThread thread = process.GetThreadAtIndex(i);
+            // send each frame function name
+            uint32_t num_frames = thread.GetNumFrames();
+            for(int j = 0; j < num_frames; ++j) {
+                const char* function_name = 
thread.GetFrameAtIndex(j).GetSymbol().GetName();
+                if (function_name)
+                    g_frame_functions.push(string(function_name));
+            }
         }
-      }
     }
   }
 }
 
 void check_listener(SBDebugger &dbg) {
   // check thread description
   bool got_description = false;
-  string desc = g_thread_descriptions.pop(5, got_description);
-  if (!got_description)
-    throw Exception("Expected at least one thread description string");
-
-  // check at least one frame has a function name
-  desc = g_frame_functions.pop(5, got_description);
-  if (!got_description)
-    throw Exception("Expected at least one frame function name string");
+  string func_name = g_frame_functions.pop(5, got_description);
+  
+  if(got_description == false)
+    throw Exception("Expected at least one frame function");
 }
Index: 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
===================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
@@ -37,7 +37,6 @@
     @skipIfNoSBHeaders
     @skipIfWindows # clang-cl does not support throw or catch 
(llvm.org/pr24538)
     @expectedFlakeyFreeBSD
-    @expectedFlakeyLinux # Driver occasionally returns '1' as exit status
     @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", 
compiler_version=[">=","4.9"], archs=["x86_64"])
     def test_sb_api_listener_event_process_state(self):
         """ Test that a registered SBListener receives events when a process


Index: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
@@ -18,7 +18,6 @@
 // listener thread control
 extern atomic<bool> g_done;
 
-multithreaded_queue<string> g_thread_descriptions;
 multithreaded_queue<string> g_frame_functions;
 
 extern SBListener g_listener;
@@ -30,39 +29,30 @@
     if (got_event) {
       if (!event.IsValid())
         throw Exception("event is not valid in listener thread");
-
-      // send process description
-      SBProcess process = SBProcess::GetProcessFromEvent(event);
-      SBStream description;
-
-      for (int i = 0; i < process.GetNumThreads(); ++i) {
-        // send each thread description
-        description.Clear();
-        SBThread thread = process.GetThreadAtIndex(i);
-        thread.GetDescription(description);
-        g_thread_descriptions.push(description.GetData());
-
-        // send each frame function name
-        uint32_t num_frames = thread.GetNumFrames();
-        for(int j = 0; j < num_frames; ++j) {
-          const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName();
-          if (function_name)
-            g_frame_functions.push(function_name);
+        // send process description
+        SBProcess process = SBProcess::GetProcessFromEvent(event);
+        SBStream description;
+
+        for (int i = 0; i < process.GetNumThreads(); ++i) {
+            // send each thread description
+            SBThread thread = process.GetThreadAtIndex(i);
+            // send each frame function name
+            uint32_t num_frames = thread.GetNumFrames();
+            for(int j = 0; j < num_frames; ++j) {
+                const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName();
+                if (function_name)
+                    g_frame_functions.push(string(function_name));
+            }
         }
-      }
     }
   }
 }
 
 void check_listener(SBDebugger &dbg) {
   // check thread description
   bool got_description = false;
-  string desc = g_thread_descriptions.pop(5, got_description);
-  if (!got_description)
-    throw Exception("Expected at least one thread description string");
-
-  // check at least one frame has a function name
-  desc = g_frame_functions.pop(5, got_description);
-  if (!got_description)
-    throw Exception("Expected at least one frame function name string");
+  string func_name = g_frame_functions.pop(5, got_description);
+  
+  if(got_description == false)
+    throw Exception("Expected at least one frame function");
 }
Index: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
+++ lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
@@ -37,7 +37,6 @@
     @skipIfNoSBHeaders
     @skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538)
     @expectedFlakeyFreeBSD
-    @expectedFlakeyLinux # Driver occasionally returns '1' as exit status
     @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
     def test_sb_api_listener_event_process_state(self):
         """ Test that a registered SBListener receives events when a process
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to