Skip to content

Commit 060fff6

Browse files
p-mongop
andauthored
RUBY-2132 misc cleanup (#1944)
* report background threads not launched from examples * reduce line length * reformat the hash Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com>
1 parent 4a7f903 commit 060fff6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

lib/mongo/server/monitor.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def heartbeat_interval
100100
# @deprecated
101101
def_delegators :server, :last_scan
102102

103-
# The compressor is determined during the handshake, so it must be an attribute
104-
# of the connection.
103+
# The compressor is determined during the handshake, so it must be an
104+
# attribute of the connection.
105105
#
106106
# @deprecated
107107
def_delegators :connection, :compressor
@@ -126,8 +126,8 @@ def do_work
126126
end
127127
end
128128

129-
# Stop the background thread and wait for to terminate for a reasonable
130-
# amount of time.
129+
# Stop the background thread and wait for it to terminate for a
130+
# reasonable amount of time.
131131
#
132132
# @return [ true | false ] Whether the thread was terminated.
133133
#

lib/mongo/server/monitor/connection.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class Connection < Server::ConnectionCommon
3636
# The case matters here for fail points.
3737
#
3838
# @since 2.5.0
39-
ISMASTER_OP_MSG = { isMaster: 1, '$db' => Database::ADMIN }.freeze
39+
ISMASTER_OP_MSG = {
40+
isMaster: 1,
41+
'$db' => Database::ADMIN,
42+
}.freeze
4043

4144
# The constant for the ismaster command.
4245
#

spec/support/background_thread_registry.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ def verify_empty!
4242
if record.object.respond_to?(:options)
4343
msg << "\n with options: #{record.object.options}"
4444
end
45-
msg << "\n in #{record.example.id} #{record.example.full_description}"
45+
if record.example
46+
msg << "\n in #{record.example.id} #{record.example.full_description}"
47+
else
48+
msg << "\n not in an example"
49+
end
4650
end
4751
raise msg
4852
end

0 commit comments

Comments
 (0)