Skip to content

Commit

Permalink
chore: Erlang 26.2.5
Browse files Browse the repository at this point in the history
- Upgrades Sobelow and ignores a new false positive XSS warning
- Fixes a test failure caused by changes in :gen_server.start_link
- Fixes a test failure related to element ordering in ETS lookups
  • Loading branch information
bklebe committed Jun 6, 2024
1 parent 0cd0070 commit e592254
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
elixir 1.16.3-otp-25
erlang 25.3.2.12
elixir 1.16.3-otp-26
erlang 26.2.5
python 3.9.16
poetry 1.7.0
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ELIXIR_VERSION=1.16.3
ARG ERLANG_VERSION=25.3.2.12
ARG ALPINE_VERSION=3.17.7
ARG ERLANG_VERSION=26.2.5
ARG ALPINE_VERSION=3.20.0

FROM hexpm/elixir:${ELIXIR_VERSION}-erlang-${ERLANG_VERSION}-alpine-${ALPINE_VERSION} as builder

Expand Down Expand Up @@ -28,7 +28,7 @@ RUN mix release
# The one the elixir image was built with
FROM alpine:${ALPINE_VERSION}

RUN apk add --no-cache libssl1.1 dumb-init libstdc++ libgcc ncurses-libs && \
RUN apk add --no-cache libcrypto3 dumb-init libstdc++ libgcc ncurses-libs && \
mkdir /work /api && \
adduser -D api && chown api /work

Expand Down
7 changes: 6 additions & 1 deletion apps/api_web/test/api_web/canary_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ defmodule ApiWeb.CanaryTest do
assert {:error, "expect function/0 for notify_fn, got nil"} =
Canary.start_link(notify_fn: nil)

assert_receive {:EXIT, _, "expect function/0 for notify_fn, got nil"}
# start_link consumes EXIT as of OTP 26, so we need to use spawn_link to trigger this. see:
# https://github.com/erlang/otp/issues/7524 and
# https://www.erlang.org/doc/apps/stdlib/gen_server.html#start_link/4
pid = spawn_link(Canary, :start_link, [[notify_fn: nil]])

assert_receive {:EXIT, ^pid, "expect function/0 for notify_fn, got nil"}
end
end
9 changes: 8 additions & 1 deletion apps/state/test/state/server_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,14 @@ defmodule State.ServerTest do
%Example{id: 2, data: :other}
])

assert [%{data: 38}, %{data: 44}, %{data: :other}] = HooksServer.all()
# ETS tables appear to have different internal ordering on Mac and Linux as of OTP 26, so
# explicitly sorting here is necessary to fix this test.
assert [
%Example{id: 1, data: 38},
%Example{id: 1, data: 44},
%Example{id: 2, data: :other}
] = Enum.sort(HooksServer.all())

assert [%{data: 38}, %{data: 44}] = HooksServer.by_id(1)
assert [%{data: 38}] = HooksServer.select([%{data: 37}])
end
Expand Down

0 comments on commit e592254

Please sign in to comment.