Broken master with Geo specs
Most probably introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11399.
1) GeoNode#projects_include? selective sync by namespaces returns true when project belongs to one of the namespaces
Failure/Error: expect(node.projects_include?(project_in_synced_group.id)).to be_truthy
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT 1 AS one FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 61
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`) AND `projects`.`id` = 330 LIMIT 1
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/models/geo_node.rb:218:in `projects_include?'
# ./ee/spec/models/geo_node_spec.rb:589:in `block (4 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
2) GeoNode#projects_include? selective sync by namespaces returns false when project does not belong to one of the namespaces
Failure/Error: expect(node.projects_include?(unsynced_project.id)).to be_falsy
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT 1 AS one FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 65
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`) AND `projects`.`id` = 334 LIMIT 1
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/models/geo_node.rb:218:in `projects_include?'
# ./ee/spec/models/geo_node_spec.rb:593:in `block (4 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
3) GeoNode#projects returns projects that belong to the namespaces with selective sync by namespace
Failure/Error: expect(node.projects).to match_array([project_1, project_2])
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT `projects`.* FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 72
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`)
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/spec/models/geo_node_spec.rb:629:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
Finished in 11 minutes 42 seconds (files took 17.61 seconds to load)
749 examples, 3 failures, 54 pending
Failed examples:
rspec ./ee/spec/models/geo_node_spec.rb:586 # GeoNode#projects_include? selective sync by namespaces returns true when project belongs to one of the namespaces
rspec ./ee/spec/models/geo_node_spec.rb:592 # GeoNode#projects_include? selective sync by namespaces returns false when project does not belong to one of the namespaces
rspec ./ee/spec/models/geo_node_spec.rb:626 # GeoNode#projects returns projects that belong to the namespaces with selective sync by namespace
1) Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled legacy storage performs Geo::RepositoryCleanupWorker for each project that does not belong to selected namespaces to replicate
Failure/Error: yield lease
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT `projects`.* FROM `projects` WHERE (`projects`.`id` NOT IN (SELECT `projects`.`id` FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 5
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`))) ORDER BY `projects`.`id` ASC LIMIT 250
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:21:in `block in perform'
# ./app/services/concerns/exclusive_lease_guard.rb:29:in `try_obtain_lease'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:17:in `perform'
# ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:32:in `block (5 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
2) Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled hashed storage performs Geo::RepositoryCleanupWorker for each project that does not belong to selected namespaces to replicate
Failure/Error: yield lease
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT `projects`.* FROM `projects` WHERE (`projects`.`id` NOT IN (SELECT `projects`.`id` FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 9
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`))) ORDER BY `projects`.`id` ASC LIMIT 250
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:21:in `block in perform'
# ./app/services/concerns/exclusive_lease_guard.rb:29:in `try_obtain_lease'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:17:in `perform'
# ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:55:in `block (5 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
3) Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled when the project repository does not exist on disk performs Geo::RepositoryCleanupWorker
Failure/Error: yield lease
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT `projects`.* FROM `projects` WHERE (`projects`.`id` NOT IN (SELECT `projects`.`id` FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 13
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`))) ORDER BY `projects`.`id` ASC LIMIT 250
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:21:in `block in perform'
# ./app/services/concerns/exclusive_lease_guard.rb:29:in `try_obtain_lease'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:17:in `perform'
# ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:68:in `block (5 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
4) Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled when the project repository does not exist on disk does not leave orphaned entries in the project_registry table
Failure/Error: yield lease
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT `projects`.* FROM `projects` WHERE (`projects`.`id` NOT IN (SELECT `projects`.`id` FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 17
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`))) ORDER BY `projects`.`id` ASC LIMIT 250
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:21:in `block in perform'
# ./app/services/concerns/exclusive_lease_guard.rb:29:in `try_obtain_lease'
# ./ee/app/workers/geo/repositories_clean_up_worker.rb:17:in `perform'
# ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:75:in `block (6 levels) in <top (required)>'
# ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:74:in `block (5 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
Finished in 13 minutes 7 seconds (files took 17.76 seconds to load)
1329 examples, 4 failures, 36 pending
Failed examples:
rspec ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:20 # Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled legacy storage performs Geo::RepositoryCleanupWorker for each project that does not belong to selected namespaces to replicate
rspec ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:41 # Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled hashed storage performs Geo::RepositoryCleanupWorker for each project that does not belong to selected namespaces to replicate
rspec ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:62 # Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled when the project repository does not exist on disk performs Geo::RepositoryCleanupWorker
rspec ./ee/spec/workers/geo/repositories_clean_up_worker_spec.rb:71 # Geo::RepositoriesCleanUpWorker#perform when node has selective sync enabled when the project repository does not exist on disk does not leave orphaned entries in the project_registry table
! Generating reports is disabled. To enable it, please set the `FLAKY_RSPEC_GENERATE_REPORT=1` !
1) Geo::RepositoryCleanupWorker#perform when node has selective sync restriction does not delegate project removal for projects that belong to selected namespaces to replicate
Failure/Error: described_class.new.perform(project.id, project.name, project.path, 'default')
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT 1 AS one FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 17
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`) AND `projects`.`id` = 971 LIMIT 1
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/models/geo_node.rb:218:in `projects_include?'
# ./ee/app/workers/geo/repository_cleanup_worker.rb:25:in `can_clean_up?'
# ./ee/app/workers/geo/repository_cleanup_worker.rb:13:in `perform'
# ./ee/spec/workers/geo/repository_cleanup_worker_spec.rb:46:in `block (4 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
2) Geo::RepositoryCleanupWorker#perform when node has selective sync restriction delegates project removal for projects that do not belong to selected namespaces to replicate
Failure/Error: described_class.new.perform(project.id, project.name, project.path, 'default')
ActiveRecord::StatementInvalid:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1: SELECT 1 AS one FROM `projects` WHERE `projects`.`namespace_id` IN (WITH RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespace_id` AS id FROM `geo_node_namespace_links` WHERE `geo_node_namespace_links`.`geo_node_id` = 17
UNION
SELECT `namespaces`.`id` FROM `namespaces`, `base_and_descendants` WHERE `namespaces`.`parent_id` = `base_and_descendants`.`id`) SELECT `id` FROM `base_and_descendants` AS `namespaces`) AND `projects`.`id` = 975 LIMIT 1
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/app/models/geo_node.rb:218:in `projects_include?'
# ./ee/app/workers/geo/repository_cleanup_worker.rb:25:in `can_clean_up?'
# ./ee/app/workers/geo/repository_cleanup_worker.rb:13:in `perform'
# ./ee/spec/workers/geo/repository_cleanup_worker_spec.rb:54:in `block (4 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RECURSIVE `base_and_descendants` AS (SELECT `geo_node_namespace_links`.`namespac' at line 1
# ./config/initializers/connection_fix.rb:20:in `execute'
Finished in 12 minutes 17 seconds (files took 19.04 seconds to load)
1405 examples, 2 failures, 35 pending
Failed examples:
rspec ./ee/spec/workers/geo/repository_cleanup_worker_spec.rb:41 # Geo::RepositoryCleanupWorker#perform when node has selective sync restriction does not delegate project removal for projects that belong to selected namespaces to replicate
rspec ./ee/spec/workers/geo/repository_cleanup_worker_spec.rb:49 # Geo::RepositoryCleanupWorker#perform when node has selective sync restriction delegates project removal for projects that do not belong to selected namespaces to replicate
! Generating reports is disabled. To enable it, please set the `FLAKY_RSPEC_GENERATE_REPORT=1` !
! Generating reports is disabled. To enable it, please set the `FLAKY_RSPEC_GENERATE_REPORT=1` !
Also, these specs shouldn't run in these jobs, I think they're missing the :geo
metadata?