Skip to content

Add silence_stdout option to explicitly redirect stdout in rake task specs [RUN ALL RSPEC] [RUN AS-IF-FOSS]

James Fargher requested to merge jf_stop_overwriting_stdout into master

What does this MR do?

#35862 (closed)

While working on !61436 (merged) I found that $stdout was unpredictably being replaced by a StringIO object on CI even though I was trying to use expect { ... }.to output.to_stdout_from_any_process which should be using a Tempfile. I can't use StringIO since I was using process IO redirection. Since StringIO doesn't have a file-descriptor it doesn't work.

It turns out there were two spec helpers rake_helper and generator_helper that were replacing $stdout with StringIO.new in before(:all) blocks. Aside from my specific problem this causes a couple of issues:

  • The before(:all) blocks weren't in any context so once they get included they apply to all following specs. This explains the unpredictable behaviour I was getting since CI runs several rspec files at once.
  • The StringIO leaks between tests. So the output of a test run before is accessible in the following tests.
  • These redirects mean that puts debugging wont work reliably, if you are so inclined. It's not obvious where or why.

Aside from these points, it seems that many specs were outputting to stdout regardless for a variety of reasons. So in my opinion the redirect wasn't up to task.

With that in mind, here's what this MR does:

  • Stop using STDOUT in rake tasks. Unlike $stdout, STDOUT is a constant and so it isn't as easily replaced. This was causing some specs to output despite $stdout being replaced. Now extracted into !62853 (merged)
  • Replace $stdout = StringIO.new in the two helpers with :silence_stdout in each spec file.

Local testing

