Repository navigation
Open
Labels
enhancementNew feature or request
Description
The following spec:
twingly-http/spec/lib/twingly/http_spec.rb
Lines 426 to 446 in 494bba1
| context "when given a slow host" do | |
| let(:toxiproxy) { "http_host" } | |
| let(:url) { "http://#{ToxiproxyConfig.downstream(toxiproxy)}/" } | |
| describe "open/read timeout" do | |
| before { client.http_timeout = 0.1 } | |
| around do |example| | |
| Toxiproxy[toxiproxy].toxic(:timeout, timeout: 0).apply do | |
| Timeout.timeout(example_timeout) do | |
| example.run | |
| end | |
| end | |
| end | |
| it "should raise exception" do | |
| expect { subject } | |
| .to raise_error(Twingly::HTTP::ConnectionError) | |
| end | |
| end | |
| end |
diff --git a/spec/lib/twingly/http_spec.rb b/spec/lib/twingly/http_spec.rb
index 765efad..184dc42 100644
--- a/spec/lib/twingly/http_spec.rb
+++ b/spec/lib/twingly/http_spec.rb
@@ -423,9 +423,9 @@ RSpec.describe Twingly::HTTP::Client do
WebMock.disable_net_connect!
end
- context "when given a slow host" do
+ fcontext "when given a slow host" do
let(:toxiproxy) { "http_host" }
- let(:url) { "http://#{ToxiproxyConfig.downstream(toxiproxy)}/" }
+ let(:url) { "http://thisdoesnotevenexist.com/" }
describe "open/read timeout" do
before { client.http_timeout = 0.1 }It passes the tests, which it should not :) I guess the best solution is to introduce a Timeout error which the specs can expect rather than the general error.
Reacted by Mattias Roback
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
walro commentedon Dec 3, 2020
E.g. split the following rescue in two and re-raise accordingly:
twingly-http/lib/twingly/http.rb
Lines 94 to 95 in 494bba1