Skip to content

Commit

Permalink
fix(ci): change otp 21 to 24 in github action
Browse files Browse the repository at this point in the history
and fix some flaky tests
  • Loading branch information
zmstone committed Jul 11, 2021
1 parent b138d67 commit b554087
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: kafka_protocol
on:
push:
branches:
- '*'
pull_request:
branches:
- master

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-20.04
Expand All @@ -22,7 +20,7 @@ jobs:
kafka-version: 1.1
- platform: ubuntu-20.04
lsb_release: focal
otp-version: 21.3.8.17-1
otp-version: 24.0.2-1
kafka-version: 0.11
runs-on: ${{ matrix.platform }}
steps:
Expand Down Expand Up @@ -61,5 +59,5 @@ jobs:
- name: Run tests
run: |
export KAFKA_VERSION=${{ matrix.kafka-version }}
sudo make testbed
make test-env
make eunit
4 changes: 4 additions & 0 deletions scripts/setup-test-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ TD="$(cd "$(dirname "$0")" && pwd)"
docker-compose -f $TD/docker-compose.yml down || true
docker-compose -f $TD/docker-compose.yml up -d

# give kafka some time
sleep 5

n=0
while [ "$(docker exec kafka-1 bash -c '/opt/kafka/bin/kafka-topics.sh --zookeeper localhost --list')" != '' ]; do
if [ $n -gt 4 ]; then
Expand Down Expand Up @@ -67,3 +70,4 @@ docker exec kafka-1 /opt/kafka/bin/kafka-consumer-groups.sh --bootstrap-server l
if [[ "$KAFKA_VERSION" != 0.9* ]] && [[ "$KAFKA_VERSION" != 0.10* ]]; then
docker exec kafka-1 /opt/kafka/bin/kafka-configs.sh --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[iterations=8192,password=ecila],SCRAM-SHA-512=[password=ecila]' --entity-type users --entity-name alice
fi

11 changes: 6 additions & 5 deletions test/kpro_group_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
%% 4. heartbeat-cycle, to tell broker that it is still alive
%% 5. leave_group
full_flow_test_() ->
[{atom_to_list(KafkaVsn),
fun() -> test_full_flow(KafkaVsn) end }
|| KafkaVsn <- kafka_vsns()].
[{timeout, 60,
{atom_to_list(KafkaVsn),
fun() -> test_full_flow(KafkaVsn) end }}
|| KafkaVsn <- kafka_vsns()].

test_full_flow(KafkaVsn) ->
GroupId = make_group_id(full_flow_test),
Expand Down Expand Up @@ -157,7 +158,7 @@ sync_group(Connection, GroupId, MemberId, Generation,
ok.

describe_groups(Connection, GroupId, KafkaVsn) ->
Groups = [GroupId, <<"unknown-group">>],
Groups = [GroupId],
Body = #{groups => Groups, include_authorized_operations => true},
Rsp = request_sync(Connection, describe_groups, Body, KafkaVsn),
#{groups := RspGroups} = Rsp,
Expand Down Expand Up @@ -206,7 +207,7 @@ heartbeat_loop(SendFun) ->
stop ->
exit(normal)
after
100 ->
1000 ->
heartbeat_loop(SendFun)
end.

Expand Down
6 changes: 3 additions & 3 deletions test/kpro_txn_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
%% basic test of begin -> write -> commit
txn_produce_test_() ->
{Vsns, FetchVsn} = produce_fetch_versions(),
[{"vsn=" ++ integer_to_list(V),
fun() -> test_txn_produce(V, FetchVsn) end
} || V <- Vsns].
{inorder, [{"vsn=" ++ integer_to_list(V),
fun() -> test_txn_produce(V, FetchVsn) end
} || V <- Vsns]}.

test_txn_produce(ProduceVsn, FetchVsn) ->
Topic = topic(),
Expand Down

0 comments on commit b554087

Please sign in to comment.