From 7fe691e453fc22390dd85106f3277df7d2077bbf Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Tue, 5 Jan 2021 09:44:19 +0000 Subject: [PATCH 1/5] Fix Que fixture dependency error on old Rubys --- features/fixtures/que/app/Gemfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/fixtures/que/app/Gemfile b/features/fixtures/que/app/Gemfile index 1fc888479..d8ed45fc0 100644 --- a/features/fixtures/que/app/Gemfile +++ b/features/fixtures/que/app/Gemfile @@ -5,5 +5,7 @@ gem "bugsnag", path: "/bugsnag" gem "que", "~> 0.14.3" gem "pg", RUBY_VERSION < "2.2.0" ? "0.21.0" : "> 0.21.0" - gem "activerecord", RUBY_VERSION < "2.2.0" ? "4.2.11" : "> 4.2.11" + +# Install a compatible Minitest version on Ruby <2.3 +gem 'minitest', '5.11.3' if RUBY_VERSION < '2.3.0' From bec143979d394abe5d3953d84e756924ac32e6fa Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Tue, 5 Jan 2021 10:01:27 +0000 Subject: [PATCH 2/5] Remove soft fail from Que tests on Ruby 2.0 --- .buildkite/pipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5ad28bafa..6acf64313 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -823,8 +823,6 @@ steps: RUBY_TEST_VERSION: '2.0' concurrency: 4 concurrency_group: 'ruby/integrations-maze-runner-tests' - soft_fail: - - exit_status: "*" - label: ':key: Que Ruby 2.1 tests' timeout_in_minutes: 30 From 00195d5bd508d8fa62c10e84fe7cdaa464360d7c Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Tue, 5 Jan 2021 10:11:32 +0000 Subject: [PATCH 3/5] Fix Mailman fixture dependencies on old Rubys --- features/fixtures/mailman/app/Gemfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/fixtures/mailman/app/Gemfile b/features/fixtures/mailman/app/Gemfile index b202fc4a8..5297171f5 100644 --- a/features/fixtures/mailman/app/Gemfile +++ b/features/fixtures/mailman/app/Gemfile @@ -8,3 +8,6 @@ gem 'rb-inotify', '0.9.8' gem 'maildir', '~> 2.1.0' gem 'activesupport', '~> 3.2' gem 'rack', '~> 1.6.11' + +# Install a compatible FFI version on Ruby <2.3 +gem 'ffi', '< 1.13.0' if RUBY_VERSION < '2.3.0' From 9b731855e6be3e01df53733b5925a8627d2146a9 Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Tue, 5 Jan 2021 10:21:15 +0000 Subject: [PATCH 4/5] Remove soft fail from Mailman tests on Ruby 2.0 --- .buildkite/pipeline.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6acf64313..1f204cf36 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -713,8 +713,6 @@ steps: RUBY_TEST_VERSION: '2.0' concurrency: 4 concurrency_group: 'ruby/integrations-maze-runner-tests' - soft_fail: - - exit_status: "*" - label: ':postbox: Mailman Ruby 2.1 tests' timeout_in_minutes: 30 From 560de4a17db559ba700c849566660a1358e7dbc3 Mon Sep 17 00:00:00 2001 From: Joe Haines Date: Tue, 5 Jan 2021 11:21:17 +0000 Subject: [PATCH 5/5] Make Que fixture a reliable This doesn't seem to flake on CI (at least I haven't noticed it) but it failed pretty commonly locally before this change --- features/fixtures/que/app/app.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/features/fixtures/que/app/app.rb b/features/fixtures/que/app/app.rb index da050c877..267638e93 100644 --- a/features/fixtures/que/app/app.rb +++ b/features/fixtures/que/app/app.rb @@ -1,5 +1,6 @@ require 'pg' require 'que' +require 'socket' require 'bugsnag' require 'active_record' @@ -10,6 +11,23 @@ config.endpoint = ENV['BUGSNAG_ENDPOINT'] end +postgres_ready = false +attempts = 0 +MAX_ATTEMPTS = 10 + +until postgres_ready || attempts >= MAX_ATTEMPTS + begin + Timeout::timeout(5) { TCPSocket.new('postgres', 5432).close } + + postgres_ready = true + rescue Exception + attempts += 1 + sleep 1 + end +end + +raise 'postgres was not ready in time!' unless postgres_ready + ActiveRecord::Base.establish_connection( adapter: 'postgresql', database: 'postgres',