Skip to content

Commit 4951a6b

Browse files
committed
closer
1 parent 342fcb2 commit 4951a6b

File tree

1 file changed

+44
-29
lines changed

1 file changed

+44
-29
lines changed

test/test_helper.rb

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,41 +81,41 @@ def time_it
8181
end
8282

8383

84-
module DebugSlowTests
85-
def wrap_the_thing(name)
86-
rv = nil
87-
t0 = Minitest.clock_time
88-
profile = StackProf.run(mode: :wall, interval: 1000) do
89-
rv = yield
90-
end
91-
puts
92-
puts "#{name} took #{Minitest.clock_time - t0} seconds"
93-
puts
94-
pp SpatialModel.lease_connection.instance_variable_get(:@raw_connection).conninfo_hash
95-
puts
96-
StackProf::Report.new(profile).print_text
97-
rv
98-
end
99-
def enable_extension!(...)
100-
wrap_the_thing(__method__) do
101-
super
102-
end
103-
end
104-
105-
def disable_extension!(...)
106-
wrap_the_thing(__method__) do
107-
super
108-
end
109-
end
110-
end
84+
# module DebugSlowTests
85+
# def wrap_the_thing(name)
86+
# rv = nil
87+
# t0 = Minitest.clock_time
88+
# profile = StackProf.run(mode: :wall, interval: 1000) do
89+
# rv = yield
90+
# end
91+
# puts
92+
# puts "#{name} took #{Minitest.clock_time - t0} seconds"
93+
# puts
94+
# pp SpatialModel.lease_connection.instance_variable_get(:@raw_connection).conninfo_hash
95+
# puts
96+
# StackProf::Report.new(profile).print_text
97+
# rv
98+
# end
99+
# def enable_extension!(...)
100+
# wrap_the_thing(__method__) do
101+
# super
102+
# end
103+
# end
104+
105+
# def disable_extension!(...)
106+
# wrap_the_thing(__method__) do
107+
# super
108+
# end
109+
# end
110+
# end
111111

112112

113113

114114
module ActiveRecord
115115
class TestCase
116116
include TestTimeoutHelper
117-
include DebugSlowTests
118-
extend DebugSlowTests
117+
# include DebugSlowTests
118+
# extend DebugSlowTests
119119

120120
def factory(srid: 3785)
121121
RGeo::Cartesian.preferred_factory(srid: srid)
@@ -164,4 +164,19 @@ def reset
164164
end
165165
end
166166

167+
module DebugResolve
168+
def resolve_hosts(iopts)
169+
host = iopts[:host]
170+
host = host[0, 97] + "..." if host.length > 100
171+
puts "resolve_hosts, hosts: #{host.inspect}"
172+
173+
port = iopts[:port]
174+
port = port[0, 97] + "..." if port.length > 100
175+
puts "resolve_hosts, ports: #{port.inspect}"
176+
177+
super
178+
end
179+
end
180+
167181
PG::Connection.prepend(DebugReset)
182+
PG::Connection.singleton_class.prepend(DebugResolve)

0 commit comments

Comments
 (0)