diff --git a/lib/kafka/protocol/fetch_request.rb b/lib/kafka/protocol/fetch_request.rb index 11677cefc..52b54fbc0 100644 --- a/lib/kafka/protocol/fetch_request.rb +++ b/lib/kafka/protocol/fetch_request.rb @@ -50,7 +50,7 @@ def encode(encoder) encoder.write_int32(@max_wait_time) encoder.write_int32(@min_bytes) encoder.write_int32(@max_bytes) - encoder.write_int8(ISOLATION_READ_COMMITTED) + encoder.write_int8(ISOLATION_READ_UNCOMMITTED) encoder.write_array(@topics) do |topic, partitions| encoder.write_string(topic) diff --git a/lib/kafka/protocol/list_offset_request.rb b/lib/kafka/protocol/list_offset_request.rb index ef19e29da..b45e36eff 100644 --- a/lib/kafka/protocol/list_offset_request.rb +++ b/lib/kafka/protocol/list_offset_request.rb @@ -37,7 +37,7 @@ def response_class def encode(encoder) encoder.write_int32(@replica_id) - encoder.write_int8(ISOLATION_READ_COMMITTED) + encoder.write_int8(ISOLATION_READ_UNCOMMITTED) encoder.write_array(@topics) do |topic, partitions| encoder.write_string(topic) diff --git a/lib/kafka/version.rb b/lib/kafka/version.rb index 523fd37e0..3d3918170 100644 --- a/lib/kafka/version.rb +++ b/lib/kafka/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Kafka - VERSION = "1.3.0" + VERSION = "1.3.0.everfi.1" end diff --git a/spec/datadog_spec.rb b/spec/datadog_spec.rb index 6ed12731b..f212f2fb6 100644 --- a/spec/datadog_spec.rb +++ b/spec/datadog_spec.rb @@ -4,18 +4,11 @@ require "fake_datadog_agent" describe Kafka::Datadog do - let(:agent) { FakeDatadogAgent.new } - - before do - agent.start - end - - after do - agent.stop - end - context "when host and port are specified" do it "emits metrics to the Datadog agent" do + agent = FakeDatadogAgent.new + agent.start + Kafka::Datadog.socket_path = nil Kafka::Datadog.host = agent.host Kafka::Datadog.port = agent.port @@ -30,12 +23,17 @@ metric = agent.metrics.first expect(metric).to eq "ruby_kafka.greetings" + agent.stop end end context "when socket_path is specified" do it "emits metrics to the Datadog agent" do + agent = FakeDatadogAgent.new + agent.start Kafka::Datadog.socket_path = agent.socket_path + Kafka::Datadog.host = nil + Kafka::Datadog.port = nil client = Kafka::Datadog.statsd @@ -48,6 +46,7 @@ metric = agent.metrics.first expect(metric).to eq "ruby_kafka.greetings" + agent.stop end end end diff --git a/spec/socket_with_timeout_spec.rb b/spec/socket_with_timeout_spec.rb index f08ff5828..a5cba978c 100644 --- a/spec/socket_with_timeout_spec.rb +++ b/spec/socket_with_timeout_spec.rb @@ -12,7 +12,9 @@ expect { Kafka::SocketWithTimeout.new(host, port, connect_timeout: timeout, timeout: 1) - }.to raise_exception(Errno::ETIMEDOUT) + }.to raise_exception(SystemCallError) { |exception| + expect([Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ENETUNREACH]).to include(exception.class) + } finish = Time.now diff --git a/spec/ssl_socket_with_timeout_spec.rb b/spec/ssl_socket_with_timeout_spec.rb index 71343a9db..cfec1cc5b 100644 --- a/spec/ssl_socket_with_timeout_spec.rb +++ b/spec/ssl_socket_with_timeout_spec.rb @@ -12,7 +12,9 @@ expect { Kafka::SSLSocketWithTimeout.new(host, port, connect_timeout: timeout, timeout: 1, ssl_context: OpenSSL::SSL::SSLContext.new) - }.to raise_exception(Errno::ETIMEDOUT) + }.to raise_exception(SystemCallError) { |exception| + expect([Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ENETUNREACH]).to include(exception.class) + } finish = Time.now