diff --git a/spec/lib/final_destination/resolver_spec.rb b/spec/lib/final_destination/resolver_spec.rb index 6d1139fa93a..bf519d843db 100644 --- a/spec/lib/final_destination/resolver_spec.rb +++ b/spec/lib/final_destination/resolver_spec.rb @@ -17,13 +17,17 @@ describe FinalDestination::Resolver do Addrinfo.stubs(:getaddrinfo).with { |addr| addr == "example.com" }.returns(mock_response) expect { - FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001) + result = FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001) + # If the test gets this far, it failed + puts "Flaky test debug: Result was #{result.inspect}" }.to raise_error(Timeout::Error) start_thread_count = alive_thread_count expect { - FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001) + result = FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001) + # If the test gets this far, it failed + puts "Flaky test debug: Result was #{result.inspect}" }.to raise_error(Timeout::Error) expect(alive_thread_count).to eq(start_thread_count)