Skip to content

Fix flaky specs in application_helper_spec

Brett Walker requested to merge bw-flaky-application-helper-spec into master

What does this MR do and why?

While hunting down other flaky specs, I ran across some in spec/helpers/application_helper_spec.rb

I am able to recreate with

rspec ./spec/helpers/application_helper_spec.rb --seed 54882

Using bisect as talked about in https://docs.gitlab.com/ee/development/testing_guide/unhealthy_tests.html#how-to-reproduce-a-flaky-test-locally,

rspec ./spec/helpers/application_helper_spec.rb --seed 54882 --bisect

I get a minimal recreation

rspec './spec/helpers/application_helper_spec.rb[1:24:1:1,1:24:1:2,1:24:2:1,1:24:2:2,1:24:3:1,1:24:3:2]' --seed 54882

Failures are:

rspec ./spec/helpers/application_helper_spec.rb:690 # ApplicationHelper#profile_social_links when mastodon is set returns an empty string if mastodon username is not set
rspec ./spec/helpers/application_helper_spec.rb:675 # ApplicationHelper#profile_social_links when bluesky is set returns an empty string if bluesky did id is not set
rspec ./spec/helpers/application_helper_spec.rb:660 # ApplicationHelper#profile_social_links when discord is set returns an empty string if discord is not set

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports