Skip to content

Commit

Permalink
Fix server restart test on Puma 3.12.1
Browse files Browse the repository at this point in the history
Since puma/puma#1700, the default host is
correctly used. So `localhost` is used instead of `0.0.0.0`.

As a result, the log output on restart is changed, and the restart test
fails on Puma 3.12.1.
https://travis-ci.org/rails/rails/jobs/509239592#L2303-L2305

Specify binding explicitly to avoid being affected by Puma changes.
  • Loading branch information
y-yagi committed Mar 21, 2019
1 parent 382a956 commit efb706d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -356,8 +356,8 @@ GEM
powerpack (0.1.2)
psych (3.0.3)
public_suffix (3.0.3)
puma (3.12.0)
puma (3.12.0-java)
puma (3.12.1)
puma (3.12.1-java)
que (0.14.3)
qunit-selenium (0.0.4)
selenium-webdriver
Expand Down
4 changes: 2 additions & 2 deletions railties/test/application/server_test.rb
Expand Up @@ -30,13 +30,13 @@ def teardown
pid = nil

Bundler.with_original_env do
pid = Process.spawn("bin/rails server -P tmp/dummy.pid", chdir: app_path, in: replica, out: replica, err: replica)
pid = Process.spawn("bin/rails server -b localhost -P tmp/dummy.pid", chdir: app_path, in: replica, out: replica, err: replica)
assert_output("Listening", primary)

rails("restart")

assert_output("Restarting", primary)
assert_output("Inherited", primary)
assert_output("tcp://localhost:3000", primary)
ensure
kill(pid) if pid
end
Expand Down

0 comments on commit efb706d

Please sign in to comment.