File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
lib/metasploit/framework/spec/threads Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def self.configure!
31
31
unless @configured
32
32
RSpec . configure do |config |
33
33
config . before ( :suite ) do
34
- thread_count = Thread . list . count
34
+ thread_count = Metasploit :: Framework :: Spec :: Threads :: Suite . non_debugger_thread_list . count
35
35
36
36
# check with if first so that error message can be constructed lazily
37
37
if thread_count > EXPECTED_THREAD_COUNT_AROUND_SUITE
@@ -68,7 +68,7 @@ def self.configure!
68
68
f . puts 'after(:suite)'
69
69
end
70
70
71
- thread_list = Thread . list
71
+ thread_list = Metasploit :: Framework :: Spec :: Threads :: Suite . non_debugger_thread_list
72
72
73
73
thread_uuids = thread_list . map { |thread |
74
74
thread [ Metasploit ::Framework ::Spec ::Threads ::Suite ::UUID_THREAD_LOCAL_VARIABLE ]
@@ -195,6 +195,15 @@ def self.caller_by_thread_uuid
195
195
196
196
lines_by_thread_uuid
197
197
end
198
+
199
+ # @return
200
+ def self . non_debugger_thread_list
201
+ Thread . list . reject { |thread |
202
+ # don't do `is_a? Debugger::DebugThread` because it requires Debugger::DebugThread to be loaded, which it
203
+ # won't when not debugging.
204
+ thread . class . name == 'Debugger::DebugThread'
205
+ }
206
+ end
198
207
end
199
208
end
200
209
end
You can’t perform that action at this time.
0 commit comments