To make sure this MR progresses things in the right direction I have run bundle exec rspec spec/tasks in both master and this branch. (You'll need to ignore some failures I seem to get locally)

Diff:
--- before	2021-05-27 09:24:23.000000000 +1200
+++ after	2021-05-27 09:12:38.000000000 +1200
@@ -63,27 +63,16 @@
   gitlab:artifacts:migrate
     when local storage is used
       and remote storage is defined
-I, [2021-05-27T09:15:08.110431 #28717]  INFO -- : Starting transfer to remote storage
-I, [2021-05-27T09:15:08.124822 #28717]  INFO -- : Transferred Ci::JobArtifact ID 5 of type archive with size 107464 to object storage
-I, [2021-05-27T09:15:08.134003 #28717]  INFO -- : Transferred Ci::JobArtifact ID 6 of type trace with size 192437 to object storage
         migrates file to remote storage
       and remote storage is not defined
-I, [2021-05-27T09:15:09.577753 #28717]  INFO -- : Starting transfer to remote storage
-W, [2021-05-27T09:15:09.583514 #28717]  WARN -- : Failed to transfer Ci::JobArtifact of type archive and ID 7 with error: Object Storage is not enabled for JobArtifactUploader
-W, [2021-05-27T09:15:09.585484 #28717]  WARN -- : Failed to transfer Ci::JobArtifact of type trace and ID 8 with error: Object Storage is not enabled for JobArtifactUploader
         fails to migrate to remote storage
     when remote storage is used
-I, [2021-05-27T09:15:10.826805 #28717]  INFO -- : Starting transfer to remote storage
       file stays on remote storage
   gitlab:artifacts:migrate_to_local
     when remote storage is used
       and job has remote file store defined
-I, [2021-05-27T09:15:11.797231 #28717]  INFO -- : Starting transfer to local storage
-I, [2021-05-27T09:15:11.814601 #28717]  INFO -- : Transferred Ci::JobArtifact ID 11 of type archive with size 107464 to local storage
-I, [2021-05-27T09:15:11.824706 #28717]  INFO -- : Transferred Ci::JobArtifact ID 12 of type trace with size 192437 to local storage
         migrates file to local storage
     when local storage is used
-I, [2021-05-27T09:15:13.112429 #28717]  INFO -- : Starting transfer to local storage
       file stays on local storage
 
 gitlab:app namespace rake task
@@ -340,130 +329,56 @@
   migration tasks
     migrate
       object storage disabled
-I, [2021-05-27T09:17:32.439058 #28717]  INFO -- : Starting transfer of LFS files to object storage
-E, [2021-05-27T09:17:32.443514 #28717] ERROR -- : Failed to transfer LFS object b68143e6463773b1b6c6fd009a76c32aeec041faff32ba2ed42fd7f708a00001 with error: Object Storage is not enabled for LfsObjectUploader
         doesn't migrate files
       object storage enabled
-I, [2021-05-27T09:17:32.492587 #28717]  INFO -- : Starting transfer of LFS files to object storage
-I, [2021-05-27T09:17:32.497701 #28717]  INFO -- : Transferred LFS object b68143e6463773b1b6c6fd009a76c32aeec041faff32ba2ed42fd7f708a00002 of size 499013 to object storage
         migrates local file to object storage
     migrate_to_local
       object storage enabled
-I, [2021-05-27T09:17:32.534984 #28717]  INFO -- : Starting transfer of LFS files to local storage
-I, [2021-05-27T09:17:32.543096 #28717]  INFO -- : Transferred LFS object b68143e6463773b1b6c6fd009a76c32aeec041faff32ba2ed42fd7f708a00003 of size 499013 to local storage
         migrates remote files to local storage
 
 gitlab:packages:build_composer_cache namespace rake task
-I, [2021-05-27T09:17:34.112048 #28717]  INFO -- : Starting to build composer cache files
-I, [2021-05-27T09:17:34.114141 #28717]  INFO -- : Building cache for 50 -> sample-project
-I, [2021-05-27T09:17:38.681811 #28717]  INFO -- : Building cache for 51 -> sample-project2
   generates the cache files
 
 gitlab:packages:events namespace rake task
   generate_unique
-I, [2021-05-27T09:17:39.448292 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.451227 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     excludes guest events
-I, [2021-05-27T09:17:39.465853 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.468746 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `maven` scope
-I, [2021-05-27T09:17:39.484653 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.488081 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `npm` scope
-I, [2021-05-27T09:17:39.506935 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.509772 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `conan` scope
-I, [2021-05-27T09:17:39.528899 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.531749 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `nuget` scope
-I, [2021-05-27T09:17:39.549305 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.552744 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `pypi` scope
-I, [2021-05-27T09:17:39.568769 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.572554 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `composer` scope
-I, [2021-05-27T09:17:39.586814 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.590675 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `generic` scope
-I, [2021-05-27T09:17:39.608267 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.611078 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `golang` scope
-I, [2021-05-27T09:17:39.626853 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.629614 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `debian` scope
-I, [2021-05-27T09:17:39.646104 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.649789 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `rubygems` scope
-I, [2021-05-27T09:17:39.667118 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.670781 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `helm` scope
-I, [2021-05-27T09:17:39.691131 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.765435 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `terraform_module` scope
-I, [2021-05-27T09:17:39.780743 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.783181 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `container` scope
-I, [2021-05-27T09:17:39.798579 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.803458 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     includes `tag` scope
-I, [2021-05-27T09:17:39.823348 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.825852 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/known_events/package_events.yml` generated successfully
     excludes some event types
   generate_counts
-I, [2021-05-27T09:17:39.840744 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.842263 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `maven` scope
-I, [2021-05-27T09:17:39.859102 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.860454 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `npm` scope
-I, [2021-05-27T09:17:39.873828 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.875211 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `conan` scope
-I, [2021-05-27T09:17:39.889157 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.890881 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `nuget` scope
-I, [2021-05-27T09:17:39.905248 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.906732 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `pypi` scope
-I, [2021-05-27T09:17:39.923284 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.925208 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `composer` scope
-I, [2021-05-27T09:17:39.939779 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.941624 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `generic` scope
-I, [2021-05-27T09:17:39.956899 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.958540 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `golang` scope
-I, [2021-05-27T09:17:39.974426 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.975866 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `debian` scope
-I, [2021-05-27T09:17:39.990825 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:39.992405 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `rubygems` scope
-I, [2021-05-27T09:17:40.007041 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:40.008721 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `helm` scope
-I, [2021-05-27T09:17:40.026499 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:40.027999 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `terraform_module` scope
-I, [2021-05-27T09:17:40.042160 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:40.043542 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `container` scope
-I, [2021-05-27T09:17:40.057097 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:40.058475 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     includes `tag` scope
-I, [2021-05-27T09:17:40.073276 #28717]  INFO -- : Building list of package events...
-I, [2021-05-27T09:17:40.074644 #28717]  INFO -- : Events file `/Users/james/src/gitlab-org/gdk/gitlab/lib/gitlab/usage_data_counters/counter_events/package_events.yml` generated successfully
     excludes some event types
 
 gitlab:packages namespace rake task
   migrate
     object storage disabled
-I, [2021-05-27T09:17:40.707350 #28717]  INFO -- : Starting transfer of package files to object storage
       doesn't migrate files
     object storage enabled
-I, [2021-05-27T09:17:40.891899 #28717]  INFO -- : Starting transfer of package files to object storage
-I, [2021-05-27T09:17:40.898320 #28717]  INFO -- : Transferred package file 2 of size 204800 to object storage
       migrates local file to object storage
 
 gitlab:pages
@@ -478,27 +393,16 @@
   gitlab:pages:deployments:migrate_to_object_storage
     when local storage is used
       and remote storage is defined
-I, [2021-05-27T09:17:42.330252 #28717]  INFO -- : Starting transfer to remote storage
-E, [2021-05-27T09:17:42.346402 #28717] ERROR -- : undefined method `file_type' for #<PagesDeployment:0x00007fad86b6a748>
-Did you mean?  file_store
         migrates file to remote storage
       and remote storage is not defined
-I, [2021-05-27T09:17:42.529632 #28717]  INFO -- : Starting transfer to remote storage
-E, [2021-05-27T09:17:42.540812 #28717] ERROR -- : undefined method `file_type' for #<PagesDeployment:0x00007fad85d3a8f8>
-Did you mean?  file_store
         fails to migrate to remote storage
     when remote storage is used
-I, [2021-05-27T09:17:42.722344 #28717]  INFO -- : Starting transfer to remote storage
       file stays on remote storage
   gitlab:pages:deployments:migrate_to_local
     when remote storage is used
       and job has remote file store defined
-I, [2021-05-27T09:17:42.904877 #28717]  INFO -- : Starting transfer to local storage
-E, [2021-05-27T09:17:42.919100 #28717] ERROR -- : undefined method `file_type' for #<PagesDeployment:0x00007fad806f5498>
-Did you mean?  file_store
         migrates file to local storage
     when local storage is used
-I, [2021-05-27T09:17:43.100078 #28717]  INFO -- : Starting transfer to local storage
       file stays on local storage
 
 gitlab:password rake tasks
@@ -680,9 +584,6 @@
       logs the error
 
 gitlab:update_project_templates rake task
-W, [2021-05-27T09:18:15.351706 #28717]  WARN -- : Scoped order is ignored, it's forced to be batch order.
-W, [2021-05-27T09:18:15.513699 #28717]  WARN -- : Scoped order is ignored, it's forced to be batch order.
-W, [2021-05-27T09:18:16.134950 #28717]  WARN -- : Scoped order is ignored, it's forced to be batch order.
   updates valid project templates
 
 gitlab:uploads rake tasks
@@ -695,111 +596,43 @@
   for AvatarUploader
     for Project
       behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:20.985229 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:20.987978 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:20.991832 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:20.995128 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates local storage to remote object storage
-I, [2021-05-27T09:18:22.968530 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:22.971098 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:22.974216 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:22.977025 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates remote object storage to local storage
     for Group
       behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:23.557840 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:23.562186 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:23.566395 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:23.569399 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates local storage to remote object storage
-I, [2021-05-27T09:18:24.123321 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:24.127169 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:24.129964 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:24.132636 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates remote object storage to local storage
     for User
       behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:24.763614 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:24.766635 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:24.769685 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:24.774043 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates local storage to remote object storage
-I, [2021-05-27T09:18:25.370957 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:25.374507 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:25.378954 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:25.382488 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates remote object storage to local storage
   for AttachmentUploader
     for Note
       behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:28.750788 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:28.761093 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:28.766527 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:28.772846 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates local storage to remote object storage
-I, [2021-05-27T09:18:33.770945 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:33.782342 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:33.789561 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:33.795844 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
         migrates remote object storage to local storage
     for Appearance
       behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:34.548862 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
         migrates local storage to remote object storage
-I, [2021-05-27T09:18:34.706678 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
         migrates remote object storage to local storage
       behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:34.837303 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
         migrates local storage to remote object storage
-I, [2021-05-27T09:18:34.954962 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
         migrates remote object storage to local storage
   for FileUploader
     behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:37.249455 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:37.252390 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:37.255020 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:37.258054 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates local storage to remote object storage
-I, [2021-05-27T09:18:39.142560 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:39.144907 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:39.146946 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:39.149534 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates remote object storage to local storage
   for PersonalFileUploader
     behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:42.060806 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:42.068074 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:42.081118 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:42.086467 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates local storage to remote object storage
-I, [2021-05-27T09:18:43.771752 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:43.783048 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:43.795302 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:43.804657 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates remote object storage to local storage
   for NamespaceFileUploader
     behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:45.249800 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:45.253420 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:45.257060 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:45.260364 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates local storage to remote object storage
-I, [2021-05-27T09:18:46.642839 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:46.647056 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:46.651050 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:46.655202 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates remote object storage to local storage
   for DesignManagement::DesignV432x230Uploader
     behaves like enqueue upload migration jobs in batch
-I, [2021-05-27T09:18:53.352999 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:53.359827 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:53.371084 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:18:53.374976 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates local storage to remote object storage
-I, [2021-05-27T09:19:03.049042 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>1, :job_id=>"A fake job."}
-I, [2021-05-27T09:19:03.057597 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>2, :job_id=>"A fake job."}
-I, [2021-05-27T09:19:03.062297 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>3, :job_id=>"A fake job."}
-I, [2021-05-27T09:19:03.066624 #28717]  INFO -- : {:message=>"[Uploads migration] Enqueued upload migration job", :index=>4, :job_id=>"A fake job."}
       migrates remote object storage to local storage
 
 gitlab:usage data take tasks
@@ -853,8 +686,6 @@
 
 gitlab:x509 namespace rake task
   update_signatures
-I, [2021-05-27T09:19:49.169045 #28717]  INFO -- : Start to update x509 commit signatures
-I, [2021-05-27T09:19:49.262218 #28717]  INFO -- : End update x509 commit signatures
     changes from unverified to verified if the certificate store contains the root certificate
     returns if no signature is available
 
@@ -1022,7 +853,7 @@
   3) rake gitlab:storage:* gitlab:storage:rollback_to_legacy with migration already scheduled does nothing
      Failure/Error: expect { run_rake_task(task) }.to abort_execution.with_message(/There is already a migration operation in progress/)
      
-       expected #<Proc:0x00007fad5ae9ed28 /Users/james/src/gitlab-org/gdk/gitlab/spec/tasks/gitlab/storage_rake_spec.rb:167> to abort with: '(?-mix:There is already a migration operation in progress)' 
+       expected #<Proc:0x00007fe3d778e8b8 /Users/james/src/gitlab-org/gdk/gitlab/spec/tasks/gitlab/storage_rake_spec.rb:167> to abort with: '(?-mix:There is already a migration operation in progress)' 
         but received: 'There are no projects that can have storage rolledback. Nothing to do!' instead.
      # ./spec/tasks/gitlab/storage_rake_spec.rb:167:in `block (5 levels) in <main>'
      # ./spec/tasks/gitlab/storage_rake_spec.rb:162:in `block (4 levels) in <main>'
@@ -1033,7 +864,7 @@
      # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
      # ./spec/spec_helper.rb:362:in `block (2 levels) in <top (required)>'
 
-Finished in 5 minutes 21 seconds (files took 1 minute 25.24 seconds to load)
+Finished in 4 minutes 57.3 seconds (files took 1 minute 27.85 seconds to load)
 320 examples, 3 failures, 1 pending
 
 Failed examples:

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by James Fargher

Merge request reports