Skip to content

Commit

Permalink
Fix starting test server when test was skipped
Browse files Browse the repository at this point in the history
This left an open socket behind, which conflicted with other specs.
  • Loading branch information
ivoanjo committed Jan 5, 2022
1 parent f95df97 commit 778e031
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/ddtrace/transport/http/adapters/net_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@
end

after do
server.shutdown
@server_thread.join
unless RSpec.current_example.skipped?
# When the test is skipped, server has not been initialized and @server_thread would be nil; thus we only
# want to touch them when the test actually run, otherwise we would cause the server to start (incorrectly)
# and join to be called on a nil @server_thread
server.shutdown
@server_thread.join
end
end
end

Expand Down

0 comments on commit 778e031

Please sign in to comment.