Transient failure on spec/lib/gitlab/import_export/project/tree_restorer_spec "project tree restorer work properly"

The suite of tree_restorer_spec fails with

       Failure/Error:
                 RSpec::Mocks.with_temporary_scope do
                   @project = create(:project, :builds_enabled, :issues_disabled, name: 'project', path: 'project')
                   @shared = @project.import_export_shared
         
                   setup_import_export_config('complex')
                   setup_reader(reader)
         
                   allow_any_instance_of(Repository).to receive(:fetch_source_branch!).and_return(true)
                   allow_any_instance_of(Gitlab::Git::Repository).to receive(:branch_exists?).and_return(false)
         
         Exactly one instance should have received the following message(s) but didn't: 
       Shared Example Group: "project tree restorer work properly" called from ./spec/lib/gitlab/import_export/project/tree_restorer_spec.rb:1011
 Finished in 21 minutes 19 seconds (files took 56.45 seconds to load)
 3347 examples, 73 failures
 Failed examples:

Seen in:

Edited by Albert Salim