Skip to content

Commit

Permalink
In tests, retry when connecting to Puma returns Net::ReadTimeout (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon authored Feb 6, 2023
1 parent a10495c commit 7761ca4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/integration/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
# In development, GoodJob starts up before Puma redirects logs to stdout

# Ensure Puma starts up and Rails fully bootstraps
Net::HTTP.get_response(URI("http://127.0.0.1:#{port}/good_job"))
begin
Net::HTTP.get_response(URI("http://127.0.0.1:#{port}/good_job"))
rescue Net::ReadTimeout
# Still booting
end

# Cron should be enabled and enqueuing an ExampleJob every 5 seconds (defined in config/initializers/good_job.rb)
expect(shell.output).to include(/Enqueued ExampleJob/)
end
Expand Down

0 comments on commit 7761ca4

Please sign in to comment.