Skip to content

Commit

Permalink
Merge pull request #759 from arkadiyt/tracepoint-fix
Browse files Browse the repository at this point in the history
Only apply TracePoint to current thread
  • Loading branch information
bblimke committed May 27, 2018
2 parents ca54cf8 + ba0828f commit 11feb72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/webmock/http_lib_adapters/net_http.rb
Expand Up @@ -274,7 +274,10 @@ def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)

if RUBY_VERSION >= '2.6.0'
def rbuf_fill
current_thread_id = Thread.current.object_id

trace = TracePoint.trace(:line) do |tp|
next unless Thread.current.object_id == current_thread_id
if tp.binding.local_variable_defined?(:tmp)
tp.binding.local_variable_set(:tmp, nil)
end
Expand Down

0 comments on commit 11feb72

Please sign in to comment.