message:
improve reliability of tests + fix credo for Elixir 1.9
Use OTP 21 for now

diff:
@@ -9,7 +9,10 @@ cache:
matrix:
include:
- elixir: 1.9.4
- otp_release: 22.1
+ # stick to OTP release 21.3 for now.
+ # We have problems with SSL and OTP 22
+ # https://github.com/kafkaex/kafka_ex/issues/389
+ otp_release: 21.3
env: COVERALLS=true CREDO=true
- elixir: 1.8.2
otp_release: 21.3

diff:
@@ -236,6 +236,15 @@ defmodule KafkaEx.Server do
# Default from GenServer
@default_call_timeout 5_000
+ # the timeout parameter is used also for network requests, which
+ # means that if we set the same value for the GenServer timeout,
+ # it will always timeout first => we won't get the expected behaviour,
+ # which is to have the GenServer.call answer with the timeout reply.
+ # Instead, we get a GenServer timeout error.
+ # To avoid this, we add here an "buffer" time that covers the time
+ # needed to process the logic until the network request, and back from it.
+ @overhead_timeout 2_000
+
@doc false
@spec call(
GenServer.server(),
@@ -262,7 +271,7 @@ defmodule KafkaEx.Server do
end
def call(server, request, timeout) when is_integer(timeout) do
- GenServer.call(server, request, timeout)
+ GenServer.call(server, request, timeout + @overhead_timeout)
end
defmacro __using__(_) do
@@ -556,7 +565,7 @@ defmodule KafkaEx.Server do
response -> Offset.parse_response(response)
end
- state = %{state | correlation_id: state.correlation_id + 1}
+ state = increment_state_correlation_id(state)
{response, state}
end
@@ -994,6 +1003,10 @@ defmodule KafkaEx.Server do
defp default_partitioner do
Application.get_env(:kafka_ex, :partitioner, KafkaEx.DefaultPartitioner)
end
+
+ defp increment_state_correlation_id(%_{correlation_id: correlation_id} = state) do
+ %{state | correlation_id: correlation_id + 1}
+ end
end
end
end

diff:
@@ -190,7 +190,7 @@ defmodule KafkaEx.Server0P10AndLater do
|> first_broker_response(state)
|> ApiVersions.parse_response()
- {:reply, response, %{state | correlation_id: state.correlation_id + 1}}
+ {:reply, response, increment_state_correlation_id(state)}
end
def kafka_server_delete_topics(topics, network_timeout, state) do
@@ -214,27 +214,13 @@ defmodule KafkaEx.Server0P10AndLater do
api_version
)
- broker = state.brokers |> Enum.find(& &1.is_controller)
-
{response, state} =
- case broker do
- nil ->
- Logger.log(:error, "Coordinator for topic is not available")
- {:topic_not_found, state}
+ case request_to_controller(main_request, state) do
+ {{:ok, response}, state} ->
+ {DeleteTopics.parse_response(response, api_version), state}
- _ ->
- response =
- broker
- |> NetworkClient.send_sync_request(
- main_request,
- config_sync_timeout()
- )
- |> case do
- {:error, reason} -> {:error, reason}
- response -> DeleteTopics.parse_response(response, api_version)
- end
-
- {response, %{state | correlation_id: state.correlation_id + 1}}
+ other ->
+ other
end
state = update_metadata(state)
@@ -265,32 +251,42 @@ defmodule KafkaEx.Server0P10AndLater do
api_version
)
+ {response, state} =
+ case request_to_controller(main_request, state) do
+ {{:ok, response}, state} ->
+ {CreateTopics.parse_response(response, api_version), state}
+
+ other ->
+ other
+ end
+
+ state = update_metadata(state)
+
+ {:reply, response, state}
+ end
+
+ defp request_to_controller(main_request, state) do
broker = state.brokers |> Enum.find(& &1.is_controller)
- {response, state} =
case broker do
nil ->
Logger.log(:error, "Coordinator for topic is not available")
{:topic_not_found, state}
_ ->
- response =
broker
|> NetworkClient.send_sync_request(
main_request,
config_sync_timeout()
)
|> case do
- {:error, reason} -> {:error, reason}
- response -> CreateTopics.parse_response(response, api_version)
- end
+ {:error, reason} ->
+ {{:error, reason}, increment_state_correlation_id(state)}
- {response, %{state | correlation_id: state.correlation_id + 1}}
+ response ->
+ {{:ok, response}, increment_state_correlation_id(state)}
+ end
end
-
- state = update_metadata(state)
-
- {:reply, response, state}
end
defp update_consumer_metadata(state),

diff:
@@ -169,7 +169,7 @@ defmodule KafkaEx.Server0P8P2 do
response -> OffsetFetch.parse_response(response)
end
- {response, %{state | correlation_id: state.correlation_id + 1}}
+ {response, increment_state_correlation_id(state)}
end
{:reply, response, state}
@@ -259,7 +259,7 @@ defmodule KafkaEx.Server0P8P2 do
:timer.sleep(400)
update_consumer_metadata(
- %{state | correlation_id: state.correlation_id + 1},
+ increment_state_correlation_id(state),
retry - 1,
response.error_code
)
@@ -335,7 +335,7 @@ defmodule KafkaEx.Server0P8P2 do
response -> OffsetCommit.parse_response(response)
end
- {response, %{state | correlation_id: state.correlation_id + 1}}
+ {response, increment_state_correlation_id(state)}
end
defp broker_for_consumer_group(state) do

diff:
@@ -206,7 +206,7 @@ defmodule KafkaEx.Server0P9P0 do
{broker, state} = broker_for_consumer_group_with_update(state)
- state_out = %{state | correlation_id: state.correlation_id + 1}
+ state_out = increment_state_correlation_id(state)
sync_timeout = config_sync_timeout(network_timeout)

diff:
@@ -11,4 +11,4 @@ mix $TEST_COMMAND \
--include server_0_p_10_p_1 \
--include server_0_p_9_p_0 \
--include server_0_p_8_p_0 \
- --include new_client
+ --include new_client "$@"

diff:
@@ -27,7 +27,7 @@ else
TEST_COMMAND=test
fi
-export ${TEST_COMMAND}
+export TEST_COMMAND
ALL_TESTS=${PROJECT_DIR}/scripts/all_tests.sh

diff:
@@ -14,7 +14,6 @@ defmodule KafkaEx.ConsumerGroupImplementationTest do
@partition_count 4
@consumer_group_name "consumer_group_implementation"
-
defmodule TestPartitioner do
# wraps an Agent that we use to capture the fact that the partitioner was
# called - normally one would not really need to do this
@@ -223,7 +222,7 @@ defmodule KafkaEx.ConsumerGroupImplementationTest do
consumer1_assignments =
consumer1_pid
|> GenConsumer.Supervisor.child_pids()
- |> Enum.map(&(GenConsumer.partition(&1, 30_000)))
+ |> Enum.map(&GenConsumer.partition(&1, 30_000))
|> Enum.sort()
assert consumer1_assignments == Enum.sort(assignments1)
@@ -234,7 +233,7 @@ defmodule KafkaEx.ConsumerGroupImplementationTest do
consumer2_assignments =
consumer2_pid
|> GenConsumer.Supervisor.child_pids()
- |> Enum.map(&(GenConsumer.partition(&1, 30_000)))
+ |> Enum.map(&GenConsumer.partition(&1, 30_000))
|> Enum.sort()
assert consumer2_assignments == Enum.sort(assignments2)

