Time-dependent test failure in spec/services/namespaces/in_product_marketing_emails_service_spec.rb
Seen in https://gitlab.com/gitlab-org/gitlab/-/jobs/1040807066. Notice the tests started before the start of a new day:
Failures:
1) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :create, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :create, and 0
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :create, and 0
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
2) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :create, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :create, and 1
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :create, and 1
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
3) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :create, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :create, and 2
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :create, and 2
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
4) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :verify, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :verify, and 0
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :verify, and 0
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
5) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :verify, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :verify, and 1
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :verify, and 1
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
6) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :verify, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :verify, and 2
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :verify, and 2
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
7) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :trial, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :trial, and 0
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :trial, and 0
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
8) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :trial, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :trial, and 1
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :trial, and 1
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
9) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :trial, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :trial, and 2
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :trial, and 2
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
10) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :team, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :trial_started_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :team, and 0
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :team, and 0
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
11) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :team, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :trial_started_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :team, and 1
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :team, and 1
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
12) Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :team, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :trial_started_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :team, and 2
Failure/Error: it { is_expected.to send_in_product_marketing_email(user.id, group.id, track, described_class::INTERVAL_DAYS.index(interval)) }
expected nil to send in product marketing email 1658, 1829, :team, and 2
# ./spec/services/namespaces/in_product_marketing_emails_service_spec.rb:57:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:324:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:315:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:311:in `block (2 levels) in <top (required)>'
Finished in 15 minutes 55 seconds (files took 52.81 seconds to load)
4688 examples, 12 failures, 23 pending
Failed examples:
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:1:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :create, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :create, and 0
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:2:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :create, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :create, and 1
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:3:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :create, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :create, and 2
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:4:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :verify, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :verify, and 0
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:5:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :verify, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :verify, and 1
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:6:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :verify, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :verify, and 2
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:7:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :trial, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :trial, and 0
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:8:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :trial, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :trial, and 1
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:9:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :trial, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :trial, and 2
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:10:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :team, interval: 1, actions_completed: {:created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00, :trial_started_at=>Tue, 16 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :team, and 0
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:11:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :team, interval: 5, actions_completed: {:created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00, :trial_started_at=>Fri, 12 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :team, and 1
rspec './spec/services/namespaces/in_product_marketing_emails_service_spec.rb[1:1:12:1]' # Namespaces::InProductMarketingEmailsService#execute for each track and series with the right conditions track: :team, interval: 10, actions_completed: {:created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :git_write_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :pipeline_created_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00, :trial_started_at=>Sun, 07 Feb 2021 12:00:00 UTC +00:00} is expected to send in product marketing email 1658, 1829, :team, and 2
/cc: @alexbuijs