From 881652cb0f4def625b21f48e80de098c1288f43e Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Jul 2025 14:09:52 +0000 Subject: [PATCH] Fix flaky faraday spec --- sentry-ruby/spec/sentry/faraday_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sentry-ruby/spec/sentry/faraday_spec.rb b/sentry-ruby/spec/sentry/faraday_spec.rb index 48f129486..b0dbcd8f9 100644 --- a/sentry-ruby/spec/sentry/faraday_spec.rb +++ b/sentry-ruby/spec/sentry/faraday_spec.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require "faraday" +require "contexts/with_request_mock" + require_relative "../spec_helper" RSpec.describe Sentry::Faraday do @@ -263,6 +265,8 @@ end context "when adapter is net/http" do + include_context "with request mock" + let(:http) do Faraday.new(url) do |f| f.request :json @@ -272,7 +276,9 @@ let(:url) { "http://example.com" } - it "skips instrumentation", webmock: false do + it "skips instrumentation" do + stub_normal_response(code: "200") + transaction = Sentry.start_transaction Sentry.get_current_scope.set_span(transaction)