• Rémy Coutable's avatar
    Merge branch 'slash-commands-issuable-spec-fix' into 'master' · 629e21c0
    Rémy Coutable authored
    Fix intermittent spec failures with spec/features/issues/user_uses_slash_commands_spec.rb
    
    This MR solves the intermittent spec failure:
    
    ```
     1) Issues > User uses slash commands behaves like issuable record that supports slash commands in its description and notes note on issue with a note changing the issue's title when current user cannot change title of issue does not reopen the issue
         Failure/Error: Gitlab::Routing.url_helpers.namespace_project_url(self.namespace, self)
    
         ActionController::UrlGenerationError:
           No route matches {:action=>"show", :controller=>"projects", :id=>#<Project id: 1, name: "project135", path: "gitlabhq", description: nil, created_at: "2016-08-31 20:45:48", updated_at: "2016-08-31 20:45:48", creator_id: 2, issues_enabled: true, merge_requests_enabled: true, wiki_enabled: true, namespace_id: 2, snippets_enabled: true, last_activity_at: "2016-08-31 20:45:48", import_url: nil, visibility_level: 20, archived: false, avatar: nil, import_status: "none", repository_size: 0.0, star_count: 0, import_type: nil, import_source: nil, commit_count: 0, import_error: nil, ci_id: nil, builds_enabled: true, shared_runners_enabled: true, runners_token: "_rNZHgsHzaDWGbyL3L2F", build_coverage_regex: nil, build_allow_git_fetch: true, build_timeout: 3600, pending_delete: false, public_builds: true, pushes_since_gc: 0, last_repository_check_failed: nil, last_repository_check_at: nil, container_registry_enabled: true, only_allow_merge_if_build_succeeds: false, has_external_issue_tracker: false, repository_storage: "default", request_access_enabled: true, has_external_wiki: false, lfs_enabled: nil>, :namespace_id=>nil} missing required keys: [:namespace_id]
         Shared Example Group: "issuable record that supports slash commands in its description and notes" called from ./spec/features/issues/user_uses_slash_commands_spec.rb:6
         # ./app/models/project.rb:611:in `web_url'
         # ./app/models/project.rb:975:in `hook_attrs'
         # ./lib/gitlab/data_builder/note.rb:58:in `build_base_data'
         # ./lib/gitlab/data_builder/note.rb:38:in `build'
         # ./app/services/notes/post_process_service.rb:19:in `hook_data'
         # ./app/services/notes/post_process_service.rb:23:in `execute_note_hooks'
         # ./app/services/notes/post_process_service.rb:14:in `execute'
         # ./app/workers/new_note_worker.rb:10:in `perform'
         # ./app/services/notes/create_service.rb:29:in `execute'
         # ./app/controllers/projects/notes_controller.rb:26:in `create'
         # ./lib/gitlab/request_profiler/middleware.rb:15:in `call'
         # ./lib/gitlab/middleware/go.rb:16:in `call'
         # ./lib/gitlab/middleware/static.rb:9:in `call'
    ```
    
    There were a number of issues:
        
    1. Sidekiq async tasks were being run after project namespaces were deleted. Use Sidekiq in fake mode to prevent this from Sidekiq tasks from being enqueued in the first place.
    2. Some outstanding Ajax requests (e.g. autocomplete) were still being loaded while `DatabaseCleaner` ran
    3. `logout` did not always wait for logout actually to complete
      
    Closes #21723
    
    See merge request !6271
    629e21c0