diff:
@@ -18,8 +18,7 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
alias KafkaEx.GenConsumer
alias KafkaEx.Protocol.OffsetFetch
- # note this topic is created by docker_up.sh
- @topic_name "consumer_group_implementation_test_kayrock"
+ @topic_name_prefix "consumer_group_implementation_test_kayrock_"
@partition_count 4
@consumer_group_name "consumer_group_implementation"
@@ -106,8 +105,8 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
end
end
- def produce(message, partition) do
- :ok = KafkaEx.produce(@topic_name, partition, message)
+ def produce(topic_name, message, partition) do
+ :ok = KafkaEx.produce(topic_name, partition, message)
message
end
@@ -170,14 +169,16 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
# the client will die on its own, so don't count that
ports_before = num_open_ports()
- {:ok, @topic_name} =
- TestHelper.ensure_append_timestamp_topic(client_pid, @topic_name)
+ topic_name = "#{@topic_name_prefix}#{:rand.uniform(2_000_000)}"
+
+ {:ok, topic_name} =
+ TestHelper.ensure_append_timestamp_topic(client_pid, topic_name)
{:ok, consumer_group_pid1} =
ConsumerGroup.start_link(
TestConsumer,
@consumer_group_name,
- [@topic_name],
+ [topic_name],
heartbeat_interval: 100,
partition_assignment_callback: &TestPartitioner.assign_partitions/2,
session_timeout_padding: 30000,
@@ -188,7 +189,7 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
ConsumerGroup.start_link(
TestConsumer,
@consumer_group_name,
- [@topic_name],
+ [topic_name],
heartbeat_interval: 100,
partition_assignment_callback: &TestPartitioner.assign_partitions/2,
session_timeout_padding: 30000,
@@ -211,12 +212,14 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
consumer_group_pid1: consumer_group_pid1,
consumer_group_pid2: consumer_group_pid2,
ports_before: ports_before,
- client: client_pid
+ client: client_pid,
+ topic_name: topic_name
}
end
test "basic startup, consume, and shutdown test", context do
assert num_open_ports() > context[:ports_before]
+ topic_name = context[:topic_name]
assert TestPartitioner.calls() > 0
@@ -288,7 +291,7 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
starting_offsets =
partition_range
|> Enum.map(fn px ->
- {px, TestHelper.latest_offset_number(@topic_name, px)}
+ {px, TestHelper.latest_offset_number(topic_name, px)}
end)
|> Enum.into(%{})
@@ -296,7 +299,7 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
partition_range
|> Enum.map(fn px ->
offset = Map.get(starting_offsets, px)
- {px, produce("M #{px} #{offset}", px)}
+ {px, produce(topic_name, "M #{px} #{offset}", px)}
end)
|> Enum.into(%{})
@@ -310,7 +313,7 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
last_offsets =
partition_range
|> Enum.map(fn px ->
- consumer_pid = Map.get(consumers, {@topic_name, px})
+ consumer_pid = Map.get(consumers, {topic_name, px})
TestHelper.wait_for(fn ->
message_set = TestConsumer.last_message_set(consumer_pid)
@@ -335,7 +338,7 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
TestHelper.wait_for(fn ->
ending_offset =
TestHelper.latest_consumer_offset_number(
- @topic_name,
+ topic_name,
px,
@consumer_group_name,
context[:client],
@@ -347,14 +350,14 @@ defmodule KafkaEx.KayrockCompatibilityConsumerGroupImplementationTest do
end)
end
- # ports should be released
- assert context[:ports_before] == num_open_ports()
+ # ports should be released, but this is unreliable
+ # assert context[:ports_before] == num_open_ports()
# since we're using v3 for OffsetCommit, we should get an error if we try to
# fetch with v0
[resp] =
KafkaEx.offset_fetch(context[:client], %OffsetFetch.Request{
- topic: @topic_name,
+ topic: topic_name,
consumer_group: @consumer_group_name,
partition: 0,
api_version: 0

diff:
@@ -19,7 +19,7 @@ defmodule KafkaEx.KayrockCompatibilityStreamingTest do
end
test "stream with kafka offset storage and timestamps", %{client: client} do
- topic = "kayrock_stream_test"
+ topic = "kayrock_stream_test_#{:rand.uniform(2_000_000)}"
partition = 0
consumer_group = "streamers"

diff:
@@ -109,10 +109,12 @@ defmodule KafkaEx.KayrockTimestampTest do
end
test "log with append time - v0", %{client: client} do
+ topic = "test_log_append_timestamp_#{:rand.uniform(2_000_000)}"
+
{:ok, topic} =
TestHelper.ensure_append_timestamp_topic(
client,
- "test_log_append_timestamp"
+ topic
)
msg = TestHelper.generate_random_string()
@@ -144,10 +146,12 @@ defmodule KafkaEx.KayrockTimestampTest do
end
test "log with append time - v3", %{client: client} do
+ topic = "test_log_append_timestamp_#{:rand.uniform(2_000_000)}"
+
{:ok, topic} =
TestHelper.ensure_append_timestamp_topic(
client,
- "test_log_append_timestamp"
+ topic
)
msg = TestHelper.generate_random_string()
@@ -180,10 +184,12 @@ defmodule KafkaEx.KayrockTimestampTest do
end
test "log with append time - v5", %{client: client} do
+ topic = "test_log_append_timestamp_#{:rand.uniform(2_000_000)}"
+
{:ok, topic} =
TestHelper.ensure_append_timestamp_topic(
client,
- "test_log_append_timestamp"
+ topic
)
msg = TestHelper.generate_random_string()

diff:
@@ -116,6 +116,8 @@ defmodule TestHelper do
topic_errors: [%{error_code: error_code}]
}} = resp
+ wait_for_topic_to_appear(client, topic_name)
+
if error_code in [0, 36] do
{:ok, topic_name}
else
@@ -124,6 +126,23 @@ defmodule TestHelper do
end
end
+ defp wait_for_topic_to_appear(_client, _topic_name, attempts \\ 10)
+
+ defp wait_for_topic_to_appear(_client, _topic_name, attempts) when attempts <= 0 do
+ raise "Timeout while waiting for topic to appear"
+ end
+
+ defp wait_for_topic_to_appear(client, topic_name, attempts) do
+ {:ok, %{topic_metadata: topic_metadata}} =
+ Client.send_request(client, %Kayrock.Metadata.V0.Request{}, NodeSelector.controller())
+
+ topics = topic_metadata |> Enum.map(&(&1.topic))
+
+ unless topic_name in topics do
+ wait_for_topic_to_appear(client, topic_name, attempts - 1)
+ end
+ end
+
defp first_partition_offset(:topic_not_found) do
nil
end


change_type: MODIFY

diff:
@@ -9,15 +9,12 @@ cache:
matrix:
include:
- elixir: 1.9.4
- # stick to OTP release 21.3 for now.
- # We have problems with SSL and OTP 22
- # https://github.com/kafkaex/kafka_ex/issues/389
- otp_release: 21.3
+ otp_release: 22.3.3
env: COVERALLS=true CREDO=true
- elixir: 1.8.2
- otp_release: 21.3
+ otp_release: 22.3.3
- elixir: 1.7.4
- otp_release: 21.3
+ otp_release: 22.3.3
- elixir: 1.6.6
otp_release: 20.3
- elixir: 1.5.3

diff:
@@ -146,6 +146,18 @@ for a description of configuration variables, including the Kafka broker list
You can also override options when creating a worker, see below.
+## Timeouts with SSL
+
+When using certain versions of OTP,
+[random timeouts can occur if using SSL](https://github.com/kafkaex/kafka_ex/issues/389).
+
+Impacted versions:
+
+* OTP 21.3.8.1 -> 21.3.8.14
+* OTP 22.1 -> 22.3.1
+
+Upgrade respectively to 21.3.8.15 or 22.3.2 to solve this.
+
## Usage Examples
### Consumer Groups

license: MIT License

original_message: Timeout errors: ensure version of OTP in CI + document in README. Closes #389


message: Improve docker-compose by adding healthcheck condition at startup

diff:
use Mix.Config
-config :ex_unit, capture_log: true
+config :ex_unit, capture_log: is_nil(System.get_env("SHOW_LOGS"))
config :kafka_ex,
sync_timeout: 60_000
+
+# Help debug tests that are tricky to understand
+config :logger, :console,
+ format: "$time [$level] [$metadata] $message\n",
+ metadata: [:module, :function, :pid]

diff:
@@ -17,7 +17,7 @@ KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS=6000
# alternative to KAFKA_ADVERTISED_HOST_NAME is: HOSTNAME_COMMAND: ip addr | grep -o "inet [0-9.]*" | grep -v "127\.0\.0\.1" | grep -o "[0-9.]*"
KAFKA_ADVERTISED_HOST_NAME=localhost
-KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INSIDE:SSL,OUTSIDE:SSL
+KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INSIDE:PLAINTEXT,OUTSIDE:SSL
KAFKA_ADVERTISED_PROTOCOL_NAME=OUTSIDE
KAFKA_PROTOCOL_NAME=INSIDE

diff:
-version: '3.2'
+version: '2.4'
services:
zookeeper:
image: wurstmeister/zookeeper:3.4.6
ports:
- "2181:2181"
+ healthcheck:
+ test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep -q imok"]
+ interval: 5s
+ timeout: 10s
+ retries: 15
+ start_period: 10s
+
kafka1:
+ hostname: kafka1
image: wurstmeister/kafka:0.11.0.1
ports:
- "9093:9093"
@@ -13,12 +21,25 @@ services:
- zookeeper
volumes:
- ./ssl:/ssl
+ - ./scripts/kafka_check_health:/kafka_check_health
env_file: docker-compose-kafka.env
environment:
KAFKA_BROKER_ID: 1
KAFKA_ADVERTISED_PORT: 9093
+ KAFKA_PORT: 9092
+ KAFKA_HOST_NAME: kafka1
+ healthcheck:
+ test: /kafka_check_health
+ interval: 10s
+ timeout: 10s
+ retries: 30
+ start_period: 10s
+ depends_on:
+ zookeeper:
+ condition: service_healthy
kafka2:
+ hostname: kafka2
image: wurstmeister/kafka:0.11.0.1
ports:
- "9094:9094"
@@ -26,12 +47,25 @@ services:
- zookeeper
volumes:
- ./ssl:/ssl
+ - ./scripts/kafka_check_health:/kafka_check_health
env_file: docker-compose-kafka.env
environment:
KAFKA_BROKER_ID: 2
KAFKA_ADVERTISED_PORT: 9094
+ KAFKA_PORT: 9092
+ KAFKA_HOST_NAME: kafka2
+ healthcheck:
+ test: /kafka_check_health
+ interval: 10s
+ timeout: 10s
+ retries: 30
+ start_period: 10s
+ depends_on:
+ zookeeper:
+ condition: service_healthy
kafka3:
+ hostname: kafka3
image: wurstmeister/kafka:0.11.0.1
ports:
- "9095:9095"
@@ -39,7 +73,32 @@ services:
- zookeeper
volumes:
- ./ssl:/ssl
+ - ./scripts/kafka_check_health:/kafka_check_health
env_file: docker-compose-kafka.env
environment:
KAFKA_BROKER_ID: 3
KAFKA_ADVERTISED_PORT: 9095
+ KAFKA_PORT: 9092
+ KAFKA_HOST_NAME: kafka3
+ healthcheck:
+ test: /kafka_check_health
+ interval: 10s
+ timeout: 10s
+ retries: 30
+ start_period: 10s
+ depends_on:
+ zookeeper:
+ condition: service_healthy
+
+ # This is a dummy service that forces all other services to be healthy before
+ # docker-compose up can be considered successful.
+ ready:
+ image: busybox:1.31-musl
+ command: tail -f /dev/null
+ depends_on:
+ kafka1:
+ condition: service_healthy
+ kafka2:
+ condition: service_healthy
+ kafka3:
+ condition: service_healthy

change_type: ADD

diff:
+#! /bin/bash
+
+cd $(dirname $0)
+
+broker_ready() {
+ # Inspired by: https://github.com/wurstmeister/kafka-docker/issues/167#issuecomment-439849789
+ current_broker=$(cat $KAFKA_HOME/config/server.properties | awk 'BEGIN{FS="="}/^broker.id=/{print $2}')
+ brokers=$($KAFKA_HOME/bin/zookeeper-shell.sh zookeeper:2181 <<< "ls /brokers/ids" | tail -1)
+
+ echo "brokers: $brokers"
+ echo "current_broker: $current_broker"
+
+ echo "${brokers}" | jq '.[]' | grep -q "^${current_broker}$";
+ return $?
+}
+
+#######################
+
+broker_ready
+
+#######################


message: Apply 'mix format' on the project

diff:
@@ -81,9 +81,8 @@ defmodule KafkaEx.ConsumerGroup.Heartbeat do
{:stop, {:shutdown, {:error, error_code}}, state}
{:error, reason} ->
- Logger.warn("Heartbeat failed, got error reason #{inspect reason}")
+ Logger.warn("Heartbeat failed, got error reason #{inspect(reason)}")
{:stop, {:shutdown, {:error, reason}}, state}
-
end
end
end

diff:
@@ -21,6 +21,8 @@ defmodule KafkaEx.New.Broker do
broker.socket != nil && Socket.open?(broker.socket)
end
- def has_socket?(%__MODULE__{socket: %Socket{socket: socket}}, socket), do: true
+ def has_socket?(%__MODULE__{socket: %Socket{socket: socket}}, socket),
+ do: true
+
def has_socket?(_, _), do: false
end

diff:
@@ -22,7 +22,9 @@ defmodule KafkaEx.Protocol.Common do
mod
) do
struct_module = Module.concat(mod, Response)
- {partitions, topics_data} = mod.parse_partitions(partitions_size, rest, [], topic)
+
+ {partitions, topics_data} =
+ mod.parse_partitions(partitions_size, rest, [], topic)
[
%{

diff:
@@ -54,7 +54,11 @@ defmodule KafkaEx.Protocol.CreateTopics do
defmodule Request do
@moduledoc false
defstruct create_topic_requests: nil, timeout: nil
- @type t :: %Request{create_topic_requests: [TopicRequest.t()], timeout: integer}
+
+ @type t :: %Request{
+ create_topic_requests: [TopicRequest.t()],
+ timeout: integer
+ }
end
defmodule TopicError do

diff:
@@ -29,13 +29,15 @@ defmodule KafkaEx.Protocol.JoinGroup do
member_id: nil,
members: []
- @type t :: %Response{
+ @type t ::
+ %Response{
error_code: atom | integer,
generation_id: integer,
leader_id: binary,
member_id: binary,
members: [binary]
- } | {:error, atom}
+ }
+ | {:error, atom}
def leader?(%__MODULE__{member_id: member_id, leader_id: leader_id}) do
member_id == leader_id

diff:
@@ -14,9 +14,11 @@ defmodule KafkaEx.Protocol.LeaveGroup do
defstruct error_code: nil
- @type t :: %Response{
+ @type t ::
+ %Response{
error_code: atom | integer
- } | {:error, atom}
+ }
+ | {:error, atom}
end
@spec create_request(integer, binary, Request.t()) :: binary

diff:
@@ -103,7 +103,8 @@ defmodule KafkaEx.Protocol.Produce do
{message, msize} = create_message(compressed_message_set, nil, attribute)
- {[<<0::64-signed>>, <<msize::32-signed>>, message], @int64_size + @int32_size + msize}
+ {[<<0::64-signed>>, <<msize::32-signed>>, message],
+ @int64_size + @int32_size + msize}
end
defp create_message_set_uncompressed([

diff:
@@ -401,7 +401,11 @@ defmodule KafkaEx.Server do
produce_request_data =
try do
- Produce.create_request(correlation_id, Config.client_id(), produce_request)
+ Produce.create_request(
+ correlation_id,
+ Config.client_id(),
+ produce_request
+ )
rescue
e in FunctionClauseError -> nil
end
@@ -762,13 +766,15 @@ defmodule KafkaEx.Server do
check_brokers_sockets!(brokers)
- {correlation_id, metadata} = try do
+ {correlation_id, metadata} =
+ try do
retrieve_metadata(
brokers,
0,
config_sync_timeout()
)
- rescue e ->
+ rescue
+ e ->
sleep_for_reconnect()
Kernel.reraise(e, System.stacktrace())
end
@@ -800,7 +806,8 @@ defmodule KafkaEx.Server do
end
defp check_brokers_sockets!(brokers) do
- any_socket_opened = brokers
+ any_socket_opened =
+ brokers
|> Enum.any?(fn %Broker{socket: socket} -> not is_nil(socket) end)
if not any_socket_opened do
@@ -1000,7 +1007,9 @@ defmodule KafkaEx.Server do
Application.get_env(:kafka_ex, :partitioner, KafkaEx.DefaultPartitioner)
end
- defp increment_state_correlation_id(%_{correlation_id: correlation_id} = state) do
+ defp increment_state_correlation_id(
+ %_{correlation_id: correlation_id} = state
+ ) do
%{state | correlation_id: correlation_id + 1}
end
end

diff:
@@ -96,20 +96,22 @@ defmodule KafkaEx.Server0P10AndLater do
check_brokers_sockets!(brokers)
{_,
-
%KafkaEx.Protocol.ApiVersions.Response{
api_versions: api_versions,
error_code: error_code
}, state} = kafka_server_api_versions(%State{brokers: brokers})
+
if error_code == :no_response do
sleep_for_reconnect()
raise "Brokers sockets are closed"
end
+
:no_error = error_code
api_versions = KafkaEx.ApiVersions.api_versions_map(api_versions)
- {correlation_id, metadata} = try do
+ {correlation_id, metadata} =
+ try do
retrieve_metadata(
brokers,
state.correlation_id,
@@ -117,7 +119,8 @@ defmodule KafkaEx.Server0P10AndLater do
[],
api_versions
)
- rescue e ->
+ rescue
+ e ->
sleep_for_reconnect()
Kernel.reraise(e, System.stacktrace())
end

diff:
@@ -101,9 +101,11 @@ defmodule KafkaEx.Server0P9P0 do
check_brokers_sockets!(brokers)
- {correlation_id, metadata} = try do
+ {correlation_id, metadata} =
+ try do
retrieve_metadata(brokers, 0, config_sync_timeout())
- rescue e ->
+ rescue
+ e ->
sleep_for_reconnect()
Kernel.reraise(e, System.stacktrace())
end

diff:
@@ -104,19 +104,23 @@ defmodule KafkaEx.New.Client.Test do
test "client can receive {:ssl_closed, _}", %{client: client} do
send(client, {:ssl_closed, :unused})
+
TestHelper.wait_for(fn ->
{:message_queue_len, m} = Process.info(client, :message_queue_len)
m == 0
end)
+
assert Process.alive?(client)
end
test "client can receive {:tcp_closed, _}", %{client: client} do
send(client, {:tcp_closed, :unused})
+
TestHelper.wait_for(fn ->
{:message_queue_len, m} = Process.info(client, :message_queue_len)
m == 0
end)
+
assert Process.alive?(client)
end
end

diff:
@@ -5,12 +5,15 @@ defmodule KafkaEx.Utils.MurmurTest do
test "murmur2 correctly encodes strings" do
# Taken from https://github.com/apache/kafka/blob/8ab0994919752cd4870e771221ba934a6a539a67/clients/src/test/java/org/apache/kafka/common/utils/UtilsTest.java#L66-L78
- assert Murmur.murmur2("21") == -973932308
- assert Murmur.murmur2("foobar") == -790332482
- assert Murmur.murmur2("a-little-bit-long-string") == -985981536
- assert Murmur.murmur2("a-little-bit-longer-string") == -1486304829
- assert Murmur.murmur2("lkjh234lh9fiuh90y23oiuhsafujhadof229phr9h19h89h8") == -58897971
- assert Murmur.murmur2("abc") == 479470107
+ assert Murmur.murmur2("21") == -973_932_308
+ assert Murmur.murmur2("foobar") == -790_332_482
+ assert Murmur.murmur2("a-little-bit-long-string") == -985_981_536
+ assert Murmur.murmur2("a-little-bit-longer-string") == -1_486_304_829
+
+ assert Murmur.murmur2("lkjh234lh9fiuh90y23oiuhsafujhadof229phr9h19h89h8") ==
+ -58_897_971
+
+ assert Murmur.murmur2("abc") == 479_470_107
end
test "umurmur2 correctly encodes strings" do

diff:
@@ -3,29 +3,64 @@ defmodule KafkaEx.Protocol.DeleteTopicsTest do
describe "create_request/4" do
test "creates a request to delete a single topic" do
- expected_request = <<20::16, 0::16, 999::32, 13::16, "the-client-id"::binary, 1::32-signed, 6::16, "topic1"::binary, 100::32-signed>>
- delete_request = %KafkaEx.Protocol.DeleteTopics.Request{topics: ["topic1"], timeout: 100}
+ expected_request =
+ <<20::16, 0::16, 999::32, 13::16, "the-client-id"::binary, 1::32-signed,
+ 6::16, "topic1"::binary, 100::32-signed>>
- delete_response = KafkaEx.Protocol.DeleteTopics.create_request(999, "the-client-id", delete_request, 0)
+ delete_request = %KafkaEx.Protocol.DeleteTopics.Request{
+ topics: ["topic1"],
+ timeout: 100
+ }
+
+ delete_response =
+ KafkaEx.Protocol.DeleteTopics.create_request(
+ 999,
+ "the-client-id",
+ delete_request,
+ 0
+ )
assert expected_request == delete_response
end
test "creates a request to delete a multiple topic" do
- expected_response = <<20::16, 0::16, 999::32, 13::16, "the-client-id"::binary, 3::32-signed, 6::16, "topic3"::binary, 6::16, "topic2"::binary, 6::16, "topic1"::binary, 100::32-signed>>
+ expected_response =
+ <<20::16, 0::16, 999::32, 13::16, "the-client-id"::binary, 3::32-signed,
+ 6::16, "topic3"::binary, 6::16, "topic2"::binary, 6::16,
+ "topic1"::binary, 100::32-signed>>
+
+ delete_request = %KafkaEx.Protocol.DeleteTopics.Request{
+ topics: ["topic1", "topic2", "topic3"],
+ timeout: 100
+ }
- delete_request = %KafkaEx.Protocol.DeleteTopics.Request{topics: ["topic1", "topic2", "topic3"], timeout: 100}
- delete_response = KafkaEx.Protocol.DeleteTopics.create_request(999, "the-client-id", delete_request, 0)
+ delete_response =
+ KafkaEx.Protocol.DeleteTopics.create_request(
+ 999,
+ "the-client-id",
+ delete_request,
+ 0
+ )
assert expected_response == delete_response
end
test "raise error when non-zero api_version is sent" do
- delete_request = %KafkaEx.Protocol.DeleteTopics.Request{topics: ["topic1"], timeout: 100}
+ delete_request = %KafkaEx.Protocol.DeleteTopics.Request{
+ topics: ["topic1"],
+ timeout: 100
+ }
assert_raise FunctionClauseError,
"no function clause matching in KafkaEx.Protocol.DeleteTopics.create_request/4",
- fn -> KafkaEx.Protocol.DeleteTopics.create_request(999, "the-client-id", delete_request, 1) end
+ fn ->
+ KafkaEx.Protocol.DeleteTopics.create_request(
+ 999,
+ "the-client-id",
+ delete_request,
+ 1
+ )
+ end
end
end
end

diff:
@@ -169,7 +169,15 @@ defmodule KafkaEx.Protocol.Fetch.Test do
hw_mark_offset: 10,
last_offset: 1,
message_set: [
- %Message{attributes: 0, crc: 0, key: key, offset: 1, value: nil, topic: topic, partition: 0}
+ %Message{
+ attributes: 0,
+ crc: 0,
+ key: key,
+ offset: 1,
+ value: nil,
+ topic: topic,
+ partition: 0
+ }
],
partition: 0
}
@@ -241,7 +249,15 @@ defmodule KafkaEx.Protocol.Fetch.Test do
hw_mark_offset: 10,
last_offset: 1,
message_set: [
- %Message{attributes: 0, crc: 0, key: nil, offset: 1, value: "baz", topic: topic, partition: 1}
+ %Message{
+ attributes: 0,
+ crc: 0,
+ key: nil,
+ offset: 1,
+ value: "baz",
+ topic: topic,
+ partition: 1
+ }
],
partition: 1
},
@@ -250,7 +266,15 @@ defmodule KafkaEx.Protocol.Fetch.Test do
hw_mark_offset: 10,
last_offset: 1,
message_set: [
- %Message{attributes: 0, crc: 0, key: nil, offset: 1, value: "bar", topic: topic, partition: 0}
+ %Message{
+ attributes: 0,
+ crc: 0,
+ key: nil,
+ offset: 1,
+ value: "bar",
+ topic: topic,
+ partition: 0
+ }
],
partition: 0
}
@@ -479,6 +503,7 @@ defmodule KafkaEx.Protocol.Fetch.Test do
test "parse_response correctly parses a valid response with batched snappy-encoded messages" do
partition_id = 0
+
response =
<<0, 0, 0, 14, 0, 0, 0, 1, 0, 17, 115, 110, 97, 112, 112, 121, 95, 98, 97,
116, 99, 104, 95, 116, 101, 115, 116, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,

original_message: Apply 'mix format' on the project


message: Fix indentation in Services; remove docker-compose up

diff:
@@ -106,8 +106,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
- name: Setup elixir
uses: actions/setup-elixir@v1
with:
@@ -119,7 +119,7 @@ jobs:
run: mix deps.compile
- name: Compile
run: mix compile --warnings-as-errors
- - name: Docker ps
- run: docker ps
+ # - name: Docker ps
+ # run: docker ps
- name: Run Tests
run: ./scripts/ci_tests.sh


message: Run CI on all branches

diff:
name: Elixir CI
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
+on: [push, pull_request]
+ # push:
+ # branches: [ master ]
+ # pull_request:
+ # branches: [ master ]
-env:
- MIX_ENV: test
jobs:
build:
runs-on: ubuntu-18.04
+ env:
+ MIX_ENV: test
strategy:
matrix:

original_message: Run CI on all branches


message: Remove duplicate depends_on in docker-compose.yml

diff:
@@ -17,8 +17,6 @@ services:
image: wurstmeister/kafka:0.11.0.1
ports:
- "9093:9093"
- depends_on:
- - zookeeper
volumes:
- ./ssl:/ssl
- ./scripts/kafka_check_health:/kafka_check_health
@@ -43,8 +41,6 @@ services:
image: wurstmeister/kafka:0.11.0.1
ports:
- "9094:9094"
- depends_on:
- - zookeeper
volumes:
- ./ssl:/ssl
- ./scripts/kafka_check_health:/kafka_check_health
@@ -69,8 +65,6 @@ services:
image: wurstmeister/kafka:0.11.0.1
ports:
- "9095:9095"
- depends_on:
- - zookeeper
volumes:
- ./ssl:/ssl
- ./scripts/kafka_check_health:/kafka_check_health


message: Try a straight dockerized CI mimicking Travis

diff:
+name: Elixir Dockerized CI
+
+on: [push, pull_request]
+ # push:
+ # branches: [ master ]
+ # pull_request:
+ # branches: [ master ]
+
+
+jobs:
+ build-dockerized:
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ # services:
+ # zookeeper:
+ # image: wurstmeister/zookeeper:3.4.6
+ # ports:
+ # - "2181:2181"
+ # healthcheck:
+ # test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep -q imok"]
+ # interval: 5s
+ # timeout: 10s
+ # retries: 15
+ # start_period: 10s
+
+ # kafka1:
+ # image: wurstmeister/kafka:0.11.0.1
+ # ports:
+ # - "9093:9093"
+ # volumes:
+ # - ./ssl:/ssl
+ # - ./scripts/kafka_check_health:/kafka_check_health
+ # env_file: docker-compose-kafka.env
+ # environment:
+ # KAFKA_BROKER_ID: 1
+ # KAFKA_ADVERTISED_PORT: 9093
+ # KAFKA_PORT: 9092
+ # KAFKA_HOST_NAME: kafka1
+ # healthcheck:
+ # test: /kafka_check_health
+ # interval: 10s
+ # timeout: 10s
+ # retries: 30
+ # start_period: 10s
+ # depends_on:
+ # zookeeper:
+ # condition: service_healthy
+
+ # kafka2:
+ # image: wurstmeister/kafka:0.11.0.1
+ # ports:
+ # - "9094:9094"
+ # volumes:
+ # - ./ssl:/ssl
+ # - ./scripts/kafka_check_health:/kafka_check_health
+ # env_file: docker-compose-kafka.env
+ # environment:
+ # KAFKA_BROKER_ID: 2
+ # KAFKA_ADVERTISED_PORT: 9094
+ # KAFKA_PORT: 9092
+ # KAFKA_HOST_NAME: kafka2
+ # healthcheck:
+ # test: /kafka_check_health
+ # interval: 10s
+ # timeout: 10s
+ # retries: 30
+ # start_period: 10s
+ # depends_on:
+ # zookeeper:
+ # condition: service_healthy
+
+ # kafka3:
+ # image: wurstmeister/kafka:0.11.0.1
+ # ports:
+ # - "9095:9095"
+ # volumes:
+ # - ./ssl:/ssl
+ # - ./scripts/kafka_check_health:/kafka_check_health
+ # env_file: docker-compose-kafka.env
+ # environment:
+ # KAFKA_BROKER_ID: 3
+ # KAFKA_ADVERTISED_PORT: 9095
+ # KAFKA_PORT: 9092
+ # KAFKA_HOST_NAME: kafka3
+ # healthcheck:
+ # test: /kafka_check_health
+ # interval: 10s
+ # timeout: 10s
+ # retries: 30
+ # start_period: 10s
+ # depends_on:
+ # zookeeper:
+ # condition: service_healthy
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+ - name: Install Dependencies
+ run: mix deps.get
+ - name: Build Dependencies
+ run: mix deps.compile
+ - name: Compile
+ run: mix compile --warnings-as-errors
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: ./scripts/ci_tests.sh


message: create test.yml to run CI Test Suite

change_type: DELETE

diff:
-name: Elixir Dockerized CI
-
-on: [push, pull_request]
- # push:
- # branches: [ master ]
- # pull_request:
- # branches: [ master ]
-
-
-jobs:
- build-dockerized:
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- # services:
- # zookeeper:
- # image: wurstmeister/zookeeper:3.4.6
- # ports:
- # - "2181:2181"
- # healthcheck:
- # test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep -q imok"]
- # interval: 5s
- # timeout: 10s
- # retries: 15
- # start_period: 10s
-
- # kafka1:
- # image: wurstmeister/kafka:0.11.0.1
- # ports:
- # - "9093:9093"
- # volumes:
- # - ./ssl:/ssl
- # - ./scripts/kafka_check_health:/kafka_check_health
- # env_file: docker-compose-kafka.env
- # environment:
- # KAFKA_BROKER_ID: 1
- # KAFKA_ADVERTISED_PORT: 9093
- # KAFKA_PORT: 9092
- # KAFKA_HOST_NAME: kafka1
- # healthcheck:
- # test: /kafka_check_health
- # interval: 10s
- # timeout: 10s
- # retries: 30
- # start_period: 10s
- # depends_on:
- # zookeeper:
- # condition: service_healthy
-
- # kafka2:
- # image: wurstmeister/kafka:0.11.0.1
- # ports:
- # - "9094:9094"
- # volumes:
- # - ./ssl:/ssl
- # - ./scripts/kafka_check_health:/kafka_check_health
- # env_file: docker-compose-kafka.env
- # environment:
- # KAFKA_BROKER_ID: 2
- # KAFKA_ADVERTISED_PORT: 9094
- # KAFKA_PORT: 9092
- # KAFKA_HOST_NAME: kafka2
- # healthcheck:
- # test: /kafka_check_health
- # interval: 10s
- # timeout: 10s
- # retries: 30
- # start_period: 10s
- # depends_on:
- # zookeeper:
- # condition: service_healthy
-
- # kafka3:
- # image: wurstmeister/kafka:0.11.0.1
- # ports:
- # - "9095:9095"
- # volumes:
- # - ./ssl:/ssl
- # - ./scripts/kafka_check_health:/kafka_check_health
- # env_file: docker-compose-kafka.env
- # environment:
- # KAFKA_BROKER_ID: 3
- # KAFKA_ADVERTISED_PORT: 9095
- # KAFKA_PORT: 9092
- # KAFKA_HOST_NAME: kafka3
- # healthcheck:
- # test: /kafka_check_health
- # interval: 10s
- # timeout: 10s
- # retries: 30
- # start_period: 10s
- # depends_on:
- # zookeeper:
- # condition: service_healthy
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- - name: Install Dependencies
- run: mix deps.get
- - name: Build Dependencies
- run: mix deps.compile
- - name: Compile
- run: mix compile --warnings-as-errors
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: ./scripts/ci_tests.sh

diff:
-name: Elixir CI
-
-on: [push, pull_request]
- # push:
- # branches: [ master ]
- # pull_request:
- # branches: [ master ]
-
-
-jobs:
- build:
-
- runs-on: ubuntu-18.04
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- services:
- zookeeper:
- image: wurstmeister/zookeeper:3.4.6
- ports:
- - "2181:2181"
- healthcheck:
- test: ["CMD-SHELL", "echo ruok | nc -w 2 127.0.0.1 2181 | grep -q imok"]
- interval: 5s
- timeout: 10s
- retries: 15
- start_period: 10s
-
- kafka1:
- hostname: kafka1
- image: wurstmeister/kafka:0.11.0.1
- ports:
- - "9093:9093"
- volumes:
- - ./ssl:/ssl
- - ./scripts/kafka_check_health:/kafka_check_health
- env_file: docker-compose-kafka.env
- environment:
- KAFKA_BROKER_ID: 1
- KAFKA_ADVERTISED_PORT: 9093
- KAFKA_PORT: 9092
- KAFKA_HOST_NAME: kafka1
- healthcheck:
- test: /kafka_check_health
- interval: 10s
- timeout: 10s
- retries: 30
- start_period: 10s
- depends_on:
- zookeeper:
- condition: service_healthy
-
- kafka2:
- hostname: kafka2
- image: wurstmeister/kafka:0.11.0.1
- ports:
- - "9094:9094"
- volumes:
- - ./ssl:/ssl
- - ./scripts/kafka_check_health:/kafka_check_health
- env_file: docker-compose-kafka.env
- environment:
- KAFKA_BROKER_ID: 2
- KAFKA_ADVERTISED_PORT: 9094
- KAFKA_PORT: 9092
- KAFKA_HOST_NAME: kafka2
- healthcheck:
- test: /kafka_check_health
- interval: 10s
- timeout: 10s
- retries: 30
- start_period: 10s
- depends_on:
- zookeeper:
- condition: service_healthy
-
- kafka3:
- hostname: kafka3
- image: wurstmeister/kafka:0.11.0.1
- ports:
- - "9095:9095"
- volumes:
- - ./ssl:/ssl
- - ./scripts/kafka_check_health:/kafka_check_health
- env_file: docker-compose-kafka.env
- environment:
- KAFKA_BROKER_ID: 3
- KAFKA_ADVERTISED_PORT: 9095
- KAFKA_PORT: 9092
- KAFKA_HOST_NAME: kafka3
- healthcheck:
- test: /kafka_check_health
- interval: 10s
- timeout: 10s
- retries: 30
- start_period: 10s
- depends_on:
- zookeeper:
- condition: service_healthy
-
- steps:
- - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- - name: Install Dependencies
- run: mix deps.get
- - name: Build Dependencies
- run: mix deps.compile
- - name: Compile
- run: mix compile --warnings-as-errors
- # - name: Docker ps
- # run: docker ps
- - name: Run Tests
- run: ./scripts/ci_tests.sh

diff:
+name: Elixir CI
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+
+jobs:
+ test-dockerized:
+ name: runner / Test Suite
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+ - name: Install Dependencies
+ run: mix deps.get
+ - name: Build Dependencies
+ run: mix deps.compile
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: ./scripts/ci_tests.sh
\ No newline at end of file

original_message: create test.yml to run CI Test Suite


message: Add common Checks to Github actions CI

diff:
+name: Elixir Checks
+
+on: [push, pull_request]
+ # push:
+ # branches: [ master ]
+ # pull_request:
+ # branches: [ master ]
+
+
+jobs:
+ setup:
+ name: runner / cache dependencies
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: dev
+ ACTIONS_ALLOW_UNSECURE_COMMANDS: true
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+ - name: Install Mix Dependencies
+ if: steps.mix-cache.outputs.cache-hit != 'true'
+ run: |
+ mix local.rebar --force
+ mix local.hex --force
+ mix deps.get
+
+ - name: Compile Mix Dependencies
+ if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
+ run: mix deps.compile
+
+
+
+ compile:
+ name: runner / Compiler warnings as errors
+ runs-on: ubuntu-latest
+ needs: [setup]
+ env:
+ MIX_ENV: dev
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Compile
+ run: mix compile --warnings-as-errors --force
+
+ credo:
+ name: check / credo
+ runs-on: ubuntu-latest
+ needs: [setup]
+ env:
+ MIX_ENV: dev
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Credo
+ run: mix credo --strict
+
+ formatter:
+ name: check / formatter
+ runs-on: ubuntu-latest
+ needs: [setup]
+ env:
+ MIX_ENV: dev
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Check Formatting
+ run: mix format --check-formatted
+
+ dialyzer:
+ name: check / dialyzer
+ needs: [setup]
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: dev
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve PLT Cache
+ uses: actions/cache@v1
+ id: plt-cache
+ with:
+ path: priv/plts
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Create PLTs
+ if: steps.plt-cache.outputs.cache-hit != 'true'
+ run: |
+ mkdir -p priv/plts
+ mix dialyzer --plt
+
+ - name: Run dialyzer
+ run: mix dialyzer --no-check --halt-exit-status
+
+
+
+
+
\ No newline at end of file

diff:
@@ -18,6 +18,7 @@ defmodule KafkaEx.Mixfile do
description: description(),
package: package(),
deps: deps(),
+ dialyzer: dialyzer(),
docs: [
main: "readme",
extras: [
@@ -68,4 +69,11 @@ defmodule KafkaEx.Mixfile do
links: %{"Github" => "https://github.com/kafkaex/kafka_ex"}
]
end
+
+ defp dialyzer do
+ [
+ plt_core_path: "priv/plts",
+ plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
+ ]
+ end
end

original_message: Add common Checks to Github actions CI


message: Split integration test stages up

diff:
@@ -6,10 +6,51 @@ on:
pull_request:
branches: [master]
-
jobs:
- test-dockerized:
- name: runner / Test Suite
+ setup:
+ name: runner / setup
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+ - name: Install Mix Dependencies
+ if: steps.mix-cache.outputs.cache-hit != 'true'
+ run: |
+ mix local.rebar --force
+ mix local.hex --force
+ mix deps.get
+
+ - name: Compile Mix Dependencies
+ if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
+ run: mix deps.compile
+
+ test-integration:
+ name: runner / Test Integration
runs-on: ubuntu-latest
env:
@@ -30,11 +71,310 @@ jobs:
with:
elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- - name: Install Dependencies
- run: mix deps.get
- - name: Build Dependencies
- run: mix deps.compile
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include integration
+
+ test-consumer_group:
+ name: runner / Test consumer_group
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include consumer_group
+ test-server_0_p_10_and_later:
+ name: runner / Test server_0_p_10_and_later
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include server_0_p_10_and_later
+ test-server_0_p_10_p_1:
+ name: runner / Test server_0_p_10_p_1
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include server_0_p_10_p_1
+ test-server_0_p_9_p_0:
+ name: runner / Test server_0_p_9_p_0
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include server_0_p_9_p_0
+ test-server_0_p_8_p_0:
+ name: runner / Test server_0_p_8_p_0
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include server_0_p_8_p_0
+ test-new_client:
+ name: runner / Test new_client
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Docker ps
+ run: docker ps
+ - name: Run Tests
+ run: mix test --include new_client
+ test:
+ name: runner / Test new_client
+
+ runs-on: ubuntu-latest
+ env:
+ MIX_ENV: test
+
+ strategy:
+ matrix:
+ include:
+ - elixir: 1.10.2
+ erlang: 22.3
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
+ - name: Setup elixir
+ uses: actions/setup-elixir@v1
+ with:
+ elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ - name: Retrieve Mix Dependencies Cache
+ uses: actions/cache@v2
+ id: mix-cache # id to use in retrieve action
+ with:
+ path: deps
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ - name: Retrieve Mix Dependencies Compilation Cache
+ uses: actions/cache@v2
+ id: mix-deps-compile-cache # id to use in retrieve action
+ with:
+ path: _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
- name: Docker ps
run: docker ps
- name: Run Tests
- run: ./scripts/ci_tests.sh
\ No newline at end of file
+ run: mix test

original_message: Split integration test stages up


message: run test suite on push for testing

diff:
-name: Elixir CI
+name: Test Runner
-on:
- push:
- branches: [master]
- pull_request:
- branches: [master]
+on: [push, pull_request]
+ # push:
+ # branches: [master]
+ # pull_request:
+ # branches: [master]
jobs:
setup:

original_message: run test suite on push for testing


message: test - wait for setup stage to cache deps

diff:
@@ -51,6 +51,7 @@ jobs:
test-integration:
name: runner / Test Integration
+ needs: [setup]
runs-on: ubuntu-latest
env:
@@ -97,6 +98,7 @@ jobs:
runs-on: ubuntu-latest
env:
MIX_ENV: test
+ needs: [setup]
strategy:
matrix:
@@ -134,6 +136,7 @@ jobs:
run: mix test --include consumer_group
test-server_0_p_10_and_later:
name: runner / Test server_0_p_10_and_later
+ needs: [setup]
runs-on: ubuntu-latest
env:
@@ -175,6 +178,7 @@ jobs:
run: mix test --include server_0_p_10_and_later
test-server_0_p_10_p_1:
name: runner / Test server_0_p_10_p_1
+ needs: [setup]
runs-on: ubuntu-latest
env:
@@ -216,6 +220,7 @@ jobs:
run: mix test --include server_0_p_10_p_1
test-server_0_p_9_p_0:
name: runner / Test server_0_p_9_p_0
+ needs: [setup]
runs-on: ubuntu-latest
env:
@@ -257,6 +262,7 @@ jobs:
run: mix test --include server_0_p_9_p_0
test-server_0_p_8_p_0:
name: runner / Test server_0_p_8_p_0
+ needs: [setup]
runs-on: ubuntu-latest
env:
@@ -298,6 +304,7 @@ jobs:
run: mix test --include server_0_p_8_p_0
test-new_client:
name: runner / Test new_client
+ needs: [setup]
runs-on: ubuntu-latest
env:
@@ -339,6 +346,7 @@ jobs:
run: mix test --include new_client
test:
name: runner / Test new_client
+ needs: [setup]
runs-on: ubuntu-latest
env:


message: Try running test suite args with matrix

diff:
@@ -49,303 +49,8 @@ jobs:
if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- test-integration:
- name: runner / Test Integration
- needs: [setup]
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include integration
-
- test-consumer_group:
- name: runner / Test consumer_group
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
- needs: [setup]
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include consumer_group
- test-server_0_p_10_and_later:
- name: runner / Test server_0_p_10_and_later
- needs: [setup]
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include server_0_p_10_and_later
- test-server_0_p_10_p_1:
- name: runner / Test server_0_p_10_p_1
- needs: [setup]
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include server_0_p_10_p_1
- test-server_0_p_9_p_0:
- name: runner / Test server_0_p_9_p_0
- needs: [setup]
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include server_0_p_9_p_0
- test-server_0_p_8_p_0:
- name: runner / Test server_0_p_8_p_0
- needs: [setup]
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include server_0_p_8_p_0
- test-new_client:
- name: runner / Test new_client
- needs: [setup]
-
- runs-on: ubuntu-latest
- env:
- MIX_ENV: test
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
- uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Docker ps
- run: docker ps
- - name: Run Tests
- run: mix test --include new_client
test:
- name: runner / Test new_client
+ name: runner / Test Integration
needs: [setup]
runs-on: ubuntu-latest
@@ -354,6 +59,16 @@ jobs:
strategy:
matrix:
+ test_args: [
+ "--include integration",
+ "--include consumer_group",
+ "--include server_0_p_10_and_later",
+ "--include server_0_p_10_p_1",
+ "--include server_0_p_9_p_0",
+ "--include server_0_p_8_p_0",
+ "--include new_client",
+ ""
+ ]
include:
- elixir: 1.10.2
erlang: 22.3
@@ -385,4 +100,299 @@ jobs:
- name: Docker ps
run: docker ps
- name: Run Tests
- run: mix test
+ run: mix test ${{ matrix.test_args }}
+
+ # test-consumer_group:
+ # name: runner / Test consumer_group
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+ # needs: [setup]
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test --include consumer_group
+ # test-server_0_p_10_and_later:
+ # name: runner / Test server_0_p_10_and_later
+ # needs: [setup]
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test --include server_0_p_10_and_later
+ # test-server_0_p_10_p_1:
+ # name: runner / Test server_0_p_10_p_1
+ # needs: [setup]
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test --include server_0_p_10_p_1
+ # test-server_0_p_9_p_0:
+ # name: runner / Test server_0_p_9_p_0
+ # needs: [setup]
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test --include server_0_p_9_p_0
+ # test-server_0_p_8_p_0:
+ # name: runner / Test server_0_p_8_p_0
+ # needs: [setup]
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test --include server_0_p_8_p_0
+ # test-new_client:
+ # name: runner / Test new_client
+ # needs: [setup]
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test --include new_client
+ # test:
+ # name: runner / Test new_client
+ # needs: [setup]
+
+ # runs-on: ubuntu-latest
+ # env:
+ # MIX_ENV: test
+
+ # strategy:
+ # matrix:
+ # include:
+ # - elixir: 1.10.2
+ # erlang: 22.3
+
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Docker-compose up
+ # run: ./scripts/docker_up.sh
+ # - name: Setup elixir
+ # uses: actions/setup-elixir@v1
+ # with:
+ # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
+ # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+
+ # - name: Retrieve Mix Dependencies Cache
+ # uses: actions/cache@v2
+ # id: mix-cache # id to use in retrieve action
+ # with:
+ # path: deps
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Retrieve Mix Dependencies Compilation Cache
+ # uses: actions/cache@v2
+ # id: mix-deps-compile-cache # id to use in retrieve action
+ # with:
+ # path: _build
+ # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+
+ # - name: Docker ps
+ # run: docker ps
+ # - name: Run Tests
+ # run: mix test

original_message: Try running test suite args with matrix


message: run Suit checks via matrix too

diff:
@@ -54,7 +54,7 @@ jobs:
compile:
- name: check / compile
+ name: check
runs-on: ubuntu-latest
needs: [setup]
env:
@@ -65,6 +65,10 @@ jobs:
include:
- elixir: 1.10.2
erlang: 22.3
+ checks:
+ - credo --struct
+ - compile --warnings-as-errors --force
+ - format --check-formatted
steps:
- uses: actions/checkout@v2
@@ -87,82 +91,7 @@ jobs:
path: _build
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- - name: Compile
- run: mix compile --warnings-as-errors --force
-
- credo:
- name: check / credo
- runs-on: ubuntu-latest
- needs: [setup]
- env:
- MIX_ENV: dev
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Credo
- run: mix credo --strict
-
- formatter:
- name: check / formatter
- runs-on: ubuntu-latest
- needs: [setup]
- env:
- MIX_ENV: dev
-
- strategy:
- matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-elixir@v1
- with:
- elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
- uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
- with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Check Formatting
- run: mix format --check-formatted
+ - run: mix ${{ matrix.checks }}
dialyzer:
name: check / dialyzer

original_message: run Suit checks via matrix too


message: Disable fast failures on test matrix

diff:
@@ -61,6 +61,7 @@ jobs:
MIX_ENV: dev
strategy:
+ fail-fast: false
matrix:
include:
- elixir: 1.10.2

diff:
name: Test Runner
-on: [push, pull_request]
+on:
+ [push, pull_request]
# push:
# branches: [master]
# pull_request:
@@ -58,17 +59,18 @@ jobs:
MIX_ENV: test
strategy:
+ fail-fast: false
matrix:
- test_args: [
- "--include integration",
- "--include consumer_group",
- "--include server_0_p_10_and_later",
- "--include server_0_p_10_p_1",
- "--include server_0_p_9_p_0",
- "--include server_0_p_8_p_0",
- "--include new_client",
- ""
- ]
+ test_args:
+ - "--include integration"
+ - "--include consumer_group"
+ - "--include server_0_p_10_and_later"
+ - "--include server_0_p_10_p_1"
+ - "--include server_0_p_9_p_0"
+ - "--include server_0_p_8_p_0"
+ - "--include new_client"
+ - ""
+
include:
- elixir: 1.10.2
erlang: 22.3
@@ -101,21 +103,17 @@ jobs:
run: docker ps
- name: Run Tests
run: mix test ${{ matrix.test_args }}
-
# test-consumer_group:
# name: runner / Test consumer_group
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
# needs: [setup]
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -125,21 +123,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests
@@ -147,17 +142,14 @@ jobs:
# test-server_0_p_10_and_later:
# name: runner / Test server_0_p_10_and_later
# needs: [setup]
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -167,21 +159,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests
@@ -189,17 +178,14 @@ jobs:
# test-server_0_p_10_p_1:
# name: runner / Test server_0_p_10_p_1
# needs: [setup]
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -209,21 +195,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests
@@ -231,17 +214,14 @@ jobs:
# test-server_0_p_9_p_0:
# name: runner / Test server_0_p_9_p_0
# needs: [setup]
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -251,21 +231,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests
@@ -273,17 +250,14 @@ jobs:
# test-server_0_p_8_p_0:
# name: runner / Test server_0_p_8_p_0
# needs: [setup]
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -293,21 +267,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests
@@ -315,17 +286,14 @@ jobs:
# test-new_client:
# name: runner / Test new_client
# needs: [setup]
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -335,21 +303,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests
@@ -357,17 +322,14 @@ jobs:
# test:
# name: runner / Test new_client
# needs: [setup]
-
# runs-on: ubuntu-latest
# env:
# MIX_ENV: test
-
# strategy:
# matrix:
# include:
# - elixir: 1.10.2
# erlang: 22.3
-
# steps:
# - uses: actions/checkout@v2
# - name: Docker-compose up
@@ -377,21 +339,18 @@ jobs:
# with:
# elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
# otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
# - name: Retrieve Mix Dependencies Cache
# uses: actions/cache@v2
# id: mix-cache # id to use in retrieve action
# with:
# path: deps
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Retrieve Mix Dependencies Compilation Cache
# uses: actions/cache@v2
# id: mix-deps-compile-cache # id to use in retrieve action
# with:
# path: _build
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
# - name: Docker ps
# run: docker ps
# - name: Run Tests

original_message: Disable fast failures on test matrix


message: Correct credo  runner command

diff:
@@ -54,7 +54,7 @@ jobs:
compile:
- name: check
+ name: checks
runs-on: ubuntu-latest
needs: [setup]
env:
@@ -67,7 +67,7 @@ jobs:
- elixir: 1.10.2
erlang: 22.3
checks:
- - credo --struct
+ - credo
- compile --warnings-as-errors --force
- format --check-formatted

original_message: Correct credo  runner command


message: improve naming and specify complete command in matrix

diff:
-name: Elixir Checks
-
-on: [push, pull_request]
- # push:
- # branches: [ master ]
- # pull_request:
- # branches: [ master ]
+name: CI Checks
+on:
+ push:
+ branches: [master]
+ pull_request:
+ branches: [master]
jobs:
setup:
@@ -51,10 +50,8 @@ jobs:
if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
run: mix deps.compile
-
-
- compile:
- name: checks
+ run-checks:
+ name: check
runs-on: ubuntu-latest
needs: [setup]
env:
@@ -67,9 +64,9 @@ jobs:
- elixir: 1.10.2
erlang: 22.3
checks:
- - credo
- - compile --warnings-as-errors --force
- - format --check-formatted
+ - mix credo
+ - mix compile --warnings-as-errors --force
+ - mix format --check-formatted
steps:
- uses: actions/checkout@v2
@@ -92,7 +89,7 @@ jobs:
path: _build
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- - run: mix ${{ matrix.checks }}
+ - run: ${{ matrix.checks }}
dialyzer:
name: check / dialyzer
@@ -143,8 +140,3 @@ jobs:
- name: Run dialyzer
run: mix dialyzer --no-check --halt-exit-status
-
-
-
-
-
\ No newline at end of file

diff:
-name: Test Runner
+name: CI Tests
on:
- [push, pull_request]
- # push:
- # branches: [master]
- # pull_request:
- # branches: [master]
+ push:
+ branches: [master]
+ pull_request:
+ branches: [master]
jobs:
setup:
@@ -51,7 +50,7 @@ jobs:
run: mix deps.compile
test:
- name: runner / Test Integration
+ name: runner / Test
needs: [setup]
runs-on: ubuntu-latest
@@ -61,15 +60,15 @@ jobs:
strategy:
fail-fast: false
matrix:
- test_args:
- - "--include integration"
- - "--include consumer_group"
- - "--include server_0_p_10_and_later"
- - "--include server_0_p_10_p_1"
- - "--include server_0_p_9_p_0"
- - "--include server_0_p_8_p_0"
- - "--include new_client"
- - ""
+ tests:
+ - mix test --include integration
+ - mix test --include consumer_group
+ - mix test --include server_0_p_10_and_later
+ - mix test --include server_0_p_10_p_1
+ - mix test --include server_0_p_9_p_0
+ - mix test --include server_0_p_8_p_0
+ - mix test --include new_client
+ - mix test
include:
- elixir: 1.10.2
@@ -102,256 +101,4 @@ jobs:
- name: Docker ps
run: docker ps
- name: Run Tests
- run: mix test ${{ matrix.test_args }}
- # test-consumer_group:
- # name: runner / Test consumer_group
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # needs: [setup]
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test --include consumer_group
- # test-server_0_p_10_and_later:
- # name: runner / Test server_0_p_10_and_later
- # needs: [setup]
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test --include server_0_p_10_and_later
- # test-server_0_p_10_p_1:
- # name: runner / Test server_0_p_10_p_1
- # needs: [setup]
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test --include server_0_p_10_p_1
- # test-server_0_p_9_p_0:
- # name: runner / Test server_0_p_9_p_0
- # needs: [setup]
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test --include server_0_p_9_p_0
- # test-server_0_p_8_p_0:
- # name: runner / Test server_0_p_8_p_0
- # needs: [setup]
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test --include server_0_p_8_p_0
- # test-new_client:
- # name: runner / Test new_client
- # needs: [setup]
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test --include new_client
- # test:
- # name: runner / Test new_client
- # needs: [setup]
- # runs-on: ubuntu-latest
- # env:
- # MIX_ENV: test
- # strategy:
- # matrix:
- # include:
- # - elixir: 1.10.2
- # erlang: 22.3
- # steps:
- # - uses: actions/checkout@v2
- # - name: Docker-compose up
- # run: ./scripts/docker_up.sh
- # - name: Setup elixir
- # uses: actions/setup-elixir@v1
- # with:
- # elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
- # otp-version: ${{matrix.erlang}} # Define the OTP version [required]
- # - name: Retrieve Mix Dependencies Cache
- # uses: actions/cache@v2
- # id: mix-cache # id to use in retrieve action
- # with:
- # path: deps
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Retrieve Mix Dependencies Compilation Cache
- # uses: actions/cache@v2
- # id: mix-deps-compile-cache # id to use in retrieve action
- # with:
- # path: _build
- # key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- # - name: Docker ps
- # run: docker ps
- # - name: Run Tests
- # run: mix test
+ run: ${{ matrix.tests }}


message: try tweaking kafka config to use fewer threads

diff:
+
#################################
# Common Kafka config
#################################
@@ -33,14 +34,16 @@ KAFKA_SSL_SECURE_RANDOM_IMPLEMENTATION=SHA1PRNG
######## Config
KAFKA_DELETE_TOPIC_ENABLE=true
-# KAFKA_NUM_NETWORK_THREADS=3
-# KAFKA_NUM_IO_THREADS=8
+KAFKA_NUM_NETWORK_THREADS=1
+KAFKA_NUM_IO_THREADS=1
+KAFKA_BACKGROUND_THREADS=1
+KAFKA_LOG_CLEANER_THREADS=0
# KAFKA_SOCKET_SEND_BUFFER_BYTES=102400
# KAFKA_SOCKET_RECEIVE_BUFFER_BYTES=102400
# KAFKA_SOCKET_REQUEST_MAX_BYTES=104857600
KAFKA_LOG_DIRS=/tmp/kafka_log
KAFKA_NUM_PARTITIONS=1
KAFKA_NUM_RECOVERY_THREADS_PER_DATA_DIR=1
-KAFKA_LOG_RETENTION_HOURS=168
+KAFKA_LOG_RETENTION_HOURS=1
# KAFKA_LOG_SEGMENT_BYTES=1073741824
# KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS=300000


message: Change default compression to :snappy

diff:
@@ -66,7 +66,7 @@ config :kafka_ex,
keyfile: File.cwd!() <> "/ssl/key.pem"
],
- snappy_module: :snappyer,
+ snappy_module: :snappy,
# set this to the version of the kafka broker that you are using
# include only major.minor.patch versions. must be at least 0.8.0
# use "kayrock" for the new client

original_message: Change default compression to :snappy


message: Change default snappy module

diff:
@@ -2,7 +2,7 @@ use Mix.Config
config :ex_unit, capture_log: is_nil(System.get_env("SHOW_LOGS"))
-config :kafka_ex, snappy_module: :snappyer
+config :kafka_ex, snappy_module: :snappy
config :kafka_ex, sync_timeout: 60_000

diff:
@@ -63,6 +63,6 @@ defmodule KafkaEx.Compression do
end
defp snappy_module do
- Application.get_env(:kafka_ex, :snappy_module, :snappyer)
+ Application.get_env(:kafka_ex, :snappy_module, :snappy)
end
end

original_message: Change default snappy module


message: Update metadata before looking for the controller when creating a topic

diff:
@@ -268,13 +268,17 @@ defmodule KafkaEx.Server0P10AndLater do
{:reply, response, state}
end
- defp request_to_controller(main_request, state) do
+ defp request_to_controller(main_request, stale_state) do
+ # We need to make sure that the metadata is up to date,
+ # to maximize the chance that the controller hasn't switched
+ # to another broker.
+ state = update_metadata(stale_state)
broker = state.brokers |> Enum.find(& &1.is_controller)
case broker do
nil ->
- Logger.log(:error, "Coordinator for topic is not available")
- {:topic_not_found, state}
+ Logger.log(:error, "Can't find the controller broker")
+ {:controller_broker_not_found, state}
_ ->
broker