Flaky spec/services/packages/rubygems/create_gemspec_service_spec.rb:17
First seen at https://gitlab.com/gitlab-org/gitlab/-/jobs/1136939593 from !57255 (comment 540275015) and I can reproduce this 100% locally.
Failures:
1) Packages::Rubygems::CreateGemspecService#execute creates a new package file
Got 2 failures:
1.1) Failure/Error: expect(gemspec_file.file_md5).not_to be_nil
expected: not nil
got: nil
# ./spec/services/packages/rubygems/create_gemspec_service_spec.rb:23:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:365:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:356:in `block (2 levels) in <top (required)>'
1.2) Failure/Error: expect(gemspec_file.file_sha256).not_to be_nil
expected: not nil
got: nil
# ./spec/services/packages/rubygems/create_gemspec_service_spec.rb:25:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:365:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:356:in `block (2 levels) in <top (required)>'
Finished in 17 minutes 48 seconds (files took 1 minute 10.58 seconds to load)
4108 examples, 1 failure, 10 pending
Failed examples:
rspec ./spec/services/packages/rubygems/create_gemspec_service_spec.rb:17 # Packages::Rubygems::CreateGemspecService#execute creates a new package file
Introduced in !53673 (merged)
I think this happened because it loaded another package file which was defined in spec/factories/packages/package_file.rb
and it only defines file_sha1
, but not file_md5
nor file_sha256
.
If I change let_it_be(:package) { create(:rubygems_package) }
to be let_it_be(:package) { create(:rubygems_package, :processing) }
then it'll pass, but I wonder if there's a better fix.
/cc @sabrams