Skip to content

Fix flaky test in terraform_module/process_package_file_worker_spec.rb

What does this MR do and why?

Fixing the flaky test spec/workers/packages/terraform_module/process_package_file_worker_spec.rb#L26

We want to test a case when the instance of Packages::PackageFile doesn't exist, so stubbing the instance with a dummy ID 123 isn't correct because it might happen that we have an instance with ID 123.

Fixing the spec by stubbing the instance with ID equal to nil so we are sure it doesn't exist.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #453950 (closed)

Edited by Moaz Khalifa

Merge request reports