Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Include elixir 1.5 and 1.6 in travis tests (#107)
* Include elixir 1.5 and 1.6 in travis tests

* Fix tests for OTP 21 using Process.info/2 for messages

Process.info/1 no longer includes the :messages. Instead it is advised
to use Process.info/2.

http://erlang.org/download/otp_src_21.0-rc1.readme

  OTP-14986    Application(s): erts
               Related Id(s): PR-1745

               erlang:process_info/1 has been changed to no longer
               include messages by default. Instead
               erlang:process_info/2 should be used.

erlang/otp#1745
  • Loading branch information
Gazler authored and chrismccord committed Jul 23, 2018
1 parent ae4820f commit 99f6c4d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
15 changes: 13 additions & 2 deletions .travis.yml
@@ -1,7 +1,18 @@
language: elixir
elixir: 1.4.0
elixir:
- 1.4
- 1.5
- 1.6
otp_release:
- 19.0
- 19.3
- 20.3
- 21.0
matrix:
exclude:
- elixir: 1.5
otp_release: 21.0
- elixir: 1.4
otp_release: 21.0
sudo: false
before_script:
- epmd -daemon
Expand Down
6 changes: 3 additions & 3 deletions test/phoenix/pubsub/local_test.exs
Expand Up @@ -35,14 +35,14 @@ defmodule Phoenix.PubSub.LocalTest do
# broadcast
assert :ok = Local.broadcast(nil, config.pubsub, config.pool_size, :none, "foo", :hellofoo)
assert_received :hellofoo
assert Process.info(pid)[:messages] == [:hellofoo]
assert Process.info(pid, :messages) == {:messages, [:hellofoo]}

assert :ok = Local.broadcast(nil, config.pubsub, config.pool_size, :none, "bar", :hellobar)
assert_received :hellobar
assert Process.info(pid)[:messages] == [:hellofoo]
assert Process.info(pid, :messages) == {:messages, [:hellofoo]}

assert :ok = Local.broadcast(nil, config.pubsub, config.pool_size, :none, "unknown", :hellobar)
assert Process.info(self())[:messages] == []
assert Process.info(self(), :messages) == {:messages, []}
end

@tag pool_size: size
Expand Down
8 changes: 4 additions & 4 deletions test/phoenix/pubsub_test.exs
Expand Up @@ -126,13 +126,13 @@ defmodule Phoenix.PubSub.PubSubTest do
refute_receive %Broadcast{}
refute_receive %Message{}
assert_receive {:fastlaned, %Broadcast{}}
assert Process.info(fastlane_pid)[:messages] == [fastlaned, fastlaned]
assert Process.info(self())[:messages] == [] # cached and fastlaned only sent once
assert Process.info(fastlane_pid, :messages) == {:messages, [fastlaned, fastlaned]}
assert Process.info(self(), :messages) == {:messages, []} # cached and fastlaned only sent once

PubSub.broadcast(__MODULE__, "topic1", %Broadcast{event: "intercepted", topic: "topic1", payload: %{}})

assert_receive %Broadcast{event: "intercepted", topic: "topic1", payload: %{}}
assert Process.info(fastlane_pid)[:messages]
== [fastlaned, fastlaned] # no additional messages received
assert Process.info(fastlane_pid, :messages)
== {:messages, [fastlaned, fastlaned]} # no additional messages received
end
end

0 comments on commit 99f6c4d

Please sign in to comment.