Skip to content

Commit

Permalink
Account for History Manager thread when executing RSpec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed May 28, 2024
1 parent 82c43c3 commit f3c9298
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/metasploit/framework/spec/threads/suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ module Suite
# 4. Ruby's Timeout library thread, an automatically created monitor thread when using `Thread.timeout(1) { }`
# https://github.com/ruby/timeout/blob/bd25f4b138b86ef076e6d9d7374b159fffe5e4e9/lib/timeout.rb#L129-L137
# 5. REMOTE_DB thread, if enabled
# 6. History Manager writer thread for saving history contexts to disk
#
# Intermittent threads that are non-deterministically left behind, which should be fixed in the future:
# 1. metadata cache hydration
# https://github.com/rapid7/metasploit-framework/blob/115946cd06faccac654e956e8ba9cf72ff328201/lib/msf/core/modules/metadata/cache.rb#L150-L153
# 2. session manager
# https://github.com/rapid7/metasploit-framework/blob/115946cd06faccac654e956e8ba9cf72ff328201/lib/msf/core/session_manager.rb#L153-L168
#
EXPECTED_THREAD_COUNT_AROUND_SUITE = ENV['REMOTE_DB'] ? 7 : 6
EXPECTED_THREAD_COUNT_AROUND_SUITE = ENV['REMOTE_DB'] ? 8 : 7

# `caller` for all Thread.new calls
LOG_PATHNAME = Pathname.new('log/metasploit/framework/spec/threads/suite.log')
Expand Down

0 comments on commit f3c9298

Please sign in to comment.