rspec db-library-code pg13
Passed Started
by
@edith007

Siddharth Asthana
1Running with gitlab-runner 16.1.0~beta.59.g83c66823 (83c66823)2 on green-4.shared-gitlab-org.runners-manager.gitlab.com/default x5QiHUKw, system ID: s_b9637080a79e3 feature flags: FF_NETWORK_PER_BUILD:true, FF_USE_FASTZIP:true, FF_USE_IMPROVED_URL_MASKING:true6Using Docker executor with image registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.20-rust-1.65-node-18.17-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-113-yarn-1.22-graphicsmagick-1.3.36 ...7Starting service registry.gitlab.com/gitlab-org/gitlab-build-images:postgres-13-pgvector-0.4.1 ...8Authenticating with credentials from job payload (GitLab Registry)9Pulling docker image registry.gitlab.com/gitlab-org/gitlab-build-images:postgres-13-pgvector-0.4.1 ...10Using docker image sha256:73740c557807c4bc5d692f263c0e35454270600da4b22bbe952331411426c8b5 for registry.gitlab.com/gitlab-org/gitlab-build-images:postgres-13-pgvector-0.4.1 with digest registry.gitlab.com/gitlab-org/gitlab-build-images@sha256:3174001f839c42e299ac06a42f8ded446edfcb33b0eb820874749a3f53eb799c ...11WARNING: Service registry.gitlab.com/gitlab-org/gitlab-build-images:redis-cluster-6.2.12 is already created. Ignoring.12WARNING: Service registry.gitlab.com/gitlab-org/gitlab-build-images:redis-cluster-6.2.12 is already created. Ignoring.13Starting service registry.gitlab.com/gitlab-org/gitlab-build-images:redis-cluster-6.2.12 ...14Authenticating with credentials from job payload (GitLab Registry)15Pulling docker image registry.gitlab.com/gitlab-org/gitlab-build-images:redis-cluster-6.2.12 ...16Using docker image sha256:a9a90ece30d9630d694ab1997cd103ea8ec729789451b983a75c7b58b0062d45 for registry.gitlab.com/gitlab-org/gitlab-build-images:redis-cluster-6.2.12 with digest registry.gitlab.com/gitlab-org/gitlab-build-images@sha256:7ef36177d5d0bc554fbb63d8210ae751bcc538bea7905b51d078d9ab90a755fa ...17Starting service redis:6.2-alpine ...18Pulling docker image redis:6.2-alpine ...19Using docker image sha256:d0675d033b87382205d08b598a004a99a1f6c4bd377cc86bb6df8957ce7dbb1c for redis:6.2-alpine with digest redis@sha256:740b5c973d1c9eea6e124a3905ba73d32354d0549f98ccc9e67af1af2a9ba478 ...20Waiting for services to be up and running (timeout 30 seconds)...21Authenticating with credentials from job payload (GitLab Registry)22Pulling docker image registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.20-rust-1.65-node-18.17-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-113-yarn-1.22-graphicsmagick-1.3.36 ...23Using docker image sha256:096dd48f4545478f602245d9ceca2ed686008950aba1f1e34760b9b1bf3847aa for registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.20-rust-1.65-node-18.17-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-113-yarn-1.22-graphicsmagick-1.3.36 with digest registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.20-rust-1.65-node-18.17-postgresql-13@sha256:231bb6927996ddbcd348db899d42665a0a2ce3583c9b51b228b3de5c9a01e9b6 ...25Running on runner-x5qihukw-project-27783254-concurrent-0 via runner-x5qihukw-shared-gitlab-org-1691910217-2100ec3d...27Fetching changes with git depth set to 20...28Initialized empty Git repository in /builds/edith007/gitlab/.git/29Created fresh repository.30Checking out 199b254b as detached HEAD (ref is master)...31Skipping Git submodules setup32$ git remote set-url origin "${CI_REPOSITORY_URL}"34Checking cache for ruby-gems-debian-bullseye-ruby-3.0-protected...35WARNING: file does not exist 36Failed to extract cache38Downloading artifacts for compile-test-assets (4863613909)...39Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4863613909 responseStatus=200 OK token=64_y7yDT40Downloading artifacts for retrieve-tests-metadata (4863613915)...41Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4863613915 responseStatus=200 OK token=64_y7yDT42Downloading artifacts for setup-test-env (4863613912)...43Downloading artifacts from coordinator... ok host=storage.googleapis.com id=4863613912 responseStatus=200 OK token=64_y7yDT45Using docker image sha256:096dd48f4545478f602245d9ceca2ed686008950aba1f1e34760b9b1bf3847aa for registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.20-rust-1.65-node-18.17-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-chrome-113-yarn-1.22-graphicsmagick-1.3.36 with digest registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-3.0.patched-golang-1.20-rust-1.65-node-18.17-postgresql-13@sha256:231bb6927996ddbcd348db899d42665a0a2ce3583c9b51b228b3de5c9a01e9b6 ...46$ echo $FOSS_ONLY47$ [ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb48$ export GOPATH=$CI_PROJECT_DIR/.go49$ mkdir -p $GOPATH50$ source scripts/utils.sh51$ source scripts/prepare_build.sh1362Using decomposed database config (config/database.yml.decomposed-postgresql)1363Geo DB won't be set up.1364Embedding DB won't be set up.1376$ source ./scripts/rspec_helpers.sh1377$ run_timed_command "gem install knapsack --no-document"1378$ gem install knapsack --no-document1379Successfully installed knapsack-4.0.013801 gem installed1381==> 'gem install knapsack --no-document' succeeded in 1 seconds.1382$ section_start "gitaly-test-spawn" "Spawning Gitaly"; scripts/gitaly-test-spawn; section_end "gitaly-test-spawn"1387$ export RSPEC_SKIPPED_TESTS_REPORT_PATH="rspec/skipped_tests-${CI_JOB_ID}.txt"1388$ export RSPEC_RETRIED_TESTS_REPORT_PATH="rspec/retried_tests-${CI_JOB_ID}.txt"1389$ rspec_db_library_code1390Running RSpec command: bin/rspec -Ispec -rspec_helper --color --failure-exit-code 1 --error-exit-code 2 --format documentation --format Support::Formatters::JsonFormatter --out rspec/rspec-4863614081.json --format RspecJunitFormatter --out rspec/rspec-4863614081.xml --tag ~click_house -- spec/lib/gitlab/database/1391/builds/edith007/gitlab/ee/app/services/remote_development/service_response_factory.rb:41: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1392/builds/edith007/gitlab/ee/app/services/remote_development/workspaces/create_service.rb:28: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1393/builds/edith007/gitlab/ee/app/services/remote_development/workspaces/reconcile_service.rb:38: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1394/builds/edith007/gitlab/ee/app/services/remote_development/workspaces/update_service.rb:28: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1395/builds/edith007/gitlab/ee/lib/remote_development/agent_config/main.rb:32: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1396/builds/edith007/gitlab/ee/lib/remote_development/agent_config/updater.rb:11: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1397/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/authorizer.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1398/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/authorizer.rb:13: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1399/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:17: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1400/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:24: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1401/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:25: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1402/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:28: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1403/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/devfile_fetcher.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1404/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/devfile_fetcher.rb:16: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1405/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/devfile_flattener.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1406/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/editor_component_injector.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1407/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/editor_component_injector.rb:17: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1408/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/editor_component_injector.rb:18: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1409/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:43: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1410/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:54: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1411/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:102: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1412/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:126: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1413/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:159: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1414/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:202: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1415/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:235: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1416/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/pre_flatten_devfile_validator.rb:24: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1417/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/pre_flatten_devfile_validator.rb:52: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1418/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1419/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:17: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1420/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:18: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1421/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:23: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1422/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/volume_component_injector.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1423/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/volume_component_injector.rb:13: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1424/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/volume_component_injector.rb:14: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1425/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/main.rb:43: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1426/builds/edith007/gitlab/ee/lib/remote_development/workspaces/update/authorizer.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1427/builds/edith007/gitlab/ee/lib/remote_development/workspaces/update/updater.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1428/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/agent_infos_observer.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1429/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_extractor.rb:14: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1430/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_extractor.rb:16: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1431/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_to_infos_converter.rb:14: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1432/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_validator.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1433/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/output/rails_infos_observer.rb:11: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1434/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/output/workspaces_to_rails_infos_converter.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1435/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/orphaned_workspaces_observer.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1436/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/workspaces_from_agent_infos_updater.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1437/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/workspaces_to_be_returned_finder.rb:16: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1438/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/workspaces_to_be_returned_updater.rb:11: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!1439Run options: exclude {:click_house=>true}1440Test environment set up in 0.683324615 seconds1441Gitlab::Database::AsyncConstraints::MigrationHelpers1442 # order random1443 with async FK validation on regular tables1444 #prepare_async_foreign_key_validation1445 creates the record for the async FK validation1446 when an explicit name is given1447 creates the record with the given name1448 when the FK does not exist1449 returns an error1450 when the record already exists1451 does attempt to create the record1452 when the async FK validation table does not exist1453 does not raise an error1454 #unprepare_async_foreign_key_validation1455 with foreign keys1456 destroys the record1457 when an explicit name is given1458 destroys the record1459 when the async fk validation table does not exist1460 does not raise an error1461 with other types of constraints1462 does not destroy the record1463 with async check constraint validations1464 #prepare_async_check_constraint_validation1465 creates the record for async validation1466 when the check constraint does not exist1467 returns an error1468 when the record already exists1469 does attempt to create the record1470 when the async validation table does not exist1471 does not raise an error1472 #unprepare_async_check_constraint_validation1473 with check constraints1474 destroys the record1475 when the async validation table does not exist1476 does not raise an error1477 with other types of constraints1478 does not destroy the record1479 with partitioned tables1480 #prepare_partitioned_async_foreign_key_validation1481 delegates to prepare_async_foreign_key_validation for each partition1482 #unprepare_partitioned_async_foreign_key_validation1483 delegates to unprepare_async_foreign_key_validation for each partition1484Gitlab::Database::AsyncConstraints::PostgresAsyncConstraintValidation1485 # order random1486 is expected to be a kind of Gitlab::Database::SharedModel(abstract)1487 scopes1488 .ordered1489 is expected to eq [#<Gitlab::Database::AsyncConstraints::PostgresAsyncConstraintValidation id: 14, created_at: "2023-08..."fk_users_id_1", table_name: "users", last_error: nil, attempts: 1, constraint_type: "foreign_key">]1490 .foreign_key_type1491 is expected to eq [#<Gitlab::Database::AsyncConstraints::PostgresAsyncConstraintValidation id: 15, created_at: "2023-08..."fk_users_id_3", table_name: "users", last_error: nil, attempts: 1, constraint_type: "foreign_key">]1492 does not apply the filter if the column is not present1493 .check_constraint_type1494 is expected to eq [#<Gitlab::Database::AsyncConstraints::PostgresAsyncConstraintValidation id: 20, created_at: "2023-08...sers_id_8", table_name: "users", last_error: nil, attempts: 0, constraint_type: "check_constraint">]1495 .constraint_type_exists?1496 is expected to be truthy1497 always asks the database1498 #handle_exception!1499 increases the attempts number1500 saves error details1501 .table_available?1502 is expected to be truthy1503 when the table does not exist1504 is expected to be falsy1505 validations1506 is expected to validate that :name cannot be empty/falsy1507 is expected to validate that :name is case-sensitively unique within the scope of :table_name1508 is expected to validate that the length of :name is at most 631509 is expected to validate that :table_name cannot be empty/falsy1510 is expected to validate that the length of :table_name is at most 631511 is expected to validate that the length of :last_error is at most 100001512Gitlab::Database::AsyncConstraints::Validators::CheckConstraint1513 # order random1514 behaves like async constraints validation1515 validates the constraint while controlling statement timeout1516 removes the constraint validation record from table1517 skips logic if not able to acquire exclusive lease1518 logs messages around execution1519 when the constraint does not exist1520 skips validation and removes the record1521 logs an appropriate message1522 with error handling1523 on production1524 increases execution attempts1525 logs an error message including the constraint_name1526 on development1527 also raises errors1528Gitlab::Database::AsyncConstraints::Validators::ForeignKey1529 # order random1530 behaves like async constraints validation1531 validates the constraint while controlling statement timeout1532 removes the constraint validation record from table1533 skips logic if not able to acquire exclusive lease1534 logs messages around execution1535 when the constraint does not exist1536 skips validation and removes the record1537 logs an appropriate message1538 with error handling1539 on production1540 increases execution attempts1541 logs an error message including the constraint_name1542 on development1543 also raises errors1544 with fully qualified table names1545 validates the constraint1546Gitlab::Database::AsyncConstraints::Validators1547 # order random1548 .for1549 with foreign keys validations1550 is expected to be a kind of Gitlab::Database::AsyncConstraints::Validators::ForeignKey1551 with check constraint validations1552 is expected to be a kind of Gitlab::Database::AsyncConstraints::Validators::CheckConstraint1553Gitlab::Database::AsyncConstraints1554 # order random1555 .validate_pending_entries!1556 executes pending validations1557Gitlab::Database::AsyncDdlExclusiveLeaseGuard1558 # order random1559 #lease_key1560 with CI database connection1561 is expected to eq "gitlab/database/asyncddl/actions/ci"1562 with MAIN database connection1563 is expected to eq "gitlab/database/asyncddl/actions/main"1564Gitlab::Database::AsyncIndexes::IndexBase1565 # order random1566 #perform1567 #preconditions_met?1568 raises errors if preconditions is not defined1569 #action_type1570 raises errors if action_type is not defined1571 with error handling1572 on production1573 increases execution attempts1574 logs an error message including the index_name1575 on development1576 also raises errors1577Gitlab::Database::AsyncIndexes::IndexCreator1578 #perform1579 creates the index while controlling statement timeout1580 removes the index preparation record from postgres_async_indexes1581 skips logic if not able to acquire exclusive lease1582 logs messages around execution1583 when the index already exists1584 skips index creation1585 removes the index preparation record from postgres_async_indexes1586 logs an appropriate message1587Gitlab::Database::AsyncIndexes::IndexDestructor1588 #perform1589 creates the index while controlling lock timeout1590 removes the index preparation record from postgres_async_indexes1591 skips logic if not able to acquire exclusive lease1592 logs messages around execution1593 when the index does not exist1594 skips index destruction1595 removes the index preparation record from postgres_async_indexes1596 logs an appropriate message1597Gitlab::Database::AsyncIndexes::MigrationHelpers1598 #unprepare_async_index1599 destroys the record1600 when an explicit name is given1601 destroys the record1602 when the async index table does not exist1603 does not raise an error1604 #unprepare_async_index_by_name1605 destroys the record1606 when the async index table does not exist1607 does not raise an error1608 #prepare_async_index1609 creates the record for the async index1610 when an explicit name is given1611 creates the record with the given name1612 when the index already exists1613 does not create the record1614 when the record already exists1615 does attempt to create the record1616 updates definition if changed1617 does not update definition if not changed1618 when the async index table does not exist1619 does not raise an error1620 #prepare_async_index_from_sql1621 requires ddl mode1622 when the given index is invalid1623 raises a RuntimeError1624 when the given index is valid1625 when the index algorithm is not concurrent1626 raises a RuntimeError1627 when the index algorithm is concurrent1628 when the statement tries to create an index for non-existing table1629 raises a RuntimeError1630 when the statement tries to create an index for an existing table1631 when the async index creation is not available1632 does not raise an error1633 when the async index creation is available1634 when there is already an index with the given name1635 does not create the async index record1636 when there is no index with the given name1637 creates the async index record1638 sets the async index attributes correctly1639 when the given SQL has whitespace1640 creates the async index record1641 sets the async index attributes correctly1642 #prepare_async_index_removal1643 creates the record for the async index removal1644 when the index does not exist1645 does not create the record1646 when the record already exists1647 does attempt to create the record1648Gitlab::Database::AsyncIndexes::PostgresAsyncIndex1649 is expected to be a kind of Gitlab::Database::SharedModel(abstract)1650 validations1651 is expected to validate that :name cannot be empty/falsy1652 is expected to validate that the length of :name is at most 631653 is expected to validate that :table_name cannot be empty/falsy1654 is expected to validate that the length of :table_name is at most 1271655 is expected to validate that :definition cannot be empty/falsy1656 is expected to validate that the length of :definition is at most 20481657 is expected to validate that the length of :last_error is at most 100001658 when passing a long schema name1659 behaves like table_name is invalid1660 is invalid1661 when passing a long table name1662 behaves like table_name is invalid1663 is invalid1664 when passing a long table name and schema name1665 behaves like table_name is invalid1666 is invalid1667 when invalid table name is given1668 behaves like table_name is invalid1669 is invalid1670 when passing a definition with beginning or trailing whitespace1671 strips the definition field1672 scopes1673 .to_create1674 is expected to contain exactly #<Gitlab::Database::AsyncIndexes::PostgresAsyncIndex id: 38, created_at: "2023-08-13 07:14:35.7202853...nition: "CREATE INDEX users_id_32 ON users (id)", table_name: "users", attempts: 0, last_error: nil>1675 .to_drop1676 is expected to contain exactly #<Gitlab::Database::AsyncIndexes::PostgresAsyncIndex id: 39, created_at: "2023-08-13 07:14:35.7239746...ers_id_33", definition: "DROP INDEX users_id_33", table_name: "users", attempts: 0, last_error: nil>1677 .ordered1678 is expected to contain exactly #<Gitlab::Database::AsyncIndexes::PostgresAsyncIndex id: 39, created_at: "2023-08-13 07:14:35.7239746...ers_id_33", definition: "DROP INDEX users_id_33", table_name: "users", attempts: 0, last_error: nil>1679 #handle_exception!1680 increases the attempts number1681 saves error details1682Gitlab::Database::AsyncIndexes1683 .create_pending_indexes!1684 takes 2 pending indexes and creates those1685 .drop_pending_indexes!1686 takes 2 pending indexes and destroys those1687 .execute_pending_actions!1688 with one entry1689 executes instructions ordered by attempts and ids1690 with two entries1691 executes instructions ordered by attempts1692 when the budget allows more instructions1693 retries failed attempts1694Gitlab::Database::BackgroundMigration::BatchMetrics1695 #time_operation1696 tracks the duration of the operation using monotonic time1697 #instrument_operation1698 tracks duration and affected rows1699Gitlab::Database::BackgroundMigration::BatchOptimizer1700 #optimize1701 with unknown time efficiency, it keeps the batch size1702 with a time efficiency of 95%, it keeps the batch size1703 with a time efficiency of 90%, it keeps the batch size1704 with a time efficiency of 85%, it increases the batch size1705 with a time efficiency of 110%, it decreases the batch size1706 reaching the upper limit for an increase1707 caps the batch size multiplier at 20% when increasing1708 does not limit the decrease multiplier1709 reaching the upper limit for the batch size1710 caps the batch size at 10M1711 when max_batch_size is set1712 caps the batch size at max_batch_size1713 reaching the lower limit for the batch size1714 caps the batch size at 1k1715 when migration max_batch_size is less than MIN_BATCH_SIZE1716 does not raise an error1717Gitlab::Database::BackgroundMigration::BatchedJob1718 is expected to be a kind of Gitlab::Database::SharedModel(abstract)1719 is expected to contain exactly ActiveRecord::StatementTimeout, ActiveRecord::ConnectionTimeoutError, ActiveRecord::AdapterTimeout, ActiveRecord::LockWaitTimeout, and ActiveRecord::QueryCanceled1720 associations1721 is expected to belong to batched_migration required: false1722 is expected to have many batched_job_transition_logs1723 state machine1724 is expected to eql :pending, :running, :failed, and :succeeded1725 when a job is running1726 logs the transition1727 when a job succeed1728 logs the transition1729 updates the finished_at1730 creates a new transition log1731 when a job fails the number of max times1732 when job can be split1733 splits the job into two retriable jobs1734 when the job cannot be split1735 does not split the job1736 keeps the same job attributes1737 logs the error1738 when a job fails1739 logs the transition1740 tracks the exception1741 updates the finished_at1742 creates a new transition log1743 when job fails during sub batch processing1744 when sub batch size can be reduced in 25%1745 is expected to change `job.sub_batch_size` to 71746 when retries exceeds 2 attempts1747 calls split_and_retry! once sub_batch_size cannot be decreased anymore1748 is expected not to change `job.sub_batch_size`1749 scopes1750 .except_succeeded1751 returns not succeeded jobs1752 .active1753 returns active jobs1754 .stuck1755 returns stuck jobs1756 .retriable1757 returns retriable jobs1758 .created_since1759 returns jobs since a given time1760 .blocked_by_max_attempts1761 returns blocked jobs1762 delegated batched_migration attributes1763 #migration_job_class1764 returns the migration job_class1765 #migration_table_name1766 returns the migration table_name1767 #migration_column_name1768 returns the migration column_name1769 #migration_job_arguments1770 returns the migration job_arguments1771 #migration_job_class_name1772 returns the migration job_class_name1773 .extract_transition_options1774 args: [], expected_result: []1775 matches expected keys and result1776 args: [{:error=>StandardError}], expected_result: [StandardError, nil]1777 matches expected keys and result1778 args: [{:error=>StandardError, :from_sub_batch=>true}], expected_result: [StandardError, true]1779 matches expected keys and result1780 #can_split?1781 when the number of attempts is greater than the limit and the batch_size is greater than the sub_batch_size1782 when is a timeout exception1783 is expected to be truthy1784 when is a QueryCanceled exception1785 is expected to be truthy1786 when is not a timeout exception1787 is expected to be falsey1788 when the number of attempts is lower than the limit and the batch_size is greater than the sub_batch_size1789 when is a timeout exception1790 is expected to be falsey1791 when is not a timeout exception1792 is expected to be falsey1793 when the batch_size is lower than the sub_batch_size1794 is expected to be falsey1795 when the batch_size is 11796 is expected to be falsey1797 #can_reduce_sub_batch_size?1798 when the number of attempts is lower than the limit and batch size are within boundaries1799 is expected to equal true1800 when the number of attempts is lower than the limit and batch size are outside boundaries1801 is expected to equal false1802 when the number of attempts is greater than the limit and batch size are within boundaries1803 is expected to equal false1804 #time_efficiency1805 when job has not yet succeeded1806 returns nil1807 when finished_at is not set1808 returns nil1809 when started_at is not set1810 returns nil1811 when job has finished1812 returns ratio of duration to interval, here: 0.51813 returns ratio of duration to interval, here: 11814 #split_and_retry!1815 when job can be split1816 sets the correct attributes1817 splits the jobs into retriable jobs1818 when job is not failed1819 raises an exception1820 when batch size is already 11821 keeps the same batch size1822 resets the number of attempts1823 when computed midpoint is larger than the max value of the batch1824 lowers the batch size and resets the number of attempts1825 #reduce_sub_batch_size!1826 when the job sub batch size can be reduced1827 reduces sub batch size in 25%1828 log the changes1829 when reduced sub_batch_size is greater than sub_batch1830 doesn't allow sub_batch_size to greater than sub_batch1831 when sub_batch_size is already 11832 updates sub_batch_size to it's minimum value1833 when job has not failed1834 raises an exception1835 when the amount to be reduced exceeds the threshold1836 prevents sub batch size to be reduced1837Gitlab::Database::BackgroundMigration::BatchedJobTransitionLog1838 is expected to be a kind of Gitlab::Database::SharedModel(abstract)1839 associations1840 is expected to belong to batched_job required: false1841 validations1842 is expected to validate that :previous_status cannot be empty/falsy1843 is expected to validate that :next_status cannot be empty/falsy1844 is expected to validate that :batched_job cannot be empty/falsy1845 is expected to validate that the length of :exception_class is at most 1001846 is expected to validate that the length of :exception_message is at most 10001847 is expected to define :previous_status as an enum backed by an integer with values ‹[:pending, :running, :failed, :succeeded]›, prefix: true1848 is expected to define :next_status as an enum backed by an integer with values ‹[:pending, :running, :failed, :succeeded]›, prefix: true1849Gitlab::Database::BackgroundMigration::BatchedMigrationRunner1850 #run_migration_job1851 when the migration has no previous jobs1852 when the migration has batches to process1853 runs the job for the first batch1854 migration health1855 puts migration on hold on stop signal1856 optimizes migration on normal signal1857 optimizes migration on no signal1858 optimizes migration on unknown signal1859 when the batch maximum exceeds the migration maximum1860 clamps the batch maximum to the migration maximum1861 when the migration has no batches to process1862 behaves like it has completed the migration1863 does not create and run a migration job1864 marks the migration as finished1865 when the migration should stop1866 changes the status to failure1867 when the migration has previous jobs1868 when the migration has no batches remaining1869 behaves like it has completed the migration1870 does not create and run a migration job1871 marks the migration as finished1872 when the migration has batches to process1873 runs the migration job for the next batch1874 when the batch minimum exceeds the migration maximum1875 behaves like it has completed the migration1876 does not create and run a migration job1877 marks the migration as finished1878 when migration has failed jobs1879 retries the failed job1880 when failed job has reached the maximum number of attempts1881 marks the migration as failed1882 when migration has stuck jobs1883 retries the stuck job1884 when migration has possible stuck jobs1885 keeps the migration active1886 when the migration has batches to process and failed jobs1887 runs next batch then retries the failed job1888 #run_entire_migration1889 when not in a development or test environment1890 raises an error1891 when the given migration is not active1892 does not create and run migration jobs1893 when the given migration is active1894 runs all jobs inline until finishing the migration1895 #finalize1896 when the migration is not yet completed1897-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1898 -> 0.0016s1899-- create_table(:_test_batched_migrations_test_table, {:id=>false})1900 -> 0.0034s1901-- execute("INSERT INTO _test_batched_migrations_test_table VALUES (1, 1), (2, 2), (3, NULL), (4, NULL), (5, NULL), (6, NULL), (7, NULL), (8, NULL)")1902 -> 0.0021s1903-- execute("SELECT * FROM _test_batched_migrations_test_table WHERE some_id_convert_to_bigint IS NULL")1904 -> 0.0022s1905-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1906 -> 0.0024s1907 completes the migration1908 when migration fails to complete1909-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1910 -> 0.0015s1911-- create_table(:_test_batched_migrations_test_table, {:id=>false})1912 -> 0.0035s1913-- execute("INSERT INTO _test_batched_migrations_test_table VALUES (1, 1), (2, 2), (3, NULL), (4, NULL), (5, NULL), (6, NULL), (7, NULL), (8, NULL)")1914 -> 0.0020s1915-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1916 -> 0.0020s1917 raises an error1918 when the migration is already finished1919-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1920 -> 0.0015s1921-- create_table(:_test_batched_migrations_test_table, {:id=>false})1922 -> 0.0031s1923-- execute("INSERT INTO _test_batched_migrations_test_table VALUES (1, 1), (2, 2), (3, NULL), (4, NULL), (5, NULL), (6, NULL), (7, NULL), (8, NULL)")1924 -> 0.0022s1925-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1926 -> 0.0021s1927 is a no-op1928 when the migration does not exist1929-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1930 -> 0.0017s1931-- create_table(:_test_batched_migrations_test_table, {:id=>false})1932 -> 0.0036s1933-- execute("INSERT INTO _test_batched_migrations_test_table VALUES (1, 1), (2, 2), (3, NULL), (4, NULL), (5, NULL), (6, NULL), (7, NULL), (8, NULL)")1934 -> 0.0019s1935-- drop_table(:_test_batched_migrations_test_table, {:if_exists=>true})1936 -> 0.0023s1937 is a no-op1938 .finalize1939 when the connection is passed1940 initializes the object with the given connection1941Gitlab::Database::BackgroundMigration::BatchedMigration1942 is expected to be a kind of Gitlab::Database::SharedModel(abstract)1943 associations1944 is expected to have many batched_jobs1945 #last_job1946 returns the batched job with highest max_value1947 validations1948 is expected to validate that :job_arguments is case-sensitively unique within the scope of :job_class_name, :table_name, and :column_name1949 when there are failed jobs1950 raises an exception1951 when the jobs are completed1952 finishes the migration1953 updates the finished_at1954 state machine1955 when a migration is executed1956 updates the started_at1957 #pause!1958 when an invalid transition is applied1959 raises an exception1960 raises an exception1961 raises an exception1962 when a valid transition is applied1963 moves to pause1964 moves to pause1965 #execute!1966 when an invalid transition is applied1967 raises an exception1968 raises an exception1969 when a valid transition is applied1970 moves to active1971 moves to active1972 moves to active1973 #finish!1974 when an invalid transition is applied1975 raises an exception1976 when a valid transition is applied1977 moves to active1978 moves to active1979 moves to active1980 moves to active1981 #failure!1982 when an invalid transition is applied1983 raises an exception1984 raises an exception1985 when a valid transition is applied1986 moves to active1987 moves to active1988 moves to active1989 .valid_status1990 returns valid status1991 .queue_order1992 returns batched migrations ordered by their id1993 .ordered_by_created_at_desc1994 returns batched migrations ordered by created_at (DESC)1995 .find_executable1996 when the migration does not exist1997 returns nil1998 when the migration is not active1999 returns nil2000 when the migration is on hold2001 returns nil2002 when the migration is not available for the current connection2003 returns nil2004 when ther migration exists and is executable2005 returns the migration2006 .active_migrations_distinct_on_table2007 returns one pending executable migration per table2008 returns epmty collection when there are no pending executable migrations2009 .created_after2010 only returns migrations created after the specified time2011 .queued2012 returns active and paused migrations2013 .finalizing2014 returns only finalizing migrations2015 .successful_rows_counts2016 returns totals from successful jobs2017 #reset_attempts_of_blocked_jobs!2018 sets the number of attempts to zero for blocked jobs2019 #interval_elapsed?2020 when the migration has no last_job2021 returns true2022 when the migration has a last_job2023 when the last_job is less than an interval old2024 returns false2025 when the last_job is exactly an interval old2026 returns true2027 when the last_job is more than an interval old2028 returns true2029 when an interval variance is given2030 when the last job is less than an interval with variance old2031 returns false2032 when the last job is more than an interval with variance old2033 returns true2034 #create_batched_job!2035 creates a batched_job with the correct batch configuration2036 #next_min_value2037 when a previous job exists2038 returns the next value after the previous maximum2039 when a previous job does not exist2040 returns the migration minimum value2041 #job_class2042 returns the class of the job for the migration2043 #batch_class2044 returns the class of the batch strategy for the migration2045 #retry_failed_jobs!2046 when there are failed migration jobs2047 moves the status of the migration to active2048 changes the number of attempts to 02049 when there are no failed migration jobs2050 moves the status of the migration to active2051 #should_stop?2052 when the started_at is nil2053 is expected to be falsey2054 when the number of jobs is lesser than the MINIMUM_JOBS2055 is expected to be falsey2056 when the calculated value is greater than the threshold2057 is expected to be truthy2058 when the calculated value is lesser than the threshold2059 is expected to be falsey2060 #job_class_name=2061 behaves like an attr_writer that assigns class names2062 when a module name exists2063 keeps the class with module name2064 removes leading namespace resolution operator2065 when a module name does not exist2066 does not change the given class name2067 #batch_class_name=2068 behaves like an attr_writer that assigns class names2069 when a module name exists2070 keeps the class with module name2071 removes leading namespace resolution operator2072 when a module name does not exist2073 does not change the given class name2074 #migrated_tuple_count2075 sums the batch_size of succeeded jobs2076 #prometheus_labels2077 returns a hash with labels for the migration2078 #smoothed_time_efficiency2079 when there are not enough jobs2080 returns nil2081 when there are enough jobs2082 example 1: increasing trend, but only recently crossed threshold2083 returns the smoothed time efficiency2084 example 2: increasing trend, crossed threshold a while ago2085 returns the smoothed time efficiency2086 example 3: decreasing trend, but only recently crossed threshold2087 returns the smoothed time efficiency2088 example 4: latest run spiked2089 returns the smoothed time efficiency2090 with preloaded batched migration2091 avoids N+12092 #optimize!2093 calls the BatchOptimizer2094 #hold!2095 updates on_hold_until property2096 defaults to 10 minutes2097 #on_hold?2098 returns false if no on_hold_until is set2099 returns false if on_hold_until has passed2100 returns true if on_hold_until is in the future2101 #progress2102 when the migration is completed2103 returns 1002104 when the status is finished2105 returns 1002106 when the migration does not have jobs2107 returns zero2108 when the `total_tuple_count` is zero2109 returns nil2110 when migration has completed jobs2111 calculates the progress2112 .for_configuration2113 finds the migration matching the given configuration parameters2114 filters by gitlab schemas available for the connection2115 doesn not filter by gitlab schemas available for the connection if the column is nor present2116 .find_for_configuration2117 returns nill if such migration does not exists2118 returns the migration when it exists2119 .for_gitlab_schema2120 finds the migrations matching the given gitlab schema2121Gitlab::Database::BackgroundMigration::BatchedMigrationWrapper#perform2122 runs the migration job2123 updates the tracking record in the database2124 when running a job that failed previously2125 increments attempts and updates other fields2126 when the migration job does not raise an error2127 marks the tracking record as succeeded2128 tracks metrics of the execution2129 when the migration job raises an error2130 behaves like an error is raised2131 marks the tracking record as failed2132 tracks metrics of the execution2133 behaves like an error is raised2134 marks the tracking record as failed2135 tracks metrics of the execution2136 behaves like an error is raised2137 marks the tracking record as failed2138 tracks metrics of the execution2139 behaves like an error is raised2140 marks the tracking record as failed2141 tracks metrics of the execution2142 when the batched background migration does not inherit from BatchedMigrationJob2143 runs the job with the correct arguments2144Gitlab::Database::BackgroundMigration::PrometheusMetrics2145 #track2146 reports batch_size2147 reports sub_batch_size2148 reports interval2149 reports job duration2150 increments updated tuples (currently based on batch_size)2151 reports migrated tuples2152 reports the total tuple count for the migration2153 reports last updated at timestamp2154 reports summary of query timings2155 when the tracking record does not having timing metrics2156 does not attempt to report query timings2157Gitlab::Database::BackgroundMigrationJob2158 is expected to be a kind of Gitlab::Database::SharedModel(abstract)2159 behaves like having unique enum values2160 has unique values in "status"2161 .for_migration_execution2162 returns jobs matching class_name and arguments2163 normalizes class names by removing leading ::2164 .mark_all_as_succeeded2165 marks all matching jobs as succeeded2166 normalizes class_names by removing leading ::2167 returns the number of jobs updated2168 when previous matching jobs have already succeeded2169 does not update non-pending jobs2170 #class_name=2171 when the class_name is given without the leading ::2172 sets the class_name to the given value2173 when the class_name is given with the leading ::2174 removes the leading :: when setting the class_name2175 when the value is nil2176 sets the class_name to nil2177 when the values is blank2178 sets the class_name to the given value2179Gitlab::Database::BatchAverageCounter2180 # order random2181 #count2182 returns correct average of weights2183 does no raise an exception if transaction is not open2184 when transaction is open2185 raises an error2186 when batch size is small2187 returns correct average of weights2188 when column passed is an Arel attribute2189 returns correct average of weights2190 when column has total count of zero2191 returns the fallback value2192 when one batch has nil weights (no average)2193 calculates average of weights with no errors2194 when batch fetch query is cancelled2195 when all retries fail2196 logs failing query2197Gitlab::Database::BatchCount2198 #batch_count2199 counts table2200 counts with :id field2201 counts with "id" field2202 counts with table.id field2203 counts with Arel column2204 counts table with batch_size 50K2205 will not count table with a batch size less than allowed2206 produces the same result with different batch sizes2207 counts with a start and finish2208 stops counting when finish value is reached2209 defaults the batch size to 1000002210 does not use BETWEEN to define the range2211 behaves like when a transaction is open2212 raises an error2213 behaves like when batch fetch query is canceled2214 reduces batch size by half and retry fetch2215 when all retries fail2216 logs failing query2217 disallowed_configurations2218 returns fallback if start is bigger than finish2219 returns fallback if loops more than allowed2220 returns fallback if batch size is less than min required2221 raises an error if distinct count is requested2222 when a relation is grouped2223 count by default column2224 counts grouped records2225 #batch_count_with_timeout2226 counts table2227 counts with :id field2228 counts with "id" field2229 counts with table.id field2230 counts with Arel column2231 counts table with batch_size 50K2232 will not count table with a batch size less than allowed2233 produces the same result with different batch sizes2234 counts with a start and finish2235 stops counting when finish value is reached2236 returns a partial count when timeout elapses2237 starts counting from a given partial result2238 behaves like when a transaction is open2239 raises an error2240 behaves like when batch fetch query is canceled2241 reduces batch size by half and retry fetch2242 when all retries fail2243 logs failing query2244 disallowed_configurations2245 returns fallback if start is bigger than finish2246 returns fallback if loops more than allowed2247 returns fallback if batch size is less than min required2248 raises an error if distinct count is requested2249 when a relation is grouped2250 count by default column2251 counts grouped records2252 #batch_distinct_count2253 counts with column field2254 counts with "id" field2255 counts with table.column field2256 counts with Arel column2257 counts with :column field with batch_size of 50K2258 will not count table with a batch size less than allowed2259 produces the same result with different batch sizes2260 counts with a start and finish2261 stops counting when finish value is reached2262 counts with User min and max as start and finish2263 defaults the batch size to 100002264 behaves like when a transaction is open2265 raises an error2266 disallowed configurations2267 returns fallback if start is bigger than finish2268 returns fallback if loops more than allowed2269 returns fallback if batch size is less than min required2270 will raise an error if distinct count with the :id column is requested2271 when a relation is grouped2272 distinct count by non-unique column2273 counts grouped records2274 behaves like when batch fetch query is canceled2275 reduces batch size by half and retry fetch2276 when all retries fail2277 logs failing query2278 #batch_sum2279 returns the sum of values in the given column2280 works when given an Arel column2281 works with a batch size of 50K2282 works with start and finish provided2283 returns the same result regardless of batch size2284 defaults the batch size to 10002285 behaves like when a transaction is open2286 raises an error2287 behaves like disallowed configurations2288 returns fallback if start is bigger than finish2289 returns fallback if loops more than allowed2290 returns fallback if batch size is less than min required2291 behaves like when batch fetch query is canceled2292 reduces batch size by half and retry fetch2293 when all retries fail2294 logs failing query2295 #batch_average2296 calls BatchAverageCounter2297Gitlab::Database::BulkUpdate2298 is possible to update all objects in a single query2299 is possible to update heterogeneous sets2300 error states2301 does not raise errors on valid inputs2302 expects a non-empty list of column names2303 expects all columns to be symbols2304 expects all columns to be valid columns on the tables2305 refuses to set ID2306 expects a non-empty mapping2307 expects all map values to be Hash instances2308 validates prepared_statements support2309 prepared_statements: false2310 sets multiple values2311 prepared_statements: true2312 sets multiple values2313ClickHouse::Client2314 # order random2315 when click_house spec tag is not added2316 does not have any ClickHouse databases configured2317Gitlab::Database::ConnectionTimer2318 .starting_now2319 when the configured interval is positive2320 randomizes the interval of the created timer2321 when the configured interval is not positive2322 sets the interval of the created timer to nil2323 .expired?2324 when the interval is positive2325 when the interval has elapsed2326 returns true2327 when the interval has not elapsed2328 returns false2329 when the interval is not positive2330 when the interval has elapsed2331 returns false2332 when the interval has not elapsed2333 returns false2334 when the interval is nil2335 returns false2336 .reset!2337 updates the timer clock value2338Gitlab::Database::ConsistencyChecker2339 #over_time_limit?2340 returns true only if the running time has exceeded MAX_RUNTIME2341 #execute2342 when empty tables2343 returns an empty response2344 when the tables contain matching items2345 does not process more than MAX_BATCHES2346 doesn not exceed the MAX_RUNTIME2347 returns the correct number of matches and batches checked2348 returns the min_id as the next_start_id if the check reaches the last element2349 when some items are missing from the first table2350 reports the missing elements2351 when some items are missing from the second table2352 reports the missing elements2353 when elements are different between the two tables2354 reports the difference between the two tables2355Gitlab::Database::Consistency2356 .with_read_consistency2357 sticks to primary database2358Gitlab::Database::ConvertFeatureCategoryToGroupLabel2359 # order random2360 #execute2361 when the group label exists2362 returns a group label2363 when the group label does not exist2364 returns nil2365Gitlab::Database::Count::ExactCountStrategy2366 #count2367 counts all models2368 returns default value if count times out2369Gitlab::Database::Count::ReltuplesCountStrategy2370 #count2371 when reltuples is up to date2372 uses statistics to do the count2373 when models using single-type inheritance are used2374 returns nil counts for inherited tables2375 insufficient permissions2376 returns an empty hash2377Gitlab::Database::Count::TablesampleCountStrategy2378 #count2379 for tables with an estimated small size2380 performs an exact count2381 for tables with an estimated large size2382 performs a tablesample count2383 insufficient permissions2384 returns an empty hash2385Gitlab::Database::Count2386 .approximate_counts2387 fallbacks2388 gets results from first strategy2389 gets more results from second strategy if some counts are missing2390 does not get more results as soon as all counts are present2391 default strategies2392 with a read-only database2393 only uses the ExactCountStrategy2394 with a read-write database2395 uses the available strategies2396Gitlab::Database::DatabaseConnectionInfo2397 # order random2398 #connection_class2399 when klass is "ActiveRecord::Base"2400 does always return "ActiveRecord::Base"2401 when klass is "Ci::ApplicationRecord"2402 does return "Ci::ApplicationRecord" when it is connection_class2403 does return nil when it is not connection_class2404 .load_file2405 does load YAML file and has file_path specified2406 #has_gitlab_shared?2407 gitlab_schemas: ["gitlab_main"], result: false2408 is expected to eq false2409 gitlab_schemas: ["gitlab_main", "gitlab_shared"], result: true2410 is expected to eq true2411 db_docs_dir2412 when db_dir is specified2413 is expected to eq #<Pathname:/builds/edith007/gitlab/ee/my/db/docs>2414 when db_dir is not specified fallbacks to "db/docs"2415 is expected to eq #<Pathname:/builds/edith007/gitlab/db/docs>2416 #connection_class_or_fallback2417 for "main"2418 does return ActiveRecord::Base2419 for "ci"2420 does return "Ci::ApplicationRecord" when it is connection_class2421 does return "ActiveRecord::Base" (fallback to "main") when it is not connection_class2422 .new2423 does convert attributes into symbols and objects2424 does raise error when using invalid argument2425 #order2426 name: :main, order: 02427 is expected to eq 02428 name: :ci, order: 12429 is expected to eq 12430 name: :undefined, order: 10002431 is expected to eq 10002432Gitlab::Database::DynamicModelHelpers2433 #define_batchable_model2434 is an ActiveRecord model2435 includes EachBatch2436 has the correct table name2437 has the inheritance type column disable2438 #each_batch2439 when no transaction is open2440 iterates table in batches2441 when a column to be batched over is specified2442 iterates table in batches using the given column2443 when transaction is open2444 raises an error2445 #each_batch_range2446 when no transaction is open2447 iterates table in batch ranges2448 yields only one batch if bigger than the table size2449 makes it possible to apply a scope2450 when primary key is not named id2451 iterates table in batch ranges using the correct primary key2452 when a column to be batched over is specified2453 iterates table in batch ranges using the given column2454 when transaction is open2455 raises an error2456Gitlab::Database::EachDatabase2457 .each_connection2458 yields each connection after connecting SharedModel2459 when only certain databases are selected2460 yields the selected connections after connecting SharedModel2461 when the selected names are passed as symbols2462 yields the selected connections after connecting SharedModel2463 when the selected names are invalid2464 does not yield any connections2465 raises an error2466 when shared connections are not included2467 only yields the unshared connections2468 .each_model_connection2469 when the model inherits from SharedModel2470 yields each model with SharedModel connected to each database connection2471 when the model limits connection names2472 only yields the model with SharedModel connected to the limited connections2473 when the model does not inherit from SharedModel2474 yields each model after connecting SharedModel2475 when the database connections are limited by the only_on option2476 when a single name is passed in2477 yields models only connected to the given database2478 when a list of names are passed in2479 yields models only connected to the given databases2480Gitlab::Database::GitlabSchemaInfo2481 # order random2482 .load_file2483 does load YAML file and has file_path specified2484 .new2485 does ensure that name is always symbol2486 does raise error when using invalid argument2487Gitlab::Database::GitlabSchema2488 .deleted_views_and_tables_to_schema2489 all tables and views have assigned a known gitlab_schema2490 .views_and_tables_to_schema2491 all tables and views have assigned a known gitlab_schema2492 all tables and views are unique2493 for /builds/edith007/gitlab/db/docs2494 validates 'main' using 'ActiveRecord::Base'2495 new data sources are added2496 non-existing data sources are removed2497 validates 'ci' using 'Ci::ApplicationRecord'2498 new data sources are added2499 non-existing data sources are removed2500 .dictionary_path_globs2501 returns an array of path globs2502 returns an array of path globs2503 returns an array of path globs2504 returns an array of path globs2505 .tables_to_schema2506 returns only tables2507 .views_to_schema2508 returns only views2509 .table_schemas!2510 returns the matched schemas2511 when one of the tables does not have a matching table schema2512 raises error2513 .table_schema2514 behaves like maps table name to table schema2515 name: "ci_builds", classification: :gitlab_ci2516 is expected to eq :gitlab_ci2517 name: "my_schema.ci_builds", classification: :gitlab_ci2518 is expected to eq :gitlab_ci2519 name: "my_schema.ci_runner_machine_builds_100", classification: :gitlab_ci2520 is expected to eq :gitlab_ci2521 name: "my_schema._test_gitlab_main_table", classification: :gitlab_main2522 is expected to eq :gitlab_main2523 name: "information_schema.columns", classification: :gitlab_internal2524 is expected to eq :gitlab_internal2525 name: "audit_events_part_5fc467ac26", classification: :gitlab_main2526 is expected to eq :gitlab_main2527 name: "_test_gitlab_main_table", classification: :gitlab_main2528 is expected to eq :gitlab_main2529 name: "_test_gitlab_ci_table", classification: :gitlab_ci2530 is expected to eq :gitlab_ci2531 name: "_test_gitlab_main_clusterwide_table", classification: :gitlab_main_clusterwide2532 is expected to eq :gitlab_main_clusterwide2533 name: "_test_gitlab_main_cell_table", classification: :gitlab_main_cell2534 is expected to eq :gitlab_main_cell2535 name: "_test_gitlab_pm_table", classification: :gitlab_pm2536 is expected to eq :gitlab_pm2537 name: "_test_my_table", classification: :gitlab_shared2538 is expected to eq :gitlab_shared2539 name: "pg_attribute", classification: :gitlab_internal2540 is expected to eq :gitlab_internal2541 when mapping fails2542 is expected to be nil2543 when an index name is used as the table name2544 is expected to be nil2545 .table_schema!2546 behaves like maps table name to table schema2547 name: "ci_builds", classification: :gitlab_ci2548 is expected to eq :gitlab_ci2549 name: "my_schema.ci_builds", classification: :gitlab_ci2550 is expected to eq :gitlab_ci2551 name: "my_schema.ci_runner_machine_builds_100", classification: :gitlab_ci2552 is expected to eq :gitlab_ci2553 name: "my_schema._test_gitlab_main_table", classification: :gitlab_main2554 is expected to eq :gitlab_main2555 name: "information_schema.columns", classification: :gitlab_internal2556 is expected to eq :gitlab_internal2557 name: "audit_events_part_5fc467ac26", classification: :gitlab_main2558 is expected to eq :gitlab_main2559 name: "_test_gitlab_main_table", classification: :gitlab_main2560 is expected to eq :gitlab_main2561 name: "_test_gitlab_ci_table", classification: :gitlab_ci2562 is expected to eq :gitlab_ci2563 name: "_test_gitlab_main_clusterwide_table", classification: :gitlab_main_clusterwide2564 is expected to eq :gitlab_main_clusterwide2565 name: "_test_gitlab_main_cell_table", classification: :gitlab_main_cell2566 is expected to eq :gitlab_main_cell2567 name: "_test_gitlab_pm_table", classification: :gitlab_pm2568 is expected to eq :gitlab_pm2569 name: "_test_my_table", classification: :gitlab_shared2570 is expected to eq :gitlab_shared2571 name: "pg_attribute", classification: :gitlab_internal2572 is expected to eq :gitlab_internal2573 when mapping fails2574 raises error2575 when testing cross schema access2576 .cross_joins_allowed?2577 schemas: [], result: true2578 is expected to eq true2579 schemas: [:gitlab_main_clusterwide, :gitlab_main], result: true2580 is expected to eq true2581 schemas: [:gitlab_main_clusterwide, :gitlab_ci], result: false2582 is expected to eq false2583 schemas: [:gitlab_main_clusterwide, :gitlab_main, :gitlab_ci], result: false2584 is expected to eq false2585 schemas: [:gitlab_main_clusterwide, :gitlab_internal], result: false2586 is expected to eq false2587 schemas: [:gitlab_main, :gitlab_ci], result: false2588 is expected to eq false2589 schemas: [:gitlab_main_clusterwide, :gitlab_main, :gitlab_shared], result: true2590 is expected to eq true2591 schemas: [:gitlab_main_clusterwide, :gitlab_shared], result: true2592 is expected to eq true2593 .cross_transactions_allowed?2594 schemas: [], result: true2595 is expected to eq true2596 schemas: [:gitlab_main_clusterwide, :gitlab_main], result: true2597 is expected to eq true2598 schemas: [:gitlab_main_clusterwide, :gitlab_ci], result: false2599 is expected to eq false2600 schemas: [:gitlab_main_clusterwide, :gitlab_main, :gitlab_ci], result: false2601 is expected to eq false2602 schemas: [:gitlab_main_clusterwide, :gitlab_internal], result: true2603 is expected to eq true2604 schemas: [:gitlab_main, :gitlab_ci], result: false2605 is expected to eq false2606 schemas: [:gitlab_main_clusterwide, :gitlab_main, :gitlab_shared], result: true2607 is expected to eq true2608 schemas: [:gitlab_main_clusterwide, :gitlab_shared], result: true2609 is expected to eq true2610 .cross_foreign_key_allowed?2611 schemas: [], result: false2612 is expected to eq false2613 schemas: [:gitlab_main_clusterwide, :gitlab_main], result: true2614 is expected to eq true2615 schemas: [:gitlab_main_clusterwide, :gitlab_ci], result: false2616 is expected to eq false2617 schemas: [:gitlab_main_clusterwide, :gitlab_internal], result: false2618 is expected to eq false2619 schemas: [:gitlab_main, :gitlab_ci], result: false2620 is expected to eq false2621 schemas: [:gitlab_main_clusterwide, :gitlab_shared], result: false2622 is expected to eq false2623Gitlab::Database::Grant2624 .create_and_execute_trigger2625 returns true when the user can create and execute a trigger2626 returns false when the user can not create and/or execute a trigger2627Gitlab::Database::HealthStatus::Indicators::AutovacuumActiveOnTable2628 # order random2629 #evaluate2630 without autovacuum activity2631 returns Normal signal2632 remembers the indicator class2633 with autovacuum activity2634 returns Stop signal2635 explains why2636 remembers the indicator class2637 returns NoSignal signal in case the feature flag is disabled2638Gitlab::Database::HealthStatus::Indicators::PatroniApdex2639 # order random2640 #evaluate2641 behaves like Patroni Apdex Evaluator2642 with main schema2643 returns NoSignal signal in case the feature flag is disabled2644 returns Normal signal when Patroni apdex SLI is above SLO2645 returns Stop signal when Patroni apdex is below SLO2646 without prometheus_alert_db_indicators_settings2647 returns Unknown signal2648 when Prometheus client is not ready2649 returns Unknown signal2650 when apdex SLI query is not configured2651 returns Unknown signal2652 when slo is not configured2653 returns Unknown signal2654 when Patroni apdex can not be calculated2655 result: nil2656 returns Unknown signal2657 result: []2658 returns Unknown signal2659 result: [{}]2660 returns Unknown signal2661 result: [{"value"=>1}]2662 returns Unknown signal2663 result: [{"value"=>[1]}]2664 returns Unknown signal2665 behaves like Patroni Apdex Evaluator2666 with ci schema2667 returns NoSignal signal in case the feature flag is disabled2668 returns Normal signal when Patroni apdex SLI is above SLO2669 returns Stop signal when Patroni apdex is below SLO2670 without prometheus_alert_db_indicators_settings2671 returns Unknown signal2672 when Prometheus client is not ready2673 returns Unknown signal2674 when apdex SLI query is not configured2675 returns Unknown signal2676 when slo is not configured2677 returns Unknown signal2678 when Patroni apdex can not be calculated2679 result: nil2680 returns Unknown signal2681 result: []2682 returns Unknown signal2683 result: [{}]2684 returns Unknown signal2685 result: [{"value"=>1}]2686 returns Unknown signal2687 result: [{"value"=>[1]}]2688 returns Unknown signal2689Gitlab::Database::HealthStatus::Indicators::WriteAheadLog2690 # order random2691 #evaluate2692 remembers the indicator class2693 returns NoSignal signal in case the feature flag is disabled2694 returns NoSignal signal when WAL archive queue can not be calculated2695 uses primary database2696 when WAL archive queue size is below the limit2697 returns Normal signal2698 when WAL archive queue size is above the limit2699 returns Stop signal2700Gitlab::Database::HealthStatus::Logger2701 # order random2702 excludes context2703 behaves like a json logger2704 formats strings2705 formats hashes2706Gitlab::Database::HealthStatus::Signals2707 # order random2708 with Unknown signal it should only log and not stop2709 behaves like health status signal2710 #log_info?2711 returns the log signal2712 #stop?2713 returns the stop signal2714 with NotAvailable signal it should not stop and log2715 behaves like health status signal2716 #log_info?2717 returns the log signal2718 #stop?2719 returns the stop signal2720 with Stop signal it should stop and log2721 behaves like health status signal2722 #log_info?2723 returns the log signal2724 #stop?2725 returns the stop signal2726 with Normal signal it should not stop and log2727 behaves like health status signal2728 #log_info?2729 returns the log signal2730 #stop?2731 returns the stop signal2732Gitlab::Database::HealthStatus2733 # order random2734 .evaluate2735 returns the signal of the given indicator2736 does not log signals of no interest2737 with default indicators2738 returns a collection of signals2739 with stop signals2740 with batched migrations as the status checker2741 captures BatchedMigration class name in the log2742 with sidekiq deferred job as the status checker2743 captures sidekiq job class in the log2744 on indicator error2745 does not fail2746 returns Unknown signal2747 reports the exception to error tracking2748Gitlab::Database::LoadBalancing::ActionCableCallbacks2749 .wrapper2750 releases the connection and clears the session2751 with an exception2752 releases the connection and clears the session2753Gitlab::Database::LoadBalancing::Configuration2754 .for_model2755 when load balancing is not configured2756 uses the default settings2757 when load balancing is configured2758 uses the custom configuration settings2759 when the load balancing configuration uses strings as the keys2760 uses the custom configuration settings2761 #load_balancing_enabled?2762 returns false when running inside a Rake task2763 returns true when hosts are configured2764 returns true when a service discovery record is configured2765 returns false when no hosts are configured and service discovery is disabled2766 #service_discovery_enabled?2767 returns false when running inside a Rake task2768 returns true when a record is configured2769 returns false when no record is configured2770 #pool_size2771 when a custom pool size is used2772 always reads the value from the model configuration2773 when the pool size is nil2774 returns the default pool size2775 #db_config_name2776 returns connection name as symbol2777 #db_config2778 returns exactly db_config2779Gitlab::Database::LoadBalancing::ConnectionProxy2780 #select2781 performs a read2782 #select_all2783 method signatures match2784 using a SELECT query2785 runs the query on a secondary2786 using a SELECT FOR UPDATE query2787 runs the query on the primary and sticks to it2788 sanitize_limit2789 runs the query on the replica2790 select2791 runs the query on the replica2792 select_one2793 runs the query on the replica2794 select_rows2795 runs the query on the replica2796 quote_column_name2797 runs the query on the replica2798 delete2799 runs the query on the primary and sticks to it2800 delete_all2801 runs the query on the primary and sticks to it2802 insert2803 runs the query on the primary and sticks to it2804 update2805 runs the query on the primary and sticks to it2806 update_all2807 runs the query on the primary and sticks to it2808 exec_insert_all2809 runs the query on the primary and sticks to it2810 methods using exec_insert_all on the connection2811 #upsert2812-- create_table(:_test_connection_proxy_insert_all, {:force=>true})2813 -> 0.0069s2814-- drop_table(:_test_connection_proxy_insert_all, {:force=>true})2815 -> 0.0023s2816 upserts a record and marks the session to stick to the primary2817 #insert_all!2818-- create_table(:_test_connection_proxy_insert_all, {:force=>true})2819 -> 0.0083s2820-- drop_table(:_test_connection_proxy_insert_all, {:force=>true})2821 -> 0.0024s2822 inserts multiple records and marks the session to stick to the primary2823 #insert2824-- create_table(:_test_connection_proxy_insert_all, {:force=>true})2825 -> 0.0086s2826-- drop_table(:_test_connection_proxy_insert_all, {:force=>true})2827 -> 0.0028s2828 inserts a single record and marks the session to stick to the primary2829 #transaction2830 session fallbacks ambiguous queries to replicas2831 with a read query2832 runs the transaction and any nested queries on the replica2833 with a write query2834 raises an exception2835 session does not fallback to replicas for ambiguous queries2836 with a read query2837 runs the transaction and any nested queries on the primary and stick to it2838 with a write query2839 runs the transaction and any nested queries on the primary and stick to it2840 #method_missing2841 runs the query on the primary without sticking to it2842 properly forwards keyword arguments2843 current session prefers to fallback ambiguous queries to replicas2844 runs the query on the replica2845 properly forwards keyword arguments2846 #read_using_load_balancer2847 with a regular session2848 uses a secondary2849 with a regular session and forcing all reads to replicas2850 uses a secondary2851 with a session using the primary but forcing all reads to replicas2852 uses a secondary2853 with a session using the primary2854 uses the primary2855 #write_using_load_balancer2856 uses but does not stick to the primary2857Gitlab::Database::LoadBalancing::HostList2858 #initialize2859 sets metrics for current number of hosts and current index2860 #length2861 returns the number of hosts in the list2862 #host_names_and_ports2863 with ports2864 returns the host names of all hosts2865 without ports2866 returns the host names of all hosts2867 #hosts2868 returns a copy of the host2869 #hosts=2870 updates the list of hosts to use2871 #next2872 returns a host2873 cycles through all available hosts2874 skips hosts that are offline2875 returns nil if no hosts are online2876 returns nil if no hosts are available2877 #shuffle2878 randomizes the list2879Gitlab::Database::LoadBalancing::Host2880 #connection2881 returns a connection from the pool2882 #disconnect!2883 disconnects the pool2884 disconnects the pool when waiting for connections takes too long2885 #release_connection2886 releases the current connection from the pool2887 #offline!2888 marks the host as offline2889 #online?2890 when the replica status is recent enough2891 returns the latest status2892 returns an offline status2893 when the replica status is outdated2894 refreshes the status2895 and replica is not up to date2896 marks the host offline2897 when the replica is not online2898 returns false when ActionView::Template::Error is raised2899 returns false when ActiveRecord::StatementInvalid is raised2900 returns false when PG::Error is raised2901 returns false when ActiveRecord::ConnectionNotEstablished is raised2902 #refresh_status2903 refreshes the status2904 clears the cache for latest_lsn_query2905 #check_replica_status?2906 returns true when we need to check the replica status2907 returns false when we do not need to check the replica status2908 #replica_is_up_to_date?2909 when the lag time is below the threshold2910 returns true2911 when the lag time exceeds the threshold2912 returns true if the data is recent enough2913 returns false when the data is not recent enough2914 #replication_lag_below_threshold2915 returns true when the lag time is below the threshold2916 returns false when the lag time exceeds the threshold2917 returns false when no lag time could be calculated2918 #data_is_recent_enough?2919 returns true when the data is recent enough2920 returns false when the data is not recent enough2921 returns false when no lag size could be calculated2922 #replication_lag_time2923 returns the lag time as a Float2924 returns nil when the database query returned no rows2925 #replication_lag_size2926 returns the lag size as an Integer2927 returns nil when the database query returned no rows2928 returns nil when the database connection fails2929 when can_track_logical_lsn? is false2930 uses LATEST_LSN_WITHOUT_LOGICAL_QUERY2931 when can_track_logical_lsn? is true2932 uses LATEST_LSN_WITH_LOGICAL_QUERY2933 when CAN_TRACK_LOGICAL_LSN_QUERY raises connection errors2934 uses LATEST_LSN_WITHOUT_LOGICAL_QUERY2935 #primary_write_location2936 returns the write location of the primary2937 #caught_up?2938 returns true when a host has caught up2939 returns false when diff query returns nothing2940 returns false when a host has not caught up2941 returns false when the connection fails2942 #database_replica_location2943 returns the write ahead location of the replica2944 returns nil when the database query returned no rows2945 returns nil when the database connection fails2946 #query_and_release2947 executes a SQL query2948 releases the connection after running the query2949 returns an empty Hash in the event of an error2950 #host2951 returns the hostname2952Gitlab::Database::LoadBalancing::LoadBalancer2953 #initialize2954 ignores the hosts when load balancing is disabled2955 sets the name of the connection that is used2956 #read2957 yields a connection for a read2958 ensures that query cache is enabled2959 does not enable query cache when outside Rails executor context2960 marks hosts that are offline2961 retries a query in the event of a serialization failure2962 retries every host at most 3 times when a query conflict is raised2963 uses the primary if no secondaries are available2964 uses the primary when load balancing is disabled2965 behaves like logs service discovery thread interruption2966 with service discovery2967 calls logs service discovery thread interruption2968 only primary is configured2969 does not retry a query on connection error if only the primary is configured2970 #read_write2971 yields a connection for a write2972 uses a retry with exponential backoffs2973 does not raise NoMethodError error when primary_only?2974 behaves like logs service discovery thread interruption2975 with service discovery2976 calls logs service discovery thread interruption2977 #host2978 returns the secondary host to use2979 stores the host in a thread-local variable2980 does not create conflicts with other load balancers when caching hosts2981 #release_host2982 releases the host and its connection2983 #release_primary_connection2984 releases the connection to the primary2985 #primary_write_location2986 returns a String in the right format2987 raises an error if the write location could not be retrieved2988 #retry_with_backoff2989 returns the value returned by the block2990 re-raises errors not related to database connections2991 retries the block when a connection error is raised2992 re-raises the connection error if the retries did not succeed2993 skips retries when only the primary is used2994 yields the current retry iteration2995 #connection_error?2996 returns true for a connection error2997 returns false for a missing database error2998 returns true for a wrapped connection error2999 returns true for a wrapped connection error from a view3000 returns true for deeply wrapped/nested errors3001 returns true for an invalid encoding error3002 returns false for errors not related to database connections3003 returns false for ActiveRecord errors without a cause3004 #serialization_failure?3005 returns for a serialization error3006 returns true for a wrapped error3007 #select_up_to_date_host3008 when none of the replicas are caught up3009 returns false and does not update the host thread-local variable3010 when any of the replicas is caught up3011 returns true and sets host thread-local variable3012 #create_replica_connection_pool3013 creates a new connection pool with specific pool size and name3014 allows setting of a custom hostname and port3015 does not modify connection class pool3016 #disconnect!3017 calls disconnect on all hosts with a timeout3018 #get_write_location3019 returns a string3020 returns nil if there are no results3021 #wal_diff3022 returns the diff between two write locations3023Gitlab::Database::LoadBalancing::Logger3024 # order random3025 excludes context3026 behaves like a json logger3027 formats strings3028 formats hashes3029Gitlab::Database::LoadBalancing::PrimaryHost3030 #connection3031 returns a connection from the pool3032 #release_connection3033 does nothing3034 #enable_query_cache!3035 does nothing3036 #disable_query_cache!3037 does nothing3038 #query_cache_enabled3039 delegates to the primary connection pool3040 #disconnect!3041 does nothing3042 #offline!3043 logs the event but does nothing else3044 #online?3045 returns true3046 #primary_write_location3047 raises NotImplementedError3048 #caught_up?3049 returns true3050 #database_replica_location3051 raises NotImplementedError3052Gitlab::Database::LoadBalancing::RackMiddleware3053 #call3054 handles a request3055 #unstick_or_continue_sticking3056 does not stick if no namespace and identifier could be found3057 sticks to the primary if a warden user is found3058 sticks to the primary if a sticking namespace and identifier is found3059 sticks to the primary if multiple sticking namespaces and identifiers were found3060 #stick_if_necessary3061 does not stick to the primary if not necessary3062 sticks to the primary if a warden user is found3063 sticks to the primary if a a single sticking object is found3064 sticks to the primary if multiple sticking namespaces and identifiers were found3065 #clear3066 clears the currently used host and session3067 #sticking_namespaces3068 using a Warden request3069 returns the warden user if present3070 returns an empty Array if no user was present3071 using a request with a manually set sticking object3072 returns the sticking object3073 using a regular request3074 returns an empty Array3075Gitlab::Database::LoadBalancing::Resolver3076 #resolve3077 when nameserver is an IP3078 returns an IPAddr object3079 when nameserver is not an IP3080 looks the nameserver up in the hosts file3081 when nameserver is not in the hosts file3082 looks the nameserver up in DNS3083 when nameserver is not in DNS3084 raises an exception3085 when DNS does not respond3086 raises an exception3087Gitlab::Database::LoadBalancing::ServiceDiscovery::Sampler3088 # order random3089 #sample3090 samples max_replica_pools addresses3091 samples random ports across all hosts3092 returns the same answer for the same input when called multiple times3093 gives a consistent answer regardless of input ordering3094 samples fairly across all hosts3095 when input is an empty array3096 returns an empty array3097 when there are less replicas than max_replica_pools3098 returns the same addresses3099 when max_replica_pools is nil3100 returns the same addresses3101Gitlab::Database::LoadBalancing::ServiceDiscovery3102 #initialize3103 :record_type3104 with a supported type3105 is expected to eq 333106 with an unsupported type3107 raises an argument error3108 #start3109 starts service discovery in a new thread with proper assignments3110 #perform_service_discovery3111 without any failures3112 runs once3113 with StandardError3114 retries service discovery when under the retry limit3115 does not retry service discovery after exceeding the limit3116 reports exceptions to Sentry3117 #refresh_if_necessary3118 when a refresh is necessary3119 refreshes the load balancer hosts3120 when a refresh is not necessary3121 does not refresh the load balancer hosts3122 #replace_hosts3123 replaces the hosts of the load balancer3124 disconnects the old connections3125 #addresses_from_dns3126 with an A record3127 returns a TTL and ordered list of IP addresses3128 with an SRV record3129 returns a TTL and ordered list of hosts3130 when max_replica_pools is set3131 when the number of addresses exceeds max_replica_pools3132 limits to max_replica_pools3133 when the number of addresses is less than max_replica_pools3134 returns all addresses3135 when the resolver returns an empty response3136 raises EmptyDnsResponse3137 #new_wait_time_for3138 returns the DNS TTL if greater than the default interval3139 returns the default interval if greater than the DNS TTL3140 returns the default interval if no resources are given3141 #addresses_from_load_balancer3142 returns the ordered host names of the load balancer3143 #resolver3144 without predefined resolver3145 fetches a new resolver and assigns it to the instance variable3146 with predefined resolver3147 when nameserver's TTL is in the future3148 returns the existing resolver3149 when nameserver's TTL is in the past3150 fetches new resolver3151 #log_refresh_thread_interruption3152 without refresh thread timestamp3153 does not log any interruption3154 with refresh thread timestamp3155 does not log if last run time plus delta is in future3156 with way past last run timestamp3157 does not log if the interruption is already logged3158 logs the error if the interruption was not logged before3159Gitlab::Database::LoadBalancing::Session3160 .current3161 returns the current session3162 .clear_session3163 clears the current session3164 .without_sticky_writes3165 ignores sticky write events sent by a connection proxy3166 still is aware of write that happened3167 #use_primary?3168 returns true when the primary should be used3169 returns false when a secondary should be used3170 returns true when a write was performed3171 #use_primary3172 uses primary during block3173 continues using primary when write was performed3174 when primary was used before3175 restores state after use3176 when primary was not used3177 restores state after use3178 #performed_write?3179 returns true if a write was performed3180 #ignore_writes3181 ignores write events3182 does not prevent using primary if an exception is raised3183 #use_replicas_for_read_queries3184 sets the flag inside the block3185 restores state after use3186 when primary was used before3187 sets the flag inside the block3188 when a write query is performed before3189 sets the flag inside the block3190 #fallback_to_replicas_for_ambiguous_queries3191 sets the flag inside the block3192 restores state after use3193 when primary was used before3194 uses primary during block3195 when a write was performed before3196 uses primary during block3197 when primary was used inside the block3198 uses primary aterward3199 restores state after use3200 when a write was performed inside the block3201 uses primary aterward3202 restores state after use3203Gitlab::Database::LoadBalancing::Setup3204 #setup3205 sets up the load balancer3206 #configure_connection3207 configures pool, prepared statements and reconnects to the database3208 #setup_connection_proxy3209 sets up the load balancer3210 #setup_service_discovery3211 when service discovery is disabled3212 does nothing3213 when service discovery is enabled3214 immediately performs service discovery3215 starts service discovery if needed3216 uses correct base models3217 results match expectations3218 does return load_balancer assigned to a given connection3219Gitlab::Database::LoadBalancing::SidekiqClientMiddleware3220 #call3221 when worker cannot be constantized3222 does not pass database locations3223 sets job data consistency3224 when worker class does not include ApplicationWorker3225 does not pass database locations3226 sets job data consistency3227 when job contains wrapped worker3228 when wrapped worker does not include WorkerAttributes3229 does not pass database locations3230 sets job data consistency3231 when wrapped worker includes WorkerAttributes3232 when write was not performed3233 sets job data consistency3234 when replica hosts are available3235 passes database_replica_location3236 when no replica hosts are available3237 passes primary_write_location3238 when write was performed3239 passes primary write location3240 sets job data consistency3241 database wal location was already provided3242 when write was performed3243 does not set database locations again3244 when write was not performed3245 does not set database locations again3246 when worker data consistency is :always3247 does not pass database locations3248 sets job data consistency3249 when worker data consistency is :delayed3250 when write was not performed3251 sets job data consistency3252 when replica hosts are available3253 passes database_replica_location3254 when no replica hosts are available3255 passes primary_write_location3256 when write was performed3257 passes primary write location3258 sets job data consistency3259 when worker data consistency is :sticky3260 when write was not performed3261 sets job data consistency3262 when replica hosts are available3263 passes database_replica_location3264 when no replica hosts are available3265 passes primary_write_location3266 when write was performed3267 passes primary write location3268 sets job data consistency3269Gitlab::Database::LoadBalancing::SidekiqServerMiddleware3270 #call3271 when worker class does not include WorkerAttributes3272 sticks to the primary3273 sets load balancing strategy to primary3274 when job contains wrapped worker class3275 uses wrapped job if available3276 when worker data consistency is :always3277 sticks to the primary3278 sets load balancing strategy to primary3279 when delay interval has not elapsed3280 does not sleep3281 when worker data consistency is :delayed3282 when database wal location is set3283 behaves like replica is up to date3284 does not stick to the primary3285 sets load balancing strategy to replica3286 when deduplication wal location is set3287 behaves like replica is up to date3288 does not stick to the primary3289 sets load balancing strategy to replica3290 when database location is not set3291 sticks to the primary3292 sets load balancing strategy to primary_no_wal3293 when WAL locations are blank3294 does not sleep3295 when WAL locations are present3296 when delay interval has not elapsed3297 when replica is up to date3298 does not sleep3299 when replica is not up to date3300 sleeps until the minimum delay is reached3301 when replica is never not up to date3302 sleeps until the maximum delay is reached3303 when replica is not up to date3304 when job is executed first3305 raises an error and retries3306 sets load balancing strategy to retry3307 when job is retried3308 and replica still lagging behind3309 sticks to the primary3310 sets load balancing strategy to primary3311 and replica is now up-to-date3312 does not stick to the primary3313 sets load balancing strategy to replica_retried3314 when worker data consistency is :sticky3315 when database wal location is set3316 behaves like replica is up to date3317 does not stick to the primary3318 sets load balancing strategy to replica3319 when deduplication wal location is set3320 behaves like replica is up to date3321 does not stick to the primary3322 sets load balancing strategy to replica3323 when database location is not set3324 sticks to the primary3325 sets load balancing strategy to primary_no_wal3326 when WAL locations are blank3327 does not sleep3328 when WAL locations are present3329 when delay interval has not elapsed3330 when replica is up to date3331 does not sleep3332 when replica is not up to date3333 sleeps until the minimum delay is reached3334 when replica is never not up to date3335 sleeps until the maximum delay is reached3336 when replica is not up to date3337 sticks to the primary3338 sets load balancing strategy to primary3339 #databases_in_sync?3340 treats load balancers without WAL entries as in sync3341 returns true when all load balancers are in sync3342 returns false when the load balancers are not in sync3343 when locations have string keys3344 returns false when the load balancers are not in sync3345Gitlab::Database::LoadBalancing::SrvResolver3346 #address_for3347 when additional section contains an A record3348 returns an IP4 address3349 when additional section contains an AAAA record3350Net::DNS unsupported record type: uninitialized constant Net::DNS::RR::OPT3351Did you mean? Net::DNS::OPT3352 returns an IP6 address3353 when additional section does not contain A nor AAAA records3354 when host resolves to an A record3355 returns an IP4 address3356 when host does resolves to an AAAA record3357Net::DNS unsupported record type: uninitialized constant Net::DNS::RR::OPT3358Did you mean? Net::DNS::OPT3359 returns an IP6 address3360Gitlab::Database::LoadBalancing::Sticking3361 with multi-store feature flags turned on3362 behaves like tracking status in redis3363 #stick_or_unstick_request3364 sticks or unsticks a single object and updates the Rack environment3365 sticks or unsticks multiple objects and updates the Rack environment3366 #stick_if_necessary3367 does not stick if no write was performed3368 sticks to the primary if a write was performed3369 #all_caught_up?3370 when no write location could be found3371 returns true3372 when all secondaries have caught up3373 returns true, and unsticks3374 notifies with the proper event payload3375 when the secondaries have not yet caught up3376 returns false3377 notifies with the proper event payload3378 #unstick_or_continue_sticking3379 simply returns if no write location could be found3380 unsticks if all secondaries have caught up3381 continues using the primary if the secondaries have not yet caught up3382 #stick3383 behaves like sticking3384 sticks an entity to the primary3385 does not update the write location when no replicas are used3386 #bulk_stick3387 behaves like sticking3388 sticks an entity to the primary3389 does not update the write location when no replicas are used3390 #mark_primary_write_location3391 updates the write location with the load balancer3392 does nothing when no replicas are used3393 #unstick3394 removes the sticking data from Redis3395 #last_write_location_for3396 returns the last WAL write location for a user3397 #select_caught_up_replicas3398 with no write location3399 returns false and does not try to find caught up hosts3400 with write location3401 returns true, selects hosts, and unsticks if any secondary has caught up3402 when both multi-store feature flags are off3403 behaves like tracking status in redis3404 #stick_or_unstick_request3405 sticks or unsticks a single object and updates the Rack environment3406 sticks or unsticks multiple objects and updates the Rack environment3407 #stick_if_necessary3408 does not stick if no write was performed3409 sticks to the primary if a write was performed3410 #all_caught_up?3411 when no write location could be found3412 returns true3413 when all secondaries have caught up3414 returns true, and unsticks3415 notifies with the proper event payload3416 when the secondaries have not yet caught up3417 returns false3418 notifies with the proper event payload3419 #unstick_or_continue_sticking3420 simply returns if no write location could be found3421 unsticks if all secondaries have caught up3422 continues using the primary if the secondaries have not yet caught up3423 #stick3424 behaves like sticking3425 sticks an entity to the primary3426 does not update the write location when no replicas are used3427 #bulk_stick3428 behaves like sticking3429 sticks an entity to the primary3430 does not update the write location when no replicas are used3431 #mark_primary_write_location3432 updates the write location with the load balancer3433 does nothing when no replicas are used3434 #unstick3435 removes the sticking data from Redis3436 #last_write_location_for3437 returns the last WAL write location for a user3438 #select_caught_up_replicas3439 with no write location3440 returns false and does not try to find caught up hosts3441 with write location3442 returns true, selects hosts, and unsticks if any secondary has caught up3443 #redis_key_for3444 returns a String3445Load balancer behavior with errors inside a transaction3446 in a transaction3447 raises an exception when a retry would occur3448 without a transaction3449 retries3450Gitlab::Database::LoadBalancing3451 .base_models3452 returns the models to apply load balancing to3453 returns the models as a frozen array3454 .each_load_balancer3455 yields every load balancer to the supplied block3456 returns an Enumerator when no block is given3457 .primary_only?3458 returns true if all load balancers have no replicas3459 returns false if at least one has replicas3460 .release_hosts3461 releases the host of every load balancer3462 .db_role_for_connection3463 when the NullPool is used for connection3464 returns unknown3465 when the load balancing is configured3466 when a proxy connection is used3467 returns :unknown3468 when an invalid connection is used3469 returns :unknown3470 when a null connection is used3471 returns :unknown3472 when a read connection is used3473 returns :replica3474 when a read_write connection is used3475 returns :primary3476 LoadBalancing integration tests3477-- create_table(:_test_load_balancing_test, {:force=>true})3478 -> 0.0041s3479 queries: -> { model.first }, include_transaction: false, expected_results: [:replica]3480 redirects queries to the right roles3481 queries: -> { model.find_by(id: 123) }, include_transaction: false, expected_results: [:replica]3482 redirects queries to the right roles3483 queries: -> { model.where(name: 'hello').to_a }, include_transaction: false, expected_results: [:replica]3484 redirects queries to the right roles3485 queries: -> { model.create!(name: 'test1') }, include_transaction: false, expected_results: [:primary]3486 redirects queries to the right roles3487 queries: -> {3488 instance = model.create!(name: 'test1')3489 instance.update!(name: 'test2')3490 }, include_transaction: false, expected_results: [:primary, :primary]3491 redirects queries to the right roles3492 queries: -> { model.update_all(name: 'test2') }, include_transaction: false, expected_results: [:primary]3493 redirects queries to the right roles3494 queries: -> {3495 instance = model.create!(name: 'test1')3496 instance.destroy!3497 }, include_transaction: false, expected_results: [:primary, :primary]3498 redirects queries to the right roles3499 queries: -> { model.delete_all }, include_transaction: false, expected_results: [:primary]3500 redirects queries to the right roles3501 queries: -> { model.connection.exec_query('SELECT 1').to_a }, include_transaction: false, expected_results: [:primary]3502 redirects queries to the right roles3503 queries: -> {3504 model.first3505 model.create!(name: 'test1')3506 model.first3507 model.find_by(name: 'test1')3508 }, include_transaction: false, expected_results: [:replica, :primary, :primary, :primary]3509 redirects queries to the right roles3510 queries: -> {3511 model.transaction do3512 model.find_by(name: 'test1')3513 model.create!(name: 'test1')3514 instance = model.find_by(name: 'test1')3515 instance.update!(name: 'test2')3516 end3517 model.find_by(name: 'test1')3518 }, include_transaction: true, expected_results: [:primary, :primary, :primary, :primary, :primary, :primary, :primary]3519 redirects queries to the right roles3520 queries: -> {3521 model.transaction do3522 model.transaction do3523 model.create!(name: 'test1')3524 end3525 model.update_all(name: 'test2')3526 end3527 model.find_by(name: 'test1')3528 }, include_transaction: true, expected_results: [:primary, :primary, :primary, :primary, :primary]3529 redirects queries to the right roles3530 queries: -> {3531 model.transaction do3532 model.first3533 model.where(name: 'test1').to_a3534 end3535 }, include_transaction: true, expected_results: [:primary, :primary, :primary, :primary]3536 redirects queries to the right roles3537 queries: -> {3538 ::Gitlab::Database::LoadBalancing::Session.current.use_primary do3539 model.first3540 model.where(name: 'test1').to_a3541 end3542 model.first3543 }, include_transaction: false, expected_results: [:primary, :primary, :replica]3544 redirects queries to the right roles3545 queries: -> {3546 model.first3547 ::Gitlab::Database::LoadBalancing::Session.current.use_primary!3548 model.where(name: 'test1').to_a3549 }, include_transaction: false, expected_results: [:replica, :primary]3550 redirects queries to the right roles3551 queries: -> {3552 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3553 model.where(name: 'test1').to_a3554 end3555 }, include_transaction: false, expected_results: [:replica]3556 redirects queries to the right roles3557 queries: -> {3558 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3559 model.create!(name: 'test1')3560 end3561 }, include_transaction: false, expected_results: [:primary]3562 redirects queries to the right roles3563 queries: -> {3564 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3565 model.connection.exec_query("SELECT 1")3566 end3567 }, include_transaction: false, expected_results: [:primary]3568 redirects queries to the right roles3569 queries: -> {3570 ::Gitlab::Database::LoadBalancing::Session.current.use_primary!3571 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3572 model.where(name: 'test1').to_a3573 end3574 }, include_transaction: false, expected_results: [:replica]3575 redirects queries to the right roles3576 queries: -> {3577 ::Gitlab::Database::LoadBalancing::Session.current.use_primary!3578 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3579 model.create!(name: 'test1')3580 end3581 }, include_transaction: false, expected_results: [:primary]3582 redirects queries to the right roles3583 queries: -> {3584 ::Gitlab::Database::LoadBalancing::Session.current.use_primary!3585 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3586 model.connection.exec_query('SELECT 1')3587 end3588 }, include_transaction: false, expected_results: [:primary]3589 redirects queries to the right roles3590 queries: -> {3591 ::Gitlab::Database::LoadBalancing::Session.current.use_primary do3592 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3593 model.where(name: 'test1').to_a3594 end3595 end3596 }, include_transaction: false, expected_results: [:replica]3597 redirects queries to the right roles3598 queries: -> {3599 ::Gitlab::Database::LoadBalancing::Session.current.write!3600 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3601 model.where(name: 'test1').to_a3602 end3603 }, include_transaction: false, expected_results: [:replica]3604 redirects queries to the right roles3605 queries: -> {3606 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3607 model.first3608 model.where(name: 'test1').to_a3609 end3610 }, include_transaction: false, expected_results: [:replica, :replica]3611 redirects queries to the right roles3612 queries: -> {3613 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3614 model.transaction do3615 model.first3616 model.where(name: 'test1').to_a3617 end3618 end3619 }, include_transaction: false, expected_results: [:replica, :replica]3620 redirects queries to the right roles3621 queries: -> {3622 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3623 model.connection.exec_query("SELECT 1")3624 end3625 }, include_transaction: false, expected_results: [:replica]3626 redirects queries to the right roles3627 queries: -> {3628 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3629 model.transaction do3630 model.connection.exec_query("SET LOCAL statement_timeout = 5000")3631 model.count3632 end3633 end3634 }, include_transaction: true, expected_results: [:replica, :replica, :replica, :replica]3635 redirects queries to the right roles3636 queries: -> {3637 model.create!(name: 'Test1')3638 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3639 model.connection.exec_query("SELECT 1")3640 end3641 }, include_transaction: false, expected_results: [:primary, :primary]3642 redirects queries to the right roles3643 queries: -> {3644 ::Gitlab::Database::LoadBalancing::Session.current.use_primary!3645 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3646 model.connection.exec_query("SELECT 1")3647 end3648 }, include_transaction: false, expected_results: [:primary]3649 redirects queries to the right roles3650 queries: -> {3651 ::Gitlab::Database::LoadBalancing::Session.current.use_primary do3652 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3653 model.connection.exec_query("SELECT 1")3654 end3655 end3656 }, include_transaction: false, expected_results: [:primary]3657 redirects queries to the right roles3658 queries: -> {3659 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3660 ::Gitlab::Database::LoadBalancing::Session.current.use_primary do3661 model.connection.exec_query("SELECT 1")3662 end3663 end3664 }, include_transaction: false, expected_results: [:primary]3665 redirects queries to the right roles3666 queries: -> {3667 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3668 model.connection.exec_query("SELECT 1")3669 model.delete_all3670 model.connection.exec_query("SELECT 1")3671 end3672 }, include_transaction: false, expected_results: [:replica, :primary, :primary]3673 redirects queries to the right roles3674 queries: -> {3675 ::Gitlab::Database::LoadBalancing::Session.current.use_replicas_for_read_queries do3676 ::Gitlab::Database::LoadBalancing::Session.current.fallback_to_replicas_for_ambiguous_queries do3677 model.connection.exec_query('SELECT 1')3678 model.where(name: 'test1').to_a3679 end3680 end3681 }, include_transaction: false, expected_results: [:replica, :replica]3682 redirects queries to the right roles3683 custom connection handling3684 queries: -> {3685 ::Gitlab::Database::LoadBalancing::Session.current.use_primary!3686 model.connection.clear_cache!3687 model.connection.schema_cache.add('users')3688 model.connection.pool.release_connection3689 }, expected_role: :replica3690 redirects queries to the right roles3691 queries: -> {3692 connection = model.connection3693 connection.select_one('SELECT 1')3694 connection.pool.release_connection3695 }, expected_role: :replica3696 redirects queries to the right roles3697 queries: -> {3698 connection = model.retrieve_connection3699 connection.select_one('SELECT 1')3700 connection.pool.release_connection3701 }, expected_role: :primary3702 redirects queries to the right roles3703 a write inside a transaction inside fallback_to_replicas_for_ambiguous_queries block3704 raises an exception3705-- drop_table(:_test_load_balancing_test, {:force=>true})3706 -> 0.0581s3707Gitlab::Database::LockWritesManager3708 #table_locked_for_writes?3709 returns false for a table that is not locked for writes3710 returns true for a table that is locked for writes3711 for detached partition tables in another schema3712 returns true for a table that is locked for writes3713 #lock_writes3714 prevents any writes on the table3715 prevents truncating the table3716 adds 3 triggers to the ci schema tables on the main database3717 logs the write locking3718 retries again if it receives a statement_timeout a few number of times3719 raises the exception if it happened many times3720 skips the operation if the table is already locked for writes3721 when running in dry_run mode3722 prints the sql statement to the logger3723 does not lock the tables for writes3724 returns result hash with action needs_lock3725 #unlock_writes3726 allows writing on the table again3727 skips unlocking the table if the table was already unlocked for writes3728 removes the write protection triggers from the gitlab_main tables on the ci database3729 logs the write unlocking3730 when running in dry_run mode3731 prints the sql statement to the logger3732 does not unlock the tables for writes3733 returns result hash with dry_run true3734Gitlab::Database::LooseForeignKeys3735 verify all definitions3736 all definitions have assigned a known gitlab_schema and on_delete3737 ensure keys are sorted3738 does not have any keys that are out of order3739 ensure no duplicates are found3740 does not have duplicate tables defined3741 does not have duplicate column definitions3742 ensuring database integrity3743 all `to_table` tables are present3744 all `from_table` tables are present3745 all tables have correct triggers installed3746 all YAML tables do have `track_record_deletions` installed3747 no extra tables have `track_record_deletions` installed3748 .build_definition3749 when child table schema is not defined3750 raises Gitlab::Database::GitlabSchema::UnknownSchemaError error3751Gitlab::Database::MigrationHelpers::AnnounceDatabase3752 #announce3753 prefixes message with database name3754 #say3755 prefixes message with database name3756 prefixes subitem message with database name3757 #write3758 does not prefix empty write3759Gitlab::Database::MigrationHelpers::AutomaticLockWritesOnTables3760 # order random3761 when executing create_table migrations3762 when single database3763 does not lock any newly created tables (PENDING: Skipping because database ci exists)3764 when multiple databases3765 for creating a gitlab_main table3766 behaves like does not lock writes on table3767main: == : migrating ===============================================================3768main: -- create_table(:_test_gitlab_main_table)3769main: -> 0.2185s3770main: == : migrated (0.2558s) ======================================================3771 allows deleting records from the table3772 behaves like locks writes on table3773ci: == : migrating ===============================================================3774ci: -- create_table(:_test_gitlab_main_table)3775ci: -> 0.0124s3776I, [2023-08-13T07:19:30.323040 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_table': Lock Writes3777ci: == : migrated (0.2219s) ======================================================3778 errors on deleting3779 when table listed as a deleted table3780 behaves like does not lock writes on table3781ci: == : migrating ===============================================================3782ci: -- create_table(:_test_gitlab_main_table)3783ci: -> 0.0046s3784ci: == : migrated (0.0347s) ======================================================3785 allows deleting records from the table3786 when the migration skips automatic locking of tables3787 behaves like does not lock writes on table3788ci: == : migrating ===============================================================3789ci: -- create_table(:_test_gitlab_main_table)3790ci: -> 0.0046s3791ci: == : migrated (0.0059s) ======================================================3792 allows deleting records from the table3793 when migration does not run within a transaction3794 behaves like locks writes on table using WithLockRetries3795ci: == : migrating ===============================================================3796ci: -- create_table(:_test_gitlab_main_table)3797ci: -> 0.0034s3798I, [2023-08-13T07:19:35.317388 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_table': Lock Writes3799I, [2023-08-13T07:19:35.323123 #45735] INFO -- : {:method=>"with_lock_retries", :class=>"gitlab:db:lock_writes", :message=>"Lock timeout is set", :current_iteration=>1, :lock_timeout_in_ms=>100}3800I, [2023-08-13T07:19:35.324957 #45735] INFO -- : {:method=>"with_lock_retries", :class=>"gitlab:db:lock_writes", :message=>"Migration finished", :current_iteration=>1, :lock_timeout_in_ms=>100}3801ci: == : migrated (0.0418s) ======================================================3802 locks the writes on the table using WithLockRetries3803 when the SKIP_AUTOMATIC_LOCK_ON_WRITES feature flag is set3804 behaves like does not lock writes on table3805ci: == : migrating ===============================================================3806ci: -- create_table(:_test_gitlab_main_table)3807ci: -> 0.0048s3808ci: == : migrated (0.0061s) ======================================================3809 allows deleting records from the table3810 when the automatic_lock_writes_on_table feature flag is disabled3811 behaves like does not lock writes on table3812ci: == : migrating ===============================================================3813ci: -- create_table(:_test_gitlab_main_table)3814ci: -> 0.0054s3815ci: == : migrated (0.0240s) ======================================================3816 allows deleting records from the table3817 for creating a gitlab_main_clusterwide table3818 behaves like does not lock writes on table3819main: == : migrating ===============================================================3820main: -- create_table(:_test_gitlab_main_clusterwide_table)3821main: -> 0.0038s3822main: == : migrated (0.0140s) ======================================================3823 allows deleting records from the table3824 behaves like locks writes on table3825ci: == : migrating ===============================================================3826ci: -- create_table(:_test_gitlab_main_clusterwide_table)3827ci: -> 0.0041s3828I, [2023-08-13T07:19:41.864512 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_clusterwide_table': Lock Writes3829ci: == : migrated (0.0330s) ======================================================3830 errors on deleting3831 for creating a gitlab_main_cell table3832 behaves like does not lock writes on table3833main: == : migrating ===============================================================3834main: -- create_table(:_test_gitlab_main_cell_table)3835main: -> 0.0038s3836main: == : migrated (0.0140s) ======================================================3837 allows deleting records from the table3838 behaves like locks writes on table3839ci: == : migrating ===============================================================3840ci: -- create_table(:_test_gitlab_main_cell_table)3841ci: -> 0.0048s3842I, [2023-08-13T07:19:45.090749 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_cell_table': Lock Writes3843ci: == : migrated (0.0434s) ======================================================3844 errors on deleting3845 for creating a gitlab_pm table3846 behaves like does not lock writes on table3847main: == : migrating ===============================================================3848main: -- create_table(:_test_gitlab_pm_table)3849main: -> 0.0040s3850main: == : migrated (0.0147s) ======================================================3851 allows deleting records from the table3852 behaves like locks writes on table3853ci: == : migrating ===============================================================3854ci: -- create_table(:_test_gitlab_pm_table)3855ci: -> 0.0047s3856I, [2023-08-13T07:19:48.373596 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_pm_table': Lock Writes3857ci: == : migrated (0.0400s) ======================================================3858 errors on deleting3859 for creating a gitlab_ci table3860 behaves like does not lock writes on table3861ci: == : migrating ===============================================================3862ci: -- create_table(:_test_gitlab_ci_table)3863ci: -> 0.0038s3864ci: == : migrated (0.0292s) ======================================================3865 allows deleting records from the table3866 behaves like locks writes on table3867main: == : migrating ===============================================================3868main: -- create_table(:_test_gitlab_ci_table)3869main: -> 0.0040s3870I, [2023-08-13T07:19:51.602270 #45735] INFO -- : Database: 'main', Table: '_test_gitlab_ci_table': Lock Writes3871main: == : migrated (0.0198s) ======================================================3872 errors on deleting3873 when table listed as a deleted table3874 behaves like does not lock writes on table3875main: == : migrating ===============================================================3876main: -- create_table(:_test_gitlab_ci_table)3877main: -> 0.0039s3878main: == : migrated (0.0141s) ======================================================3879 allows deleting records from the table3880 when the migration skips automatic locking of tables3881 behaves like does not lock writes on table3882main: == : migrating ===============================================================3883main: -- create_table(:_test_gitlab_ci_table)3884main: -> 0.0043s3885main: == : migrated (0.0050s) ======================================================3886 allows deleting records from the table3887 when the SKIP_AUTOMATIC_LOCK_ON_WRITES feature flag is set3888 behaves like does not lock writes on table3889main: == : migrating ===============================================================3890main: -- create_table(:_test_gitlab_ci_table)3891main: -> 0.0046s3892main: == : migrated (0.0054s) ======================================================3893 allows deleting records from the table3894 when the automatic_lock_writes_on_table feature flag is disabled3895 behaves like does not lock writes on table3896main: == : migrating ===============================================================3897main: -- create_table(:_test_gitlab_ci_table)3898main: -> 0.0044s3899main: == : migrated (0.0055s) ======================================================3900 allows deleting records from the table3901 for creating gitlab_shared table3902 behaves like does not lock writes on table3903main: == : migrating ===============================================================3904main: -- create_table(:_test_table)3905main: -> 0.0035s3906main: == : migrated (0.0128s) ======================================================3907 allows deleting records from the table3908 behaves like does not lock writes on table3909ci: == : migrating ===============================================================3910ci: -- create_table(:_test_table)3911ci: -> 0.0035s3912ci: == : migrated (0.0280s) ======================================================3913 allows deleting records from the table3914 for creating a gitlab_geo table3915 behaves like does not lock writes on table3916 allows deleting records from the table (PENDING: No reason given)3917 for creating an unknown gitlab_schema table3918main: == : migrating ===============================================================3919main: -- create_table(:foobar)3920 raises an error about undefined gitlab_schema3921 when reversing drop_table migrations3922 when single database3923 does not lock any newly created tables (PENDING: Skipping because database ci exists)3924 when multiple databases3925 for re-creating a gitlab_main table3926 behaves like does not lock writes on table3927main: == : migrating ===============================================================3928main: -- drop_table(:_test_gitlab_main_table)3929main: -> 0.0017s3930main: == : migrated (0.0106s) ======================================================3931main: == : reverting ===============================================================3932main: -- create_table(:_test_gitlab_main_table)3933main: -> 0.0035s3934main: == : reverted (0.0145s) ======================================================3935 allows deleting records from the table3936 behaves like locks writes on table3937ci: == : migrating ===============================================================3938ci: -- drop_table(:_test_gitlab_main_table)3939ci: -> 0.0023s3940ci: == : migrated (0.0255s) ======================================================3941ci: == : reverting ===============================================================3942ci: -- create_table(:_test_gitlab_main_table)3943ci: -> 0.0035s3944I, [2023-08-13T07:20:09.129168 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_table': Lock Writes3945ci: == : reverted (0.0314s) ======================================================3946 errors on deleting3947 for re-creating a gitlab_ci table3948 behaves like does not lock writes on table3949ci: == : migrating ===============================================================3950ci: -- drop_table(:_test_gitlab_ci_table)3951ci: -> 0.0018s3952ci: == : migrated (0.0253s) ======================================================3953ci: == : reverting ===============================================================3954ci: -- create_table(:_test_gitlab_ci_table)3955ci: -> 0.0046s3956ci: == : reverted (0.0285s) ======================================================3957 allows deleting records from the table3958 behaves like locks writes on table3959main: == : migrating ===============================================================3960main: -- drop_table(:_test_gitlab_ci_table)3961main: -> 0.0027s3962main: == : migrated (0.0116s) ======================================================3963main: == : reverting ===============================================================3964main: -- create_table(:_test_gitlab_ci_table)3965main: -> 0.0030s3966I, [2023-08-13T07:20:12.337626 #45735] INFO -- : Database: 'main', Table: '_test_gitlab_ci_table': Lock Writes3967main: == : reverted (0.0153s) ======================================================3968 errors on deleting3969 for re-creating a gitlab_shared table3970 behaves like does not lock writes on table3971main: == : migrating ===============================================================3972main: -- drop_table(:_test_table)3973main: -> 0.0017s3974main: == : migrated (0.0100s) ======================================================3975main: == : reverting ===============================================================3976main: -- create_table(:_test_table)3977main: -> 0.0032s3978main: == : reverted (0.0099s) ======================================================3979 allows deleting records from the table3980 behaves like does not lock writes on table3981ci: == : migrating ===============================================================3982ci: -- drop_table(:_test_table)3983ci: -> 0.0018s3984ci: == : migrated (0.0260s) ======================================================3985ci: == : reverting ===============================================================3986ci: -- create_table(:_test_table)3987ci: -> 0.0030s3988ci: == : reverted (0.0264s) ======================================================3989 allows deleting records from the table3990 when renaming a table3991 when a gitlab_main table3992 behaves like does not lock writes on table3993main: == : migrating ===============================================================3994main: -- create_table(:_test_gitlab_main_table)3995main: -> 0.0322s3996main: == : migrated (0.0415s) ======================================================3997main: == : migrating ===============================================================3998main: -- rename_table(:_test_gitlab_main_table, :_test_gitlab_main_new_table)3999main: -> 0.1980s4000main: == : migrated (0.2064s) ======================================================4001 allows deleting records from the table4002 behaves like locks writes on table4003ci: == : migrating ===============================================================4004ci: -- create_table(:_test_gitlab_main_table)4005ci: -> 0.0049s4006I, [2023-08-13T07:20:18.930033 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_table': Lock Writes4007I, [2023-08-13T07:20:18.931805 #45735] INFO -- : {:method=>"with_lock_retries", :class=>"gitlab:db:lock_writes", :message=>"Lock timeout is set", :current_iteration=>1, :lock_timeout_in_ms=>100}4008I, [2023-08-13T07:20:18.933057 #45735] INFO -- : {:method=>"with_lock_retries", :class=>"gitlab:db:lock_writes", :message=>"Migration finished", :current_iteration=>1, :lock_timeout_in_ms=>100}4009ci: == : migrated (0.0375s) ======================================================4010ci: == : migrating ===============================================================4011ci: -- rename_table(:_test_gitlab_main_table, :_test_gitlab_main_new_table)4012ci: -> 0.1048s4013I, [2023-08-13T07:20:19.069168 #45735] INFO -- : Database: 'ci', Table: '_test_gitlab_main_new_table': Lock Writes4014ci: == : migrated (0.1346s) ======================================================4015 errors on deleting4016 when a gitlab_ci table4017 behaves like does not lock writes on table4018ci: == : migrating ===============================================================4019ci: -- create_table(:_test_gitlab_ci_table)4020ci: -> 0.0040s4021ci: == : migrated (0.0288s) ======================================================4022ci: == : migrating ===============================================================4023ci: -- rename_table(:_test_gitlab_ci_table, :_test_gitlab_ci_new_table)4024ci: -> 0.0109s4025ci: == : migrated (0.0349s) ======================================================4026 allows deleting records from the table4027 behaves like locks writes on table4028main: == : migrating ===============================================================4029main: -- create_table(:_test_gitlab_ci_table)4030main: -> 0.0035s4031I, [2023-08-13T07:20:22.229304 #45735] INFO -- : Database: 'main', Table: '_test_gitlab_ci_table': Lock Writes4032I, [2023-08-13T07:20:22.230909 #45735] INFO -- : {:method=>"with_lock_retries", :class=>"gitlab:db:lock_writes", :message=>"Lock timeout is set", :current_iteration=>1, :lock_timeout_in_ms=>100}4033I, [2023-08-13T07:20:22.232076 #45735] INFO -- : {:method=>"with_lock_retries", :class=>"gitlab:db:lock_writes", :message=>"Migration finished", :current_iteration=>1, :lock_timeout_in_ms=>100}4034main: == : migrated (0.0189s) ======================================================4035main: == : migrating ===============================================================4036main: -- rename_table(:_test_gitlab_ci_table, :_test_gitlab_ci_new_table)4037main: -> 0.0101s4038I, [2023-08-13T07:20:22.255420 #45735] INFO -- : Database: 'main', Table: '_test_gitlab_ci_new_table': Lock Writes4039main: == : migrated (0.0218s) ======================================================4040 errors on deleting4041Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings4042 #add_cascading_namespace_setting4043-- column_exists?(:namespace_settings, :some_setting)4044 -> 0.0056s4045-- column_exists?(:namespace_settings, :lock_some_setting)4046 -> 0.0043s4047-- column_exists?(:application_settings, :some_setting)4048 -> 0.2761s4049-- column_exists?(:application_settings, :lock_some_setting)4050 -> 0.2769s4051 creates the required columns4052 when columns already exist4053-- add_column(:namespace_settings, :cascading_setting, :integer)4054 -> 0.0676s4055-- add_column(:application_settings, :lock_cascading_setting, :boolean)4056 -> 0.0230s4057-- column_exists?(:namespace_settings, :cascading_setting)4058 -> 0.0068s4059-- column_exists?(:namespace_settings, :lock_cascading_setting)4060 -> 0.0063s4061-- column_exists?(:application_settings, :cascading_setting)4062 -> 0.2756s4063-- column_exists?(:application_settings, :lock_cascading_setting)4064 -> 0.2763s4065 raises an error when some columns already exist4066 #remove_cascading_namespace_setting4067 removes the columns4068Gitlab::Database::MigrationHelpers::ConvertToBigint4069 # order random4070 #columns_swapped?4071 returns true if columns are already swapped4072 returns false if columns are not yet swapped4073 #com_or_dev_or_test_but_not_jh?4074 dot_com: true, dev_or_test: true, jh: true, expectation: true4075 returns true for GitLab.com (but not JH), dev, or test4076 dot_com: true, dev_or_test: false, jh: true, expectation: false4077 returns true for GitLab.com (but not JH), dev, or test4078 dot_com: false, dev_or_test: true, jh: true, expectation: true4079 returns true for GitLab.com (but not JH), dev, or test4080 dot_com: false, dev_or_test: false, jh: true, expectation: false4081 returns true for GitLab.com (but not JH), dev, or test4082 dot_com: true, dev_or_test: true, jh: false, expectation: true4083 returns true for GitLab.com (but not JH), dev, or test4084 dot_com: true, dev_or_test: false, jh: false, expectation: true4085 returns true for GitLab.com (but not JH), dev, or test4086 dot_com: false, dev_or_test: true, jh: false, expectation: true4087 returns true for GitLab.com (but not JH), dev, or test4088 dot_com: false, dev_or_test: false, jh: false, expectation: false4089 returns true for GitLab.com (but not JH), dev, or test4090 #temp_column_removed?4091 return true when column is not present4092 return false when column present4093Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers4094-- create_table(:_test_loose_fk_test_table)4095 -> 0.0027s4096 when the record deletion tracker trigger is not installed4097 does store record deletions4098-- current_schema()4099 -> 0.0009s4100 is expected to be falsy4101 when the record deletion tracker trigger is installed4102-- execute("CREATE TRIGGER _test_loose_fk_test_table_loose_fk_trigger AFTER DELETE ON _test_loose_fk_test_table REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();")4103 -> 0.0036s4104 stores the record deletion4105-- execute("CREATE TRIGGER _test_loose_fk_test_table_loose_fk_trigger AFTER DELETE ON _test_loose_fk_test_table REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();")4106 -> 0.0015s4107 stores multiple record deletions4108-- execute("CREATE TRIGGER _test_loose_fk_test_table_loose_fk_trigger AFTER DELETE ON _test_loose_fk_test_table REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();")4109 -> 0.0012s4110-- current_schema()4111 -> 0.0006s4112 is expected to be truthy4113-- drop_table(:_test_loose_fk_test_table)4114 -> 0.0013s4115Gitlab::Database::MigrationHelpers::RestrictGitlabSchema4116 #restrict_gitlab_migration4117 invalid schema raises exception4118 does configure allowed_gitlab_schema4119 when executing migrations4120 does create table in gitlab_main and gitlab_ci4121 for db_config_name=main4122 while restrict_gitlab_migration=no_gitlab_schema4123 does run migrate :up and :down4124 while restrict_gitlab_migration=gitlab_schema_gitlab_main4125 does run migrate :up and :down4126 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4127 does run migrate :up and :down4128 for db_config_name=ci4129 while restrict_gitlab_migration=no_gitlab_schema4130 does run migrate :up and :down4131 while restrict_gitlab_migration=gitlab_schema_gitlab_main4132 does run migrate :up and :down4133 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4134 does run migrate :up and :down4135 does add column to projects in gitlab_main and gitlab_ci4136 for db_config_name=main4137 while restrict_gitlab_migration=no_gitlab_schema4138 does run migrate :up and :down4139 while restrict_gitlab_migration=gitlab_schema_gitlab_main4140 does run migrate :up and :down4141 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4142 does run migrate :up and :down4143 for db_config_name=ci4144 while restrict_gitlab_migration=no_gitlab_schema4145 does run migrate :up and :down4146 while restrict_gitlab_migration=gitlab_schema_gitlab_main4147 does run migrate :up and :down4148 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4149 does run migrate :up and :down4150 does add column to p_ci_builds in gitlab_main and gitlab_ci4151 for db_config_name=main4152 while restrict_gitlab_migration=no_gitlab_schema4153 does run migrate :up and :down4154 while restrict_gitlab_migration=gitlab_schema_gitlab_main4155 does run migrate :up and :down4156 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4157 does run migrate :up and :down4158 for db_config_name=ci4159 while restrict_gitlab_migration=no_gitlab_schema4160 does run migrate :up and :down4161 while restrict_gitlab_migration=gitlab_schema_gitlab_main4162 does run migrate :up and :down4163 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4164 does run migrate :up and :down4165 does add index to projects in gitlab_main and gitlab_ci4166 for db_config_name=main4167 while restrict_gitlab_migration=no_gitlab_schema4168 does run migrate :up and :down4169 while restrict_gitlab_migration=gitlab_schema_gitlab_main4170 does run migrate :up and :down4171 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4172 does run migrate :up and :down4173 for db_config_name=ci4174 while restrict_gitlab_migration=no_gitlab_schema4175 does run migrate :up and :down4176 while restrict_gitlab_migration=gitlab_schema_gitlab_main4177 does run migrate :up and :down4178 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4179 does run migrate :up and :down4180 does add index to ci_builds in gitlab_main and gitlab_ci4181 for db_config_name=main4182 while restrict_gitlab_migration=no_gitlab_schema4183 does run migrate :up and :down4184 while restrict_gitlab_migration=gitlab_schema_gitlab_main4185 does run migrate :up and :down4186 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4187 does run migrate :up and :down4188 for db_config_name=ci4189 while restrict_gitlab_migration=no_gitlab_schema4190 does run migrate :up and :down4191 while restrict_gitlab_migration=gitlab_schema_gitlab_main4192 does run migrate :up and :down4193 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4194 does run migrate :up and :down4195 does create trigger in gitlab_main and gitlab_ci4196 for db_config_name=main4197 while restrict_gitlab_migration=no_gitlab_schema4198 does run migrate :up and :down4199 while restrict_gitlab_migration=gitlab_schema_gitlab_main4200 does run migrate :up and :down4201 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4202 does run migrate :up and :down4203 for db_config_name=ci4204 while restrict_gitlab_migration=no_gitlab_schema4205 does run migrate :up and :down4206 while restrict_gitlab_migration=gitlab_schema_gitlab_main4207 does run migrate :up and :down4208 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4209 does run migrate :up and :down4210 does create schema in gitlab_main and gitlab_ci4211 for db_config_name=main4212 while restrict_gitlab_migration=no_gitlab_schema4213 does run migrate :up and :down4214 while restrict_gitlab_migration=gitlab_schema_gitlab_main4215 does run migrate :up and :down4216 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4217 does run migrate :up and :down4218 for db_config_name=ci4219 while restrict_gitlab_migration=no_gitlab_schema4220 does run migrate :up and :down4221 while restrict_gitlab_migration=gitlab_schema_gitlab_main4222 does run migrate :up and :down4223 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4224 does run migrate :up and :down4225 does attach loose foreign key trigger in gitlab_main and gitlab_ci4226 for db_config_name=main4227 while restrict_gitlab_migration=no_gitlab_schema4228 does run migrate :up and :down4229 while restrict_gitlab_migration=gitlab_schema_gitlab_main4230 does run migrate :up and :down4231 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4232 does run migrate :up and :down4233 for db_config_name=ci4234 while restrict_gitlab_migration=no_gitlab_schema4235 does run migrate :up and :down4236 while restrict_gitlab_migration=gitlab_schema_gitlab_main4237 does run migrate :up and :down4238 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4239 does run migrate :up and :down4240 does insert into software_licenses4241 for db_config_name=main4242 while restrict_gitlab_migration=no_gitlab_schema4243 does run migrate :up and :down4244 while restrict_gitlab_migration=gitlab_schema_gitlab_main4245 does run migrate :up and :down4246 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4247 does run migrate :up and :down4248 for db_config_name=ci4249 while restrict_gitlab_migration=no_gitlab_schema4250 does run migrate :up and :down4251 while restrict_gitlab_migration=gitlab_schema_gitlab_main4252 does run migrate :up and :down4253 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4254 does run migrate :up and :down4255 does raise exception when accessing tables outside of gitlab_main4256 for db_config_name=main4257 while restrict_gitlab_migration=no_gitlab_schema4258 does run migrate :up and :down4259 while restrict_gitlab_migration=gitlab_schema_gitlab_main4260 does run migrate :up and :down4261 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4262 does run migrate :up and :down4263 for db_config_name=ci4264 while restrict_gitlab_migration=no_gitlab_schema4265 does run migrate :up and :down4266 while restrict_gitlab_migration=gitlab_schema_gitlab_main4267 does run migrate :up and :down4268 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4269 does run migrate :up and :down4270 does allow modifying gitlab_shared4271 for db_config_name=main4272 while restrict_gitlab_migration=no_gitlab_schema4273 does run migrate :up and :down4274 while restrict_gitlab_migration=gitlab_schema_gitlab_main4275 does run migrate :up and :down4276 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4277 does run migrate :up and :down4278 for db_config_name=ci4279 while restrict_gitlab_migration=no_gitlab_schema4280 does run migrate :up and :down4281 while restrict_gitlab_migration=gitlab_schema_gitlab_main4282 does run migrate :up and :down4283 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4284 does run migrate :up and :down4285 does update data in batches of gitlab_main, but skips gitlab_ci4286 for db_config_name=main4287 while restrict_gitlab_migration=no_gitlab_schema4288 does run migrate :up and :down4289 while restrict_gitlab_migration=gitlab_schema_gitlab_main4290 does run migrate :up and :down4291 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4292 does run migrate :up and :down4293 for db_config_name=ci4294 while restrict_gitlab_migration=no_gitlab_schema4295 does run migrate :up and :down4296 while restrict_gitlab_migration=gitlab_schema_gitlab_main4297 does run migrate :up and :down4298 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4299 does run migrate :up and :down4300 does not allow executing mixed DDL and DML migrations4301 for db_config_name=main4302 while restrict_gitlab_migration=no_gitlab_schema4303 does run migrate :up and :down4304 while restrict_gitlab_migration=gitlab_schema_gitlab_main4305 does run migrate :up and :down4306 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4307 does run migrate :up and :down4308 for db_config_name=ci4309 while restrict_gitlab_migration=no_gitlab_schema4310 does run migrate :up and :down4311 while restrict_gitlab_migration=gitlab_schema_gitlab_main4312 does run migrate :up and :down4313 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4314 does run migrate :up and :down4315 does schedule background migrations on gitlab_main4316 for db_config_name=main4317 while restrict_gitlab_migration=no_gitlab_schema4318 does run migrate :up and :down4319 while restrict_gitlab_migration=gitlab_schema_gitlab_main4320 does run migrate :up and :down4321 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4322 does run migrate :up and :down4323 for db_config_name=ci4324 while restrict_gitlab_migration=no_gitlab_schema4325 does run migrate :up and :down4326 while restrict_gitlab_migration=gitlab_schema_gitlab_main4327 does run migrate :up and :down4328 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4329 does run migrate :up and :down4330 does support prepare_async_index4331 for db_config_name=main4332 while restrict_gitlab_migration=no_gitlab_schema4333 does run migrate :up and :down4334 while restrict_gitlab_migration=gitlab_schema_gitlab_main4335 does run migrate :up and :down4336 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4337 does run migrate :up and :down4338 for db_config_name=ci4339 while restrict_gitlab_migration=no_gitlab_schema4340 does run migrate :up and :down4341 while restrict_gitlab_migration=gitlab_schema_gitlab_main4342 does run migrate :up and :down4343 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4344 does run migrate :up and :down4345 does raise exception when accessing current settings4346 for db_config_name=main4347 while restrict_gitlab_migration=no_gitlab_schema4348 does run migrate :up and :down4349 while restrict_gitlab_migration=gitlab_schema_gitlab_main4350 does run migrate :up and :down4351 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4352 does run migrate :up and :down4353 for db_config_name=ci4354 while restrict_gitlab_migration=no_gitlab_schema4355 does run migrate :up and :down4356 while restrict_gitlab_migration=gitlab_schema_gitlab_main4357 does run migrate :up and :down4358 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4359 does run migrate :up and :down4360 does raise exception when accessing feature flags4361 for db_config_name=main4362 while restrict_gitlab_migration=no_gitlab_schema4363 does run migrate :up and :down4364 while restrict_gitlab_migration=gitlab_schema_gitlab_main4365 does run migrate :up and :down4366 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4367 does run migrate :up and :down (FAILED - 1)43691st Try error in ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:554:4370expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError but nothing was raised4372RSpec::Retry: 2nd try ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:5544373 for db_config_name=ci4374 while restrict_gitlab_migration=no_gitlab_schema4375 does run migrate :up and :down (FAILED - 2)43771st Try error in ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:554:4378expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError but nothing was raised4380RSpec::Retry: 2nd try ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:5544381 while restrict_gitlab_migration=gitlab_schema_gitlab_main4382 does run migrate :up and :down4383 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4384 does run migrate :up and :down (FAILED - 3)43861st Try error in ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:554:4387expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError but nothing was raised4389RSpec::Retry: 2nd try ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:5544390 does raise exception about cross schema access when suppressing restriction to ensure4391 for db_config_name=main4392 while restrict_gitlab_migration=no_gitlab_schema4393 does run migrate :up and :down4394 while restrict_gitlab_migration=gitlab_schema_gitlab_main4395 does run migrate :up and :down4396 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4397 does run migrate :up and :down4398 for db_config_name=ci4399 while restrict_gitlab_migration=no_gitlab_schema4400 does run migrate :up and :down4401 while restrict_gitlab_migration=gitlab_schema_gitlab_main4402 does run migrate :up and :down4403 while restrict_gitlab_migration=gitlab_schema_gitlab_shared4404 does run migrate :up and :down4405Gitlab::Database::MigrationHelpers::V24406 #rename_column_concurrently4407 behaves like Setting up to rename a column4408 creates the renamed column, syncing existing data4409 installs triggers to sync new data4410 requires the helper to run in ddl mode4411 when called inside a transaction block4412 raises an error4413 when the existing column has a default function4414 raises an error4415 when passing a batch column4416 when the batch column does not exist4417 raises an error4418 when the batch column does exist4419 passes it when creating the column4420 when the existing column has a default value4421 creates the renamed column, syncing existing data4422 installs triggers to sync new data4423 when the existing column has a default value that evaluates to NULL4424 creates the renamed column, syncing existing data4425 installs triggers to sync new data4426 when the column to rename does not exist4427 raises an error4428 #undo_cleanup_concurrent_column_rename4429 behaves like Setting up to rename a column4430 creates the renamed column, syncing existing data4431 installs triggers to sync new data4432 requires the helper to run in ddl mode4433 when called inside a transaction block4434 raises an error4435 when the existing column has a default function4436 raises an error4437 when passing a batch column4438 when the batch column does not exist4439 raises an error4440 when the batch column does exist4441 passes it when creating the column4442 when the existing column has a default value4443 creates the renamed column, syncing existing data4444 installs triggers to sync new data4445 when the existing column has a default value that evaluates to NULL4446 creates the renamed column, syncing existing data4447 installs triggers to sync new data4448 when the renamed column does not exist4449 raises an error4450 #undo_rename_column_concurrently4451 behaves like Cleaning up from renaming a column4452 when the helper is called repeatedly4453 does not make repeated attempts to cleanup4454 when the renamed column exists4455 removes the sync triggers and renamed columns4456 #cleanup_concurrent_column_rename4457 behaves like Cleaning up from renaming a column4458 when the helper is called repeatedly4459 does not make repeated attempts to cleanup4460 when the renamed column exists4461 removes the sync triggers and renamed columns4462 #create_table4463 using a limit: attribute on .text4464 creates the table as expected4465 #with_lock_retries4466-- transaction_open?()4467 -> 0.0004s4468 sets the migration class name in the logs4469-- transaction_open?()4470 -> 0.0004s4471 does not raise on exhaustion by default4472-- transaction_open?()4473 -> 0.0003s4474 defaults to disallowing subtransactions4475 raise_on_exhaustion: true4476-- transaction_open?()4477 -> 0.0003s4478 sets raise_on_exhaustion as requested4479 raise_on_exhaustion: false4480-- transaction_open?()4481 -> 0.0002s4482 sets raise_on_exhaustion as requested4483 when in transaction4484 when lock retries are enabled4485 does not use Gitlab::Database::WithLockRetries and executes the provided block directly4486 when lock retries are not enabled4487 raises an error4488 #truncate_tables!4489 truncates the table4490 truncates multiple tables4491 raises an ArgumentError if truncating multiple gitlab_schema4492 with multiple databases4493 for ci database4494 skips the TRUNCATE statement tables not in schema for connection4495 for main database4496 executes a TRUNCATE statement4497 with single database4498 executes a TRUNCATE statement (PENDING: Skipping because database ci exists)4499Gitlab::Database::MigrationHelpers::WraparoundAutovacuum4500 # order random4501 #wraparound_prevention_on_tables?4502 is expected to be falsey4503 is expected to be truthy4504 is expected to be truthy4505 #can_execute_on?4506 dot_com: true, dev_or_test: true, wraparound_prevention: true, expectation: false4507main: -- Wraparound prevention vacuum detected, skipping migration4508 returns true for GitLab.com, dev, or test4509 dot_com: true, dev_or_test: false, wraparound_prevention: true, expectation: false4510main: -- Wraparound prevention vacuum detected, skipping migration4511 returns true for GitLab.com, dev, or test4512 dot_com: false, dev_or_test: true, wraparound_prevention: true, expectation: false4513main: -- Wraparound prevention vacuum detected, skipping migration4514 returns true for GitLab.com, dev, or test4515 dot_com: false, dev_or_test: false, wraparound_prevention: true, expectation: false4516 returns true for GitLab.com, dev, or test4517 dot_com: true, dev_or_test: true, wraparound_prevention: false, expectation: true4518 returns true for GitLab.com, dev, or test4519 dot_com: true, dev_or_test: false, wraparound_prevention: false, expectation: true4520 returns true for GitLab.com, dev, or test4521 dot_com: false, dev_or_test: true, wraparound_prevention: false, expectation: true4522 returns true for GitLab.com, dev, or test4523 dot_com: false, dev_or_test: false, wraparound_prevention: false, expectation: false4524 returns true for GitLab.com, dev, or test4525Gitlab::Database::MigrationHelpers::WraparoundVacuumHelpers4526 # order random4527 Gitlab::Database::MigrationHelpers::WraparoundVacuumHelpers::WraparoundCheck4528 #execute4529 with wraparound vacuuum running4530 outputs a message related to autovacuum4531 is expected to output /autovacuum: VACUUM public.ci_builds \(to prevent wraparound\)/ to stdout4532 is expected to output /Current duration: 2 hours, 30 minutes/ to stdout4533 when GITLAB_MIGRATIONS_DISABLE_WRAPAROUND_CHECK is set4534 is expected not to output /autovacuum/i to stdout4535 is disabled on .com4536 when executed by self-managed4537 is expected not to output /autovacuum/i to stdout4538 with wraparound vacuuum not running4539 is expected not to output /autovacuum/i to stdout4540 when the table does not exist4541 is expected to raise Gitlab::Database::MigrationHelpers::WraparoundVacuumHelpers::WraparoundCheck::WraparoundError with message matching /no_table/4542 #check_if_wraparound_in_progress4543 delegates to the wraparound class4544Gitlab::Database::MigrationHelpers4545 is expected to include Gitlab::Database::MigrationHelpers::WraparoundVacuumHelpers4546 overridden dynamic model helpers4547 #define_batchable_model4548 defines a batchable model with the migration connection4549 #each_batch4550 calls each_batch with the migration connection4551 #each_batch_range4552 calls each_batch with the migration connection4553 #remove_timestamps4554 can remove the default timestamps4555 can remove custom timestamps4556 #add_timestamps_with_timezone4557 adds "created_at" and "updated_at" fields with the "datetime_with_timezone" data type4558 can disable the NOT NULL constraint4559 can add just one column4560 can add choice of acceptable columns4561 cannot add unacceptable column names4562 #add_concurrent_index4563 outside a transaction4564 creates the index concurrently4565 creates unique index concurrently4566 unprepares the async index creation4567 when the index exists and is valid4568 does leaves the existing index4569 when an invalid copy of the index exists4570 when the default name is used4571 drops and recreates the index4572 when a custom name is used4573 drops and recreates the index4574 when a qualified table name is used4575 drops and recreates the index4576 when targeting a partition table4577 when allow_partition is true4578 creates the index concurrently4579 when allow_partition is not provided4580 raises ArgumentError4581 inside a transaction4582 raises RuntimeError4583 #remove_concurrent_index4584 outside a transaction4585 by column name4586 removes the index concurrently4587 does nothing if the index does not exist4588 unprepares the async index creation4589 when targeting a partition table4590 when dropping an index on the partition table4591 raises ArgumentError4592 by index name4593 removes the index concurrently by index name4594 does nothing if the index does not exist4595 removes the index with keyword arguments4596 raises an error if the index is blank4597 unprepares the async index creation4598 when targeting a partition table4599 when dropping an index on the partition table4600 raises ArgumentError4601 inside a transaction4602 raises RuntimeError4603 #remove_foreign_key_if_exists4604 when the foreign key does not exist4605 does nothing4606 when the foreign key exists4607 removes the foreign key4608 when the target table is not given4609 passes the options as the second parameter4610 when the reverse_lock_order option is given4611 requests for lock before removing the foreign key4612 when not inside a transaction4613 does not lock4614 #add_concurrent_foreign_key4615 inside a transaction4616 raises an error4617 outside a transaction4618 target column4619 defaults to (id) when no custom target column is provided4620 references the custom taget column when provided4621 ON DELETE statements4622 on_delete: :nullify4623 appends ON DELETE SET NULL statement4624 on_delete: :cascade4625 appends ON DELETE CASCADE statement4626 on_delete: nil4627 appends no ON DELETE statement4628 ON UPDATE statements4629 on_update: :nullify4630 appends ON UPDATE SET NULL statement4631 on_update: :cascade4632 appends ON UPDATE CASCADE statement4633 on_update: nil4634 appends no ON UPDATE statement4635 when on_update is not provided4636 appends no ON UPDATE statement4637 when no custom key name is supplied4638 creates a concurrent foreign key and validates it4639 does not create a foreign key if it exists already4640 when a custom key name is supplied4641 for creating a new foreign key for a column that does not presently exist4642 creates a new foreign key4643 for creating a duplicate foreign key for a column that presently exists4644 when the supplied key name is the same as the existing foreign key name4645 does not create a new foreign key4646 when the supplied key name is different from the existing foreign key name4647 creates a new foreign key4648 validate option4649 when validate is supplied with a falsey value4650 behaves like skips validation4651 skips validation4652 behaves like skips validation4653 skips validation4654 when validate is supplied with a truthy value4655 behaves like performs validation4656 performs validation4657 behaves like performs validation4658 performs validation4659 when validate is not supplied4660 behaves like performs validation4661 performs validation4662 when the reverse_lock_order flag is set4663 explicitly locks the tables in target-source order4664 when creating foreign key for a group of columns4665 references the custom target columns when provided4666 when foreign key is already defined4667 does not create foreign key4668 when creating foreign key on a partitioned table4669 creates the FK without using NOT VALID4670 raises an error if allow_partitioned is not set4671 when the reverse_lock_order flag is set4672 explicitly locks the tables in target-source order4673 #validate_foreign_key4674 when name is provided4675 does not infer the foreign key constraint name4676 when name is not provided4677 infers the foreign key constraint name4678 when the inferred foreign key constraint does not exist4679 raises an error4680 #concurrent_foreign_key_name4681 returns the name for a foreign key4682 when using multiple columns4683 returns the name of the foreign key4684 #foreign_key_exists?4685 compares by target table if no column given4686 raises an error if an invalid on_delete is specified4687 without specifying a target table4688 behaves like foreign key checks4689 finds existing foreign keys by column4690 finds existing foreign keys by name4691 finds existing foreign_keys by name and column4692 finds existing foreign_keys by name, column and on_delete4693 finds existing foreign keys by target table only4694 finds existing foreign_keys by identifier4695 compares by column name if given4696 compares by target column name if given4697 compares by foreign key name if given4698 compares by foreign key name and column if given4699 compares by foreign key name, column and on_delete if given4700 specifying a target table4701 behaves like foreign key checks4702 finds existing foreign keys by column4703 finds existing foreign keys by name4704 finds existing foreign_keys by name and column4705 finds existing foreign_keys by name, column and on_delete4706 finds existing foreign keys by target table only4707 finds existing foreign_keys by identifier4708 compares by column name if given4709 compares by target column name if given4710 compares by foreign key name if given4711 compares by foreign key name and column if given4712 compares by foreign key name, column and on_delete if given4713 if the schema cache does not include the constrained_columns column4714-- transaction()4715main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4716main: -> 0.0490s4717main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4718main: -> 0.0261s4719 -> 0.1525s4720 correctly sets up the test without the column in the columns_hash4721 behaves like foreign key checks4722-- transaction()4723main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4724main: -> 0.0067s4725main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4726main: -> 0.0085s4727 -> 0.0924s4728 finds existing foreign keys by column4729-- transaction()4730main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4731main: -> 0.0071s4732main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4733main: -> 0.0084s4734 -> 0.0920s4735 finds existing foreign keys by name4736-- transaction()4737main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4738main: -> 0.0070s4739main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4740main: -> 0.0085s4741 -> 0.0916s4742 finds existing foreign_keys by name and column4743-- transaction()4744main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4745main: -> 0.0071s4746main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4747main: -> 0.0085s4748 -> 0.0919s4749 finds existing foreign_keys by name, column and on_delete4750-- transaction()4751main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4752main: -> 0.0071s4753main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4754main: -> 0.0082s4755 -> 0.0902s4756 finds existing foreign keys by target table only4757-- transaction()4758main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4759main: -> 0.0059s4760main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4761main: -> 0.0079s4762 -> 0.0827s4763 finds existing foreign_keys by identifier4764-- transaction()4765main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4766main: -> 0.0251s4767main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4768main: -> 0.0085s4769 -> 0.1067s4770 compares by column name if given4771-- transaction()4772main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4773main: -> 0.0070s4774main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4775main: -> 0.0084s4776 -> 0.1448s4777 compares by target column name if given4778-- transaction()4779main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4780main: -> 0.0066s4781main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4782main: -> 0.0084s4783 -> 0.0938s4784 compares by foreign key name if given4785-- transaction()4786main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4787main: -> 0.0066s4788main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4789main: -> 0.0086s4790 -> 0.0944s4791 compares by foreign key name and column if given4792-- transaction()4793main: -- execute("DROP VIEW IF EXISTS postgres_foreign_keys;\nCREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\nWHERE contype = 'f';\n")4794main: -> 0.0070s4795main: -- execute("CREATE OR REPLACE VIEW postgres_foreign_keys AS\nSELECT\n pg_constraint.oid AS oid,\n pg_constraint.conname AS name,\n constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,\n referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier,\n constrained_table.relname::text AS constrained_table_name,\n referenced_table.relname::text AS referenced_table_name,\n constrained_cols.constrained_columns,\n referenced_cols.referenced_columns,\n pg_constraint.confdeltype AS on_delete_action,\n pg_constraint.coninhcount > 0 as is_inherited\nFROM pg_constraint\n INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid\n INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid\n INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid\n INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array\n FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid\n ) constrained_cols(constrained_columns)\n CROSS JOIN LATERAL (\n SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)\n FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)\n INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid\n ) referenced_cols(referenced_columns)\nWHERE contype = 'f';\n")4796main: -> 0.0092s4797 -> 0.0975s4798 compares by foreign key name, column and on_delete if given4799 with foreign key using multiple columns4800 finds existing foreign keys by columns4801 finds existing foreign keys by name4802 finds existing foreign_keys by name and column4803 finds existing foreign_keys by name, column and on_delete4804 finds existing foreign keys by target table only4805 compares by column name if given4806 compares by target column name if given4807 compares by foreign key name if given4808 compares by foreign key name and column if given4809 compares by foreign key name, column and on_delete if given4810 #true_value4811 returns the appropriate value4812 #false_value4813 returns the appropriate value4814 #update_column_in_batches4815 when running outside of a transaction4816 updates all the rows in a table4817 updates boolean values correctly4818 when a block is supplied4819 yields an Arel table and query object to the supplied block4820 when the value is Arel.sql (Arel::Nodes::SqlLiteral)4821 updates the value as a SQL expression4822 when the table is write-locked4823 disables the write-lock trigger function4824 raises an error if it does not disable the trigger function4825 when running inside the transaction4826 raises RuntimeError4827 #rename_column_concurrently4828 in a transaction4829 raises RuntimeError4830 outside a transaction4831 when the column to rename exists4832 renames a column concurrently4833 passes the batch_column_name4834 passes the type_cast_function4835 raises an error with invalid batch_column_name4836 with existing records and type casting4837 copies the value to the new column using the type_cast_function4838 when default is false4839 copies the default to the new column4840 when the table in the other database is write-locked4841 does not raise an error when renaming the column4842 when the column to be renamed does not exist4843 raises an error with appropriate message4844 #undo_rename_column_concurrently4845 reverses the operations of rename_column_concurrently4846 #cleanup_concurrent_column_rename4847 cleans up the renaming procedure4848 #undo_cleanup_concurrent_column_rename4849 in a transaction4850 raises RuntimeError4851 outside a transaction4852 reverses the operations of cleanup_concurrent_column_rename4853 passes the batch_column_name4854 raises an error with invalid batch_column_name4855 when default is false4856 copies the default to the old column4857 #change_column_type_concurrently4858 changes the column type4859 passed the batch column name4860 with type cast4861 changes the column type with casting the value to the new type4862 #undo_change_column_type_concurrently4863 reverses the operations of change_column_type_concurrently4864 #cleanup_concurrent_column_type_change4865 cleans up the type changing procedure4866 #undo_cleanup_concurrent_column_type_change4867 in a transaction4868 raises RuntimeError4869 outside a transaction4870 reverses the operations of cleanup_concurrent_column_type_change4871 passes the type_cast_function, batch_column_name and limit4872 raises an error with invalid batch_column_name4873 #install_rename_triggers4874 installs the triggers4875 #remove_rename_triggers4876 removes the function and trigger4877 #rename_trigger_name4878 returns a String4879 #indexes_for4880 returns the indexes for a column4881 #foreign_keys_for4882 returns the foreign keys for a column4883 #copy_indexes4884 using a regular index using a single column4885 copies the index4886 using a regular index with multiple columns4887 copies the index4888 using an index with a WHERE clause4889 copies the index4890 using an index with a USING clause4891 copies the index4892 using an index with custom operator classes4893 copies the index4894 using an index with multiple columns and custom operator classes4895 copies the index4896 using an index with multiple columns and a custom operator class on the non affected column4897 copies the index4898 using an index of which the name does not contain the source column4899 raises RuntimeError4900 #copy_foreign_keys4901 copies foreign keys from one column to another4902 #column_for4903 returns a column object for an existing column4904 raises an error when a column does not exist4905 #replace_sql4906 builds the sql with correct functions4907 results4908 replaces the correct part of the string4909 #check_trigger_permissions!4910 does nothing when the user has the correct permissions4911 raises RuntimeError when the user does not have the correct permissions4912 #convert_to_bigint_column4913 returns the name of the temporary column used to convert to bigint4914 #convert_to_type_column4915 returns the name of the temporary column used to convert to bigint4916 returns the name of the temporary column used to convert to uuid4917 #create_temporary_columns_and_triggers4918 when no mappings are provided4919 raises an error4920 when any of the mappings does not have the required keys4921 raises an error4922 when the target table does not exist4923 raises an error4924 when the column to migrate does not exist4925 raises an error4926 when old_bigint_column_naming is true4927 calls convert_to_bigint_column4928 when old_bigint_column_naming is false4929 calls convert_to_type_column4930 #initialize_conversion_of_integer_to_bigint4931 when the target table does not exist4932 raises an error4933 when the primary key does not exist4934 raises an error4935 when the column to migrate does not exist4936 raises an error4937 when the column to convert is the primary key4938 creates a not-null bigint column and installs triggers4939 when the column to convert is not the primary key, but non-nullable4940 creates a not-null bigint column and installs triggers4941 when the column to convert is not the primary key, but nullable4942 creates a nullable bigint column and installs triggers4943 when multiple columns are given4944 creates the correct columns and installs the trigger4945 #restore_conversion_of_integer_to_bigint4946 when the target table does not exist4947 raises an error4948 when the column to migrate does not exist4949 raises an error4950 when a single column is given4951 creates the correct columns and installs the trigger4952 when multiple columns are given4953 creates the correct columns and installs the trigger4954 #revert_initialize_conversion_of_integer_to_bigint4955 when single column is given4956 removes column, trigger, and function4957 when multiple columns are given4958 removes column, trigger, and function4959 #backfill_conversion_of_integer_to_bigint4960 when the target table does not exist4961 raises an error4962 when the primary key does not exist4963 raises an error4964 when the column to convert does not exist4965 raises an error4966 when the temporary column does not exist4967 raises an error4968 when the conversion is properly initialized4969 when a single column is being converted4970 creates the batched migration tracking record4971 when multiple columns are being converted4972 creates the batched migration tracking record4973 #revert_backfill_conversion_of_integer_to_bigint4974 when a single column is being converted4975 deletes the batched migration tracking record4976 when a multiple columns are being converted4977 deletes the batched migration tracking record4978 when primary key column has custom name4979 deletes the batched migration tracking record4980 #index_exists_by_name?4981 returns true if an index exists4982 returns false if the index does not exist4983 when an index with a function exists4984 returns true if an index exists4985 when an index exists for a table with the same name in another schema4986 returns false if the index does not exist in the current schema4987 #create_or_update_plan_limit4988 properly escapes names4989 when plan does not exist4990 does not create any plan limits4991 when plan does exist4992 when limit does not exist4993 inserts a new plan limits4994 when limit does exist4995 updates an existing plan limits4996 #backfill_iids4997 generates iids properly for models created after the migration4998 generates iids properly for models created after the migration when iids are backfilled4999 generates iids properly for models created after the migration across multiple projects5000 when the first model is created for a project after the migration5001 generates an iid5002 when a row already has an iid set in the database5003 backfills iids5004 backfills for multiple projects5005 #add_primary_key_using_index5006 executes the statement to add the primary key5007 when changing the primary key of a given table5008 #swap_primary_key5009 executes statements to swap primary key5010 when new index does not exist5011 raises ActiveRecord::StatementInvalid5012 #unswap_primary_key5013 executes statements to unswap primary key5014 #drop_sequence5015 executes the statement to drop the sequence5016 #add_sequence5017 executes the statement to add the sequence5018 #partition?5019 when a partition table exist5020 when the view postgres_partitions exists5021 calls the view5022 when the view postgres_partitions does not exist5023 does not call the view5024 when a partition table does not exist5025 is expected to be falsey5026 #table_partitioned?5027 is expected to be truthy5028 with a non-partitioned table5029 is expected to be falsey5030 #remove_column_default5031 with default values5032 is expected to include /ALTER TABLE "_test_defaults_table" ALTER COLUMN "int_with_default" SET DEFAULT NULL/5033 with default functions5034 is expected to include /ALTER TABLE "_test_defaults_table" ALTER COLUMN "int_with_default_function" SET DEFAULT NULL/5035 without any defaults5036 is expected to be empty5037Gitlab::Database::Migration5038 .[]5039 version: 1.05040 inherits from ActiveRecord::Migration[6.1]5041 includes migration helpers version 25042 includes LockRetriesConcern5043 unknown version5044 raises an error5045 .current_version5046 includes current ActiveRecord migration class5047 Gitlab::Database::Migration::LockRetriesConcern5048 when not explicitly called5049 does not disable lock retries by default5050 when explicitly disabled5051 does not disable lock retries by default5052Gitlab::Database::Migrations::BackgroundMigrationHelpers5053 when the migration is running against the main database5054 behaves like helpers that enqueue background migrations5055 #queue_background_migration_jobs_by_range_at_intervals5056 when the model has an ID column5057-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 600 seconds.5058The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:11 UTC."5059 returns the final expected delay5060-- Scheduled 0 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5061The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:11 UTC."5062 returns zero when nothing gets queued5063 when the delay_interval is smaller than the minimum5064-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 120 seconds.5065The migration is expected to take at least 240 seconds. Expect all jobs to have completed after 2023-08-13 07:25:12 UTC."5066 sets the delay_interval to the minimum value5067 with batch_size option5068-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 600 seconds.5069The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:12 UTC."5070 queues jobs correctly5071 without batch_size option5072-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5073The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:12 UTC."5074 queues jobs correctly5075 with other_job_arguments option5076-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5077The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:13 UTC."5078 queues jobs correctly5079 with initial_delay option5080-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5081The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:13 UTC."5082 queues jobs correctly5083 with track_jobs option5084-- Scheduled 1 ::FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5085The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:14 UTC."5086 creates a record for each job in the database5087 without track_jobs option5088-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5089The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:14 UTC."5090 does not create records in the database5091 when the model specifies a primary_column_name5092-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 600 seconds.5093The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:14 UTC."5094 returns the final expected delay5095 when the primary_column_name is a string5096-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5097The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:15 UTC."5098 does not raise error5099 when the primary_column_name is not an integer or a string5100 raises error5101 when the primary_column_name does not exist5102 raises error5103 when the model doesn't have an ID or primary_column_name column5104 raises error (for now)5105 when using Migration[2.0]5106 when restriction is set to gitlab_shared5107 does raise an exception5108 when within transaction5109 does raise an exception5110 #requeue_background_migration_jobs_by_range_at_intervals5111-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5112The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:18 UTC."5113 returns the expected duration5114-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5115The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:18 UTC."5116 queues pending jobs5117 when using Migration[2.0]5118main: -- Scheduled 2 TestJob jobs with an interval of 600 seconds.5119The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:18 UTC."5120 does re-enqueue pending jobs5121 when restriction is set5122 does raise an exception5123 when within transaction5124 does raise an exception5125 when nothing is queued5126-- Scheduled 0 FakeJob jobs with an interval of 600 seconds.5127The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:18 UTC."5128 returns expected duration of zero when nothing gets queued5129 with batch_size option5130-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5131The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:18 UTC."5132 returns the expected duration5133-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5134The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:18 UTC."5135 queues pending jobs5136-- Scheduled 0 TestJob jobs with an interval of 600 seconds.5137The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:18 UTC."5138 retrieve jobs in batches5139 with initial_delay option5140-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5141The migration is expected to take at least 1380 seconds. Expect all jobs to have completed after 2023-08-13 07:44:18 UTC."5142 returns the expected duration5143-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5144The migration is expected to take at least 1380 seconds. Expect all jobs to have completed after 2023-08-13 07:44:18 UTC."5145 queues pending jobs5146 when nothing is queued5147-- Scheduled 0 FakeJob jobs with an interval of 600 seconds.5148The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:18 UTC."5149 returns expected duration of zero when nothing gets queued5150 #finalize_background_migration5151 behaves like finalized tracked background migration5152 processed the scheduled sidekiq queue5153 processed the async sidekiq queue5154 removes 'pending' tracked jobs5155 removes 'succeeded' tracked jobs5156 when within transaction5157 does raise an exception5158 when using Migration[2.0]5159 behaves like finalized tracked background migration5160 processed the scheduled sidekiq queue5161 processed the async sidekiq queue5162 removes 'pending' tracked jobs5163 removes 'succeeded' tracked jobs5164 when restriction is set5165 does raise an exception5166 when running migration in reconfigured ActiveRecord::Base context5167 behaves like reconfigures connection stack5168 does restore connection hierarchy5169 when removing all tracked job records5170 behaves like finalized tracked background migration5171 processed the scheduled sidekiq queue5172 processed the async sidekiq queue5173 removes 'pending' tracked jobs5174 removes 'succeeded' tracked jobs5175 behaves like removed tracked jobs5176 removes 'pending' tracked jobs5177 behaves like removed tracked jobs5178 removes 'succeeded' tracked jobs5179 when retaining all tracked job records5180 retains 'succeeded' tracked jobs5181 behaves like finalized background migration5182 processed the scheduled sidekiq queue5183 processed the async sidekiq queue5184 removes 'pending' tracked jobs5185 during retry race condition5186 behaves like finalized tracked background migration5187 processed the scheduled sidekiq queue5188 processed the async sidekiq queue5189 removes 'pending' tracked jobs5190 removes 'succeeded' tracked jobs5191 #migrate_in5192 calls perform_in for the correct worker5193 pushes a context with the current class name as caller_id5194 when a specific coordinator is given5195 uses that coordinator5196 #delete_queued_jobs5197 deletes all queued jobs for the given background migration5198 when the migration is running against the ci database5199 behaves like helpers that enqueue background migrations5200 #queue_background_migration_jobs_by_range_at_intervals5201 when the model has an ID column5202-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 600 seconds.5203The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:21 UTC."5204 returns the final expected delay5205-- Scheduled 0 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5206The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:21 UTC."5207 returns zero when nothing gets queued5208 when the delay_interval is smaller than the minimum5209-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 120 seconds.5210The migration is expected to take at least 240 seconds. Expect all jobs to have completed after 2023-08-13 07:25:21 UTC."5211 sets the delay_interval to the minimum value5212 with batch_size option5213-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 600 seconds.5214The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:22 UTC."5215 queues jobs correctly5216 without batch_size option5217-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5218The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:22 UTC."5219 queues jobs correctly5220 with other_job_arguments option5221-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5222The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:22 UTC."5223 queues jobs correctly5224 with initial_delay option5225-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5226The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:23 UTC."5227 queues jobs correctly5228 with track_jobs option5229-- Scheduled 1 ::FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5230The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:23 UTC."5231 creates a record for each job in the database5232 without track_jobs option5233-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5234The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:23 UTC."5235 does not create records in the database5236 when the model specifies a primary_column_name5237-- Scheduled 2 FooJob jobs with a maximum of 2 records per batch and an interval of 600 seconds.5238The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:24 UTC."5239 returns the final expected delay5240 when the primary_column_name is a string5241-- Scheduled 1 FooJob jobs with a maximum of 1000 records per batch and an interval of 600 seconds.5242The migration is expected to take at least 600 seconds. Expect all jobs to have completed after 2023-08-13 07:31:25 UTC."5243 does not raise error5244 when the primary_column_name is not an integer or a string5245 raises error5246 when the primary_column_name does not exist5247 raises error5248 when the model doesn't have an ID or primary_column_name column5249 raises error (for now)5250 when using Migration[2.0]5251 when restriction is set to gitlab_shared5252 does raise an exception5253 when within transaction5254 does raise an exception5255 #requeue_background_migration_jobs_by_range_at_intervals5256-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5257The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:27 UTC."5258 returns the expected duration5259-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5260The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:27 UTC."5261 queues pending jobs5262 when using Migration[2.0]5263ci: -- Scheduled 2 TestJob jobs with an interval of 600 seconds.5264The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:27 UTC."5265 does re-enqueue pending jobs5266 when restriction is set5267 does raise an exception5268 when within transaction5269 does raise an exception5270 when nothing is queued5271-- Scheduled 0 FakeJob jobs with an interval of 600 seconds.5272The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:27 UTC."5273 returns expected duration of zero when nothing gets queued5274 with batch_size option5275-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5276The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:28 UTC."5277 returns the expected duration5278-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5279The migration is expected to take at least 1200 seconds. Expect all jobs to have completed after 2023-08-13 07:41:28 UTC."5280 queues pending jobs5281-- Scheduled 0 TestJob jobs with an interval of 600 seconds.5282The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:28 UTC."5283 retrieve jobs in batches5284 with initial_delay option5285-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5286The migration is expected to take at least 1380 seconds. Expect all jobs to have completed after 2023-08-13 07:44:28 UTC."5287 returns the expected duration5288-- Scheduled 2 TestJob jobs with an interval of 600 seconds.5289The migration is expected to take at least 1380 seconds. Expect all jobs to have completed after 2023-08-13 07:44:28 UTC."5290 queues pending jobs5291 when nothing is queued5292-- Scheduled 0 FakeJob jobs with an interval of 600 seconds.5293The migration is expected to take at least 0 seconds. Expect all jobs to have completed after 2023-08-13 07:21:28 UTC."5294 returns expected duration of zero when nothing gets queued5295 #finalize_background_migration5296 behaves like finalized tracked background migration5297 processed the scheduled sidekiq queue5298 processed the async sidekiq queue5299 removes 'pending' tracked jobs5300 removes 'succeeded' tracked jobs5301 when within transaction5302 does raise an exception5303 when using Migration[2.0]5304 behaves like finalized tracked background migration5305 processed the scheduled sidekiq queue5306 processed the async sidekiq queue5307 removes 'pending' tracked jobs5308 removes 'succeeded' tracked jobs5309 when restriction is set5310 does raise an exception5311 when running migration in reconfigured ActiveRecord::Base context5312 behaves like reconfigures connection stack5313 does restore connection hierarchy5314 when removing all tracked job records5315 behaves like finalized tracked background migration5316 processed the scheduled sidekiq queue5317 processed the async sidekiq queue5318 removes 'pending' tracked jobs5319 removes 'succeeded' tracked jobs5320 behaves like removed tracked jobs5321 removes 'pending' tracked jobs5322 behaves like removed tracked jobs5323 removes 'succeeded' tracked jobs5324 when retaining all tracked job records5325 retains 'succeeded' tracked jobs5326 behaves like finalized background migration5327 processed the scheduled sidekiq queue5328 processed the async sidekiq queue5329 removes 'pending' tracked jobs5330 during retry race condition5331 behaves like finalized tracked background migration5332 processed the scheduled sidekiq queue5333 processed the async sidekiq queue5334 removes 'pending' tracked jobs5335 removes 'succeeded' tracked jobs5336 #migrate_in5337 calls perform_in for the correct worker5338 pushes a context with the current class name as caller_id5339 when a specific coordinator is given5340 uses that coordinator5341 #delete_queued_jobs5342 deletes all queued jobs for the given background migration5343 #delete_job_tracking5344 with default status5345 retains 'pending' tracked jobs5346 removes 'succeeded' tracked jobs5347 with explicit status5348 removes 'pending' tracked jobs5349 removes 'succeeded' tracked jobs5350Gitlab::Database::Migrations::BaseBackgroundRunner5351 subclassing5352 requires that jobs_by_migration_name be implemented5353 requires that run_job be implemented5354Gitlab::Database::Migrations::BatchedBackgroundMigrationHelpers5355 #queue_batched_background_migration5356 creates the database record for the migration5357 when such migration already exists5358 does not create duplicate migration5359 when the job interval is lower than the minimum5360 sets the job interval to the minimum value5361 when additional arguments are passed to the method5362 when the job class provides job_arguments_count5363 when defined job arguments for the job class does not match provided arguments5364 raises an error5365 when defined job arguments for the job class match provided arguments5366 saves the arguments on the database record5367 when the job class does not provide job_arguments_count5368 does not raise an error5369 when the max_value is not given5370 when records exist in the database5371 creates the record with the current max value5372 creates the record with an active status5373 when the database is empty5374 sets the max value to the min value5375 creates the record with a finished status5376 when gitlab_schema is not given5377 fetches gitlab_schema from the migration context5378 #finalize_batched_background_migration5379 finalizes the migration5380 when the migration does not exist5381 raises an exception5382 when within transaction5383 does raise an exception5384 when running migration in reconfigured ActiveRecord::Base context5385 behaves like reconfigures connection stack5386 when restrict_gitlab_migration is set to gitlab_ci5387 finalizes the migration5388 when restrict_gitlab_migration is set to gitlab_main5389 does not find any migrations5390 when no restrict is set5391 does not find any migrations5392 when within transaction5393 does raise an exception5394 #delete_batched_background_migration5395 when migration exists5396 deletes it5397 when migration does not exist5398 does nothing5399 #gitlab_schema_from_context5400 when allowed_gitlab_schemas is not available5401 defaults to :gitlab_main5402 when allowed_gitlab_schemas is available5403 uses schema from allowed_gitlab_schema5404 #ensure_batched_background_migration_is_finished5405 raises an error when migration exists and is not marked as finished5406 does not raise error when migration exists and is marked as finished5407 finalizes the migration5408 when specified migration does not exist5409 when DBLAB_ENVIRONMENT is not set5410 logs a warning5411 when DBLAB_ENVIRONMENT is set5412 raises an error5413 when within transaction5414 does raise an exception5415 when the flag finalize is false5416 does not finalize the migration5417Gitlab::Database::Migrations::BatchedMigrationLastId5418 # order random5419 base_model: Ci::ApplicationRecord(abstract)5420 #read5421 when the file exists and have content5422 is expected to eq 995423 when the file exists and is blank5424 is expected to be nil5425 when the file doesn't exists5426 is expected to be nil5427 #store5428 creates the file properly5429 stores the proper id in the file5430 base_model: ApplicationRecord(abstract)5431 #read5432 when the file exists and have content5433 is expected to eq 995434 when the file exists and is blank5435 is expected to be nil5436 when the file doesn't exists5437 is expected to be nil5438 #store5439 creates the file properly5440 stores the proper id in the file5441Gitlab::Database::Migrations::ConstraintsHelpers5442 # order random5443 #switch_constraint_names5444 when inside a transaction5445 raises an error5446 when outside a transaction5447 executes the statement to swap the constraint names5448 #add_text_limit5449 when it is called with the default options5450 calls add_check_constraint with an infered constraint name and validate: true5451 when all parameters are provided5452 calls add_check_constraint with the correct parameters5453 #add_not_null_constraint5454 when it is called with the default options5455 calls add_check_constraint with an infered constraint name and validate: true5456 when all parameters are provided5457 calls add_check_constraint with the correct parameters5458 when the column is defined as NOT NULL5459 does not add a check constraint5460 #validate_text_limit5461 when constraint_name is not provided5462 calls validate_check_constraint with an infered constraint name5463 when constraint_name is provided5464 calls validate_check_constraint with the correct parameters5465 #check_constraint_exists?5466 returns true if a constraint exists5467 returns false if a constraint does not exist5468 returns false if a constraint with the same name exists in another table5469 returns false if a constraint with the same name exists for the same table in another schema5470 #validate_check_constraint5471 when the constraint does not exist5472 raises an error5473 when the constraint exists5474 performs validation5475 #check_not_null_constraint_exists?5476 when constraint_name is not provided5477 calls check_constraint_exists? with an infered constraint name5478 when constraint_name is provided5479 calls check_constraint_exists? with the correct parameters5480 #check_text_limit_exists?5481 when constraint_name is not provided5482 calls check_constraint_exists? with an infered constraint name5483 when constraint_name is provided5484 calls check_constraint_exists? with the correct parameters5485 #remove_not_null_constraint5486 when constraint_name is not provided5487 calls remove_check_constraint with an infered constraint name5488 when constraint_name is provided5489 calls remove_check_constraint with the correct parameters5490 #add_check_constraint5491 when constraint name validation5492 raises an error when too long5493 does not raise error when the length is acceptable5494 when inside a transaction5495 raises an error5496 when outside a transaction5497 when the constraint is already defined in the database5498 does not create a constraint5499 when the constraint is not defined in the database5500 creates the constraint5501 when validate is not provided5502 performs validation5503 when validate is provided with a falsey value5504 skips validation5505 when validate is provided with a truthy value5506 performs validation5507 #validate_not_null_constraint5508 when constraint_name is not provided5509 calls validate_check_constraint with an infered constraint name5510 when constraint_name is provided5511 calls validate_check_constraint with the correct parameters5512 #rename_constraint5513 executes the statement to rename constraint5514 #drop_constraint5515 executes the statement to drop the constraint5516 when cascade option is false5517 executes the statement to drop the constraint without cascade5518 #check_constraint_name5519 returns a valid constraint name5520 #remove_text_limit5521 when constraint_name is not provided5522 calls remove_check_constraint with an infered constraint name5523 when constraint_name is provided5524 calls remove_check_constraint with the correct parameters5525 #copy_check_constraints5526 when inside a transaction5527 raises an error5528 when outside a transaction5529 copies check constraints from one column to another5530 does nothing if there are no constraints defined for the old column5531 raises an error when the orginating column does not exist5532 raises an error when the target column does not exist5533 #remove_check_constraint5534 removes the constraint5535Gitlab::Database::Migrations::ExtensionHelpers5536 # order random5537 #drop_extension5538 executes CREATE EXTENSION statement5539 without proper permissions5540 raises an exception and prints an error message5541 #create_extension5542 executes CREATE EXTENSION statement5543 without proper permissions5544 raises an exception and prints an error message5545Gitlab::Database::Migrations::Instrumentation5546 #observe5547 executes the given block5548 behavior with observers5549 instantiates observer with observation5550 calls #before, #after, #record on given observers5551 ignores errors coming from observers #before5552 ignores errors coming from observers #after5553 ignores errors coming from observers #record5554 on successful execution5555 records a valid observation5556 transforms observation to expected json5557 upon failure5558 exception: StandardError, error_message: "something went wrong"5559 retrieving observations5560 records a valid observation5561 transforms observation to expected json5562 exception: ActiveRecord::StatementTimeout, error_message: "timeout"5563 retrieving observations5564 records a valid observation5565 transforms observation to expected json5566 sequence of migrations with failures5567 records observations for all migrations5568Gitlab::Database::Migrations::LockRetriesHelpers5569 # order random5570 #with_lock_retries5571 sets the migration class name in the logs5572 does not raise on exhaustion by default5573 defaults to allowing subtransactions5574 raise_on_exhaustion: true5575 sets raise_on_exhaustion as requested5576 raise_on_exhaustion: false5577 sets raise_on_exhaustion as requested5578Gitlab::Database::Migrations::LockRetryMixin5579 Gitlab::Database::Migrations::LockRetryMixin::ActiveRecordMigrationProxyLockRetries5580 #enable_lock_retries?5581 delegates to #migration5582 #migration_class5583 retrieves actual migration class from #migration5584 #migration_connection5585 retrieves actual migration connection from #migration5586 Gitlab::Database::Migrations::LockRetryMixin::ActiveRecordMigratorLockRetries5587 with transactions disabled5588 calls super method5589 with transactions enabled, but lock retries disabled5590 calls super method5591 with transactions enabled and lock retries enabled5592 calls super method5593 .patch!5594 patches MigrationProxy5595 patches Migrator5596Gitlab::Database::Migrations::Observers::BatchDetails5597 # order random5598 meta: lazy { { job_meta: job_meta } }, expected_keys: ["time_spent", "min_value", "max_value", "batch_size", "sub_batch_size", "pause_ms"]5599 records expected information to file5600 meta: {:job_meta=>nil}, expected_keys: ["time_spent"]5601 records expected information to file5602 meta: nil, expected_keys: ["time_spent"]5603 records expected information to file5604Gitlab::Database::Migrations::Observers::QueryDetails5605 records details of executed queries5606 unsubscribes after the observation5607Gitlab::Database::Migrations::Observers::QueryLog5608 writes a file with the query log5609 does not change the default logger5610Gitlab::Database::Migrations::Observers::QueryStatistics5611 #before5612 with pgss available5613 resets pg_stat_statements5614 without pgss available5615 executes nothing5616 #record5617 with pgss available5618 fetches data from pg_stat_statements and stores on the observation5619 without pgss available5620 executes nothing5621Gitlab::Database::Migrations::Observers::TotalDatabaseSizeChange5622 records the size change5623 out of order calls5624 does not record anything if before size is unknown5625 does not record anything if after size is unknown5626Gitlab::Database::Migrations::Observers::TransactionDuration5627 records real and sub transactions duration5628 when there are sub-transactions5629 records transaction duration5630 when there are real-transactions5631 records transaction duration5632Gitlab::Database::Migrations::PgBackendPid5633 # order random5634 .patch!5635 patches ActiveRecord::Migrator5636 Gitlab::Database::Migrations::PgBackendPid::MigratorPgBackendPid5637 re-yields with same arguments and wraps it with calls to .say5638 .say5639/builds/edith007/gitlab/vendor/ruby/3.0.0/gems/rspec-mocks-3.12.6/lib/rspec/mocks/method_double.rb:294: warning: removing `object_id' may cause serious problems5640 outputs the connection information5641 outputs nothing if ActiveRecord::Migration.verbose is false5642Gitlab::Database::Migrations::RedisHelpers5643 # order random5644 #queue_redis_migration_job5645 when migrator does not exist5646 raises error and fails the migration5647 when migrator exists5648 checks migrator and enqueues job5649Gitlab::Database::Migrations::ReestablishedConnectionStack5650 #with_restored_connection_stack5651 main5652 behaves like reconfigures connection stack5653 does restore connection hierarchy5654 does keep original connection handler5655 ci5656 behaves like reconfigures connection stack5657 does restore connection hierarchy5658 does reconfigure connection handler5659Gitlab::Database::Migrations::RunnerBackoff::ActiveRecordMixin5660 # order random5661 Gitlab::Database::Migrations::RunnerBackoff::ActiveRecordMixin::ActiveRecordMigratorRunnerBackoff5662 with runner backoff disabled5663 calls super method5664 with runner backoff enabled5665 calls super method5666 Gitlab::Database::Migrations::RunnerBackoff::ActiveRecordMixin::ActiveRecordMigrationProxyRunnerBackoff5667 #enable_runner_backoff?5668 delegates to #migration5669 returns false if migration does not implement it5670 .patch!5671 patches MigrationProxy5672 patches Migrator5673Gitlab::Database::Migrations::RunnerBackoff::Communicator5674 # order random5675 .execute_with_lock5676 delegates to a new instance object5677 #execute_with_lock5678 is expected to yield control5679 raises error if it can not set the key5680 removes the lease after executing the migration5681 with logger5682 logs messages around execution5683 .backoff_runner?5684 is expected to be falsey5685 is true when the lock is held5686 reads from Redis5687 with runner_migrations_backoff disabled5688 is false when the lock is held5689Gitlab::Database::Migrations::RunnerBackoff::MigrationHelpers5690 # order random5691 .enable_runner_backoff!5692 sets the flag5693 #enable_runner_backoff?5694 is expected to be falsy5695 returns true if the flag is set5696 .enable_runner_backoff?5697 is expected to be falsy5698 returns true if the flag is set5699Gitlab::Database::Migrations::Runner5700 main database5701 creates the results dir when one does not exist5702 .up5703 result directory5704 uses the /up subdirectory5705 migrations to run5706 is the list of pending migrations5707 running migrations5708 runs the unapplied migrations in regular/post order, then version order5709 writes a metadata file with the current schema version and database name5710 runs the unapplied migrations on the correct database5711 .down5712 writes a metadata file with the current schema version5713 result directory5714 is the /down subdirectory5715 migrations to run5716 is the list of migrations that are up and on this branch5717 running migrations5718 runs the applied migrations for the current branch in reverse order5719 .background_migrations5720 is a TestBackgroundRunner5721 is configured with a result dir of /background_migrations5722 .batched_background_migrations5723 is a TestBatchedBackgroundRunner5724 choosing the database to test against5725 chooses the provided database5726 throws an error with an invalid name5727 includes the database name in the result dir5728 legacy mode5729 does not include the database name in the path5730 .batched_migrations_last_id5731 matches the expected runner class5732 main database (legacy mode)5733 creates the results dir when one does not exist5734 .up5735 result directory5736 uses the /up subdirectory5737 migrations to run5738 is the list of pending migrations5739 running migrations5740 runs the unapplied migrations in regular/post order, then version order5741 writes a metadata file with the current schema version and database name5742 runs the unapplied migrations on the correct database5743 .down5744 writes a metadata file with the current schema version5745 result directory5746 is the /down subdirectory5747 migrations to run5748 is the list of migrations that are up and on this branch5749 running migrations5750 runs the applied migrations for the current branch in reverse order5751 .background_migrations5752 is a TestBackgroundRunner5753 is configured with a result dir of /background_migrations5754 .batched_background_migrations5755 is a TestBatchedBackgroundRunner5756 choosing the database to test against5757 chooses the provided database5758 throws an error with an invalid name5759 includes the database name in the result dir5760 legacy mode5761 does not include the database name in the path5762 .batched_migrations_last_id5763 matches the expected runner class5764 ci database5765 creates the results dir when one does not exist5766 .up5767 result directory5768 uses the /up subdirectory5769 migrations to run5770 is the list of pending migrations5771 running migrations5772 runs the unapplied migrations in regular/post order, then version order5773 writes a metadata file with the current schema version and database name5774 runs the unapplied migrations on the correct database5775 .down5776 writes a metadata file with the current schema version5777 result directory5778 is the /down subdirectory5779 migrations to run5780 is the list of migrations that are up and on this branch5781 running migrations5782 runs the applied migrations for the current branch in reverse order5783 .background_migrations5784 is a TestBackgroundRunner5785 is configured with a result dir of /background_migrations5786 .batched_background_migrations5787 is a TestBatchedBackgroundRunner5788 choosing the database to test against5789 chooses the provided database5790 throws an error with an invalid name5791 includes the database name in the result dir5792 legacy mode5793 does not include the database name in the path5794 .batched_migrations_last_id5795 matches the expected runner class5796Gitlab::Database::Migrations::SidekiqHelpers5797 # order random5798 sidekiq migration helpers5799 #sidekiq_remove_jobs5800 when inside a transaction5801 raises RuntimeError5802 when outside a transaction5803 removes all related job instances from the job classes' queues5804 when the constant is not defined5805 doesn't try to delete it5806 when the constant is defined5807 will use it find job instances to delete5808 when job instances are in the scheduled set5809 removes all related job instances from the scheduled set5810 when job instances are in the retry set5811 removes all related job instances from the retry set5812 when job fails to be deleted5813 and does not work enough times in a row before max attempts5814 tries the max attempts without succeeding5815 and then it works enough times in a row before max attempts5816 succeeds5817 #sidekiq_queue_length5818 when queue is empty5819 returns zero5820 when queue contains jobs5821 returns correct size of the queue5822 #sidekiq_queue_migrate5823 migrates jobs from one sidekiq queue to another5824Gitlab::Database::Migrations::Squasher5825 # order random5826 #files_to_delete5827 only deletes the files we're expecting5828Gitlab::Database::Migrations::TestBackgroundRunner5829 without jobs to run5830 returns immediately5831 with jobs to run5832 finding pending background jobs5833 finds all the migrations5834 running migrations5835 runs the migration class correctly5836 runs the migration for a uniform amount of time5837 with multiple migrations to run5838 splits the time between migrations when all migrations use all their time5839 does not give leftover time to extra migrations5840Gitlab::Database::Migrations::TestBatchedBackgroundRunner5841 main database5842 running a real background migration5843 runs sampled jobs from the batched background migration5844 uses the correct params to instrument the background migration5845 uses the filtering clause from the migration5846 exports migration details to a file5847 with jobs to run5848 samples jobs5849 samples 1 job with a batch size higher than the table size5850 does not sample a job if there are zero rows to sample5851 with multiple jobs to run5852 runs all pending jobs based on the last migration id5853 choosing uniform batches to run5854 #uniform_fractions5855 generates evenly distributed sequences of fractions5856 ci database5857 running a real background migration5858 runs sampled jobs from the batched background migration5859 uses the correct params to instrument the background migration5860 uses the filtering clause from the migration5861 exports migration details to a file5862 with jobs to run5863 samples jobs5864 samples 1 job with a batch size higher than the table size5865 does not sample a job if there are zero rows to sample5866 with multiple jobs to run5867 runs all pending jobs based on the last migration id5868 choosing uniform batches to run5869 #uniform_fractions5870 generates evenly distributed sequences of fractions5871Gitlab::Database::Migrations::TimeoutHelpers5872 # order random5873 #disable_statement_timeout5874-- transaction_open?()5875 -> 0.0002s5876 disables statement timeouts to current transaction only5877 with real environment5878-- execute("SET statement_timeout TO '20000'")5879 -> 0.0024s5880-- execute("SHOW statement_timeout")5881 -> 0.0013s5882-- transaction_open?()5883 -> 0.0001s5884-- execute("SET LOCAL statement_timeout TO 0")5885 -> 0.0026s5886-- execute("SHOW statement_timeout")5887 -> 0.0011s5888-- execute("SHOW statement_timeout")5889 -> 0.0010s5890-- execute("RESET statement_timeout")5891 -> 0.0010s5892 defines statement to 0 only for current transaction5893 when passing a blocks5894-- execute("SET statement_timeout TO '20000'")5895 -> 0.0045s5896 disables statement timeouts on session level and executes the block5897 with real environment5898-- execute("SET statement_timeout TO '20000'")5899 -> 0.0054s5900-- execute("SET statement_timeout TO '20000'")5901 -> 0.0014s5902-- execute("SHOW statement_timeout")5903 -> 0.0012s5904-- execute("SET statement_timeout TO 0")5905 -> 0.0010s5906-- execute("SHOW statement_timeout")5907 -> 0.0021s5908-- execute("SHOW statement_timeout")5909 -> 0.0010s5910-- execute("RESET statement_timeout")5911 -> 0.0009s5912-- execute("RESET statement_timeout")5913 -> 0.0011s5914-- execute("RESET statement_timeout")5915 -> 0.0018s5916 defines statement to 0 for any code run inside the block5917 when the statement_timeout is already disabled5918 yields control without disabling the timeout or resetting5919cross-database foreign keys5920 onlies have allowed list of cross-database foreign keys5921Gitlab::Database::ObsoleteIgnoredColumns5922 # order random5923 #execute5924 returns a list of class names and columns pairs5925Gitlab::Database::Partitioning::CiSlidingListStrategy5926 # order random5927 #missing_partitions5928 when next_partition_if returns true5929 is a partition definition for the next partition in the series5930 when next_partition_if returns false5931 is empty5932 when there are no partitions for the table5933 returns a partition for value 15934 #initial_partition5935 starts with the value 1005936 with routing tables5937 removes the prefix5938 #validate_and_fix5939 does not call change_column_default5940 #current_partitions5941 detects both partitions5942 #next_partition5943 is one after the active partition5944 with routing tables5945 removes the prefix5946 #ensure_partitioning_column_ignored_or_readonly!5947 does not raise when the column is not ignored5948 #extra_partitions5949 when all partitions are true for detach_partition_if5950 is expected to be empty5951 when all partitions are false for detach_partition_if5952 is expected to be empty5953 #active_partition5954 is the partition with the largest value5955Gitlab::Database::Partitioning::DetachedPartitionDropper5956 #perform5957 when the partition should not be dropped yet5958 does not drop the partition5959 with a partition to drop5960 drops the partition5961 removing foreign keys5962 removes foreign keys from the table before dropping it5963 does not remove foreign keys from the parent table5964 when another process drops the foreign key5965 skips dropping that foreign key5966 when another process drops the partition5967 skips dropping the foreign key5968 when another process drops the table while the first waits for a lock5969 skips the table5970 when the partition to drop is still attached to its table5971 does not drop the partition, but does remove the DetachedPartition entry5972 when another process removes the entry before this process5973 does nothing5974 with multiple partitions to drop5975 drops both partitions5976 when the first drop returns an error5977 still drops the second partition5978Gitlab::Database::Partitioning::List::ConvertTable5979 # order random5980 #partition5981WARNING: Active Record does not support composite primary key.5982_test_table_to_partition_parent has composite primary key. Composite primary key is ignored.5983 migrates the table to a partitioned table5984 when the primary key is incorrect5985 throws a reasonable error message5986 when there is not a supporting check constraint5987 throws a reasonable error message5988 when supporting check constraint is not valid5989 throws a reasonable error message5990 when the existing table is owned by a different user5991 partitions without error5992 when an error occurs during the conversion5993 when partitioning fails the first time5994 creating parent table5995 recovers from a fault5996 adding the first foreign key5997 recovers from a fault5998 adding the second foreign key5999 recovers from a fault6000 attaching table6001 recovers from a fault6002 when table has LFK triggers6003 moves the trigger on the parent table6004 #revert_preparation_for_partitioning6005 removes a check constraint6006 #prepare_for_partitioning6007 adds a check constraint6008 when it fails to add constraint6009 raises UnableToPartition error6010 when async6011 adds a NOT VALID check constraint6012 adds a PostgresAsyncConstraintValidation record6013 when constraint exists but is not valid6014 validates the check constraint6015 when it fails to validate constraint6016 raises UnableToPartition error6017 when constraint exists and is valid6018 raises UnableToPartition error6019 #revert_partitioning6020 detaches the partition6021 does not drop the child partition6022 removes the parent table6023 re-adds the check constraint6024 moves sequences back to the original table6025 when table has LFK triggers6026 restores the trigger on the partition6027Gitlab::Database::Partitioning::List::LockingConfiguration6028 # order random6029 #lock_ordering_for6030 is the intersection with the locking specification, in the order of the specification6031 raises if a table name with schema is passed6032 #locking_statement_for6033main: -- quote_table_name("table_1")6034main: -> 0.0002s6035main: -- quote_table_name("table_1")6036main: -> 0.0001s6037 only includes locking information for tables in the locking specification6038 is nil when none of the tables match the lock configuration6039main: -- quote_table_name("table_2")6040main: -> 0.0002s6041main: -- quote_table_name("table_3")6042main: -> 0.0004s6043 is a lock tables statement6044 raises if a table name with schema is passed6045Gitlab::Database::Partitioning::MonthlyStrategy6046 #current_partitions6047 detects both partitions6048 #missing_partitions6049 with existing partitions6050 detects the gap and the missing partition in May 20206051 detects the missing partitions at the end of the range and expects a partition for July 20206052 detects the missing partitions at the end of the range and expects a partition for August 20206053 creates partitions 6 months out from now (Sep 2020 through Feb 2021)6054 detects all missing partitions6055 when pruning partitions before June 20206056 does not include the missing partition from May 2020 because it would be dropped6057 detects the missing partition for 1 month ago (July 2020)6058 without existing partitions6059 detects the missing catch-all partition at the beginning6060 detects the missing partition for today and expects a partition for August 20206061 creates partitions 6 months out from now (Sep 2020 through Feb 20216062 detects all missing partitions6063 when pruning partitions before June 20206064 detects exactly the set of partitions from June 2020 to March 20216065 with a regular partition but no catchall (MINVALUE, to) partition6066 detects a missing catch-all partition to add before the existing partition6067 #extra_partitions6068 with existing partitions6069 without a time retention policy6070 has no extra partitions to prune6071 with a time retention policy that excludes no partitions6072 has no extra partitions to prune6073 with a time retention policy of 3 months6074 prunes the unbounded partition ending 2020-05-016075 with a time retention policy of 2 months6076 prunes the unbounded partition and the partition for May-June6077 when the retain_non_empty_partitions is true6078 prunes empty partitions6079 does not prune non-empty partitions6080Gitlab::Database::Partitioning::PartitionManager6081 creating partitions (mocked)6082 when the given table is partitioned6083 creates the partition6084 with explicitly provided connection6085 uses the explicitly provided connection when any6086 when an ArgumentError occurs during partition management6087 raises error6088 when an error occurs during partition management6089 does not raise an error6090 when the table is not partitioned6091 does not try creating the partitions6092 creating partitions6093 creates partitions6094 detaching partitions (mocked)6095 detaches each extra partition6096 logs an error if the partitions are not detachable6097 #detach_partitions6098 detaches exactly one partition6099 detaches the old partition6100 deletes zero tables6101 creates the appropriate PendingPartitionDrop entry6102 when the model is the target of a foreign key6103 does not detach partitions with a referenced foreign key6104 creating and then detaching partitions for a table6105 creates partitions for the future then drops the oldest one after a month6106Gitlab::Database::Partitioning::PartitionMonitoring6107 #report_metrics6108 reports number of present partitions6109 reports number of missing partitions6110 reports number of extra partitions6111Gitlab::Database::Partitioning::ReplaceTable#perform6112 replaces the current table, archiving the old6113 transfers the primary key sequence to the replacement table6114 renames the primary key constraints to match the new table names6115 when the table has partitions6116 renames the partitions to match the new table name6117 renames the primary key constraints to match the new partition names6118Gitlab::Database::Partitioning::SingleNumericListPartition6119 .from_sql6120 uses specified table name6121 uses specified partition name6122 parses the definition6123 #partition_name6124 is the explicit name if provided6125 defaults to the table name followed by the partition value6126 sorting6127 is incomparable if the tables do not match6128 sorts by the value when the tables match6129 sorts by numeric value rather than text value6130Gitlab::Database::Partitioning::SlidingListStrategy6131 #current_partitions6132 detects both partitions6133 #validate_and_fix6134 does not call change_column_default if the partitioning in a valid state6135 calls change_column_default on partition_key with the most default partition number6136 does not change the default column if it has been changed in the meanwhile by another process6137 when the shared connection is for the wrong database6138 does not attempt to fix connections6139 #active_partition6140 is the partition with the largest value6141 #missing_partitions6142 when next_partition_if returns true6143 is a partition definition for the next partition in the series6144 when next_partition_if returns false6145 is empty6146 when there are no partitions for the table6147 returns a partition for value 16148 #extra_partitions6149 when some partitions are true for detach_partition_if6150 is the leading set of partitions before that value6151 when all partitions are true for detach_partition_if6152 is all but the most recent partition6153 #initial_partition6154 starts with the value 16155 #next_partition6156 is one after the active partition6157 #ensure_partitioning_column_ignored!6158 raises when the column is not ignored6159 does not raise when the column is ignored6160 redirecting inserts as the active partition changes6161 redirects to the new partition6162Gitlab::Database::Partitioning::TimePartition6163 .from_sql6164 uses specified table name6165 uses specified partition name6166 parses start date6167 parses end date6168 with MINVALUE as a start date6169 sets from to nil6170 with MAXVALUE as an end date6171 raises a NotImplementedError6172 #partition_name6173 uses table as prefix6174 uses Year-Month (from) as suffix6175 without from date6176 uses 000000 as suffix for first partition6177 with partition name explicitly given6178 uses given partition name6179 #to_sql6180 transforms to a CREATE TABLE statement6181 without from date6182 uses MINVALUE instead6183 object equality - #eql6184 treats objects identical with identical attributes6185 different table leads to in-equality6186 different from leads to in-equality6187 different to leads to in-equality6188 different partition_name leads to in-equality6189 nil partition_name is ignored if auto-generated matches6190 Comparable, #<=>6191 sorts by partition name, i.e. by month - MINVALUE partition first6192 returns nil for partitions of different tables6193Gitlab::Database::PartitioningMigrationHelpers::BackfillPartitionedTable#perform6194 when the destination table exists6195WARNING: Active Record does not support composite primary key.6196_test_partitioning_backfills_part has composite primary key. Composite primary key is ignored.6197 copies data into the destination table idempotently6198 breaks the assigned batch into smaller batches6199 pauses after copying each sub-batch6200 marks each job record as succeeded after processing6201 returns the number of job records marked as succeeded6202 when the job is run within an explicit transaction block6203 raises an error before copying data6204 when the destination table does not exist6205 exits without attempting to copy data6206 logs a warning message that the job was skipped6207Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers6208 #add_concurrent_partitioned_foreign_key6209 when the foreign key does not exist on the parent table6210 creates the foreign key on each partition, and the parent table6211 with validate: false option6212 creates the foreign key only on partitions6213 when the foreign key exists on the parent table6214 does not attempt to create any foreign keys6215 when additional foreign key options are given6216 forwards them to the foreign key helper methods6217 when run inside a transaction block6218 raises an error6219 #validate_partitioned_foreign_key6220 when run inside a transaction block6221 raises an error6222 when run outside a transaction block6223 validates FK for each partition6224Gitlab::Database::PartitioningMigrationHelpers::IndexHelpers6225 #add_concurrent_partitioned_index6226 when the index does not exist on the parent table6227 creates the index on each partition, and the parent table6228 when the index exists on the parent table6229 does not attempt to create any indexes6230 when additional index options are given6231 forwards them to the index helper methods6232 when a name argument for the index is not given6233 raises an error6234 when the given table is not a partitioned table6235 raises an error6236 when run inside a transaction block6237 raises an error6238 #remove_concurrent_partitioned_index_by_name6239 when the index exists6240 drops the index on the parent table, cascading to all partitions6241 when the index does not exist6242 does not attempt to drop the index6243 when the given table is not a partitioned table6244 raises an error6245 when run inside a transaction block6246 raises an error6247 #find_duplicate_indexes6248 when duplicate and non-duplicate indexes exist6249 finds the duplicate index6250 #indexes_by_definition_for_table6251 when a partitioned table has indexes6252 captures partitioned index names by index definition6253 when a non-partitioned table has indexes6254 captures index names by index definition6255 when a non-partitioned table has duplicate indexes6256 raises an error6257 #rename_indexes_for_table6258 when changing a table within the current schema6259 maps index names after they are changed6260 does not rename an index which does not exist in the to_hash6261 when partitioning an existing table6262 renames indexes across schemas6263Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers6264 list partitioning conversion helpers6265 #convert_table_to_first_list_partition6266 behaves like delegates to ConvertTable6267 throws an error if in a transaction6268 delegates to a method on List::ConvertTable6269 #revert_converting_table_to_first_list_partition6270 behaves like delegates to ConvertTable6271 throws an error if in a transaction6272 delegates to a method on List::ConvertTable6273 #prepare_constraint_for_list_partitioning6274 behaves like delegates to ConvertTable6275 throws an error if in a transaction6276 delegates to a method on List::ConvertTable6277 #revert_preparing_constraint_for_list_partitioning6278 behaves like delegates to ConvertTable6279 throws an error if in a transaction6280 delegates to a method on List::ConvertTable6281 #partition_table_by_date6282 when the table is not allowed6283 raises an error6284 when run inside a transaction block6285 raises an error6286 when the the max_date is less than the min_date6287 raises an error6288 when the max_date is equal to the min_date6289 raises an error6290 when the given table does not have a primary key6291 raises an error6292 when an invalid partition column is given6293 raises an error6294 constructing the partitioned table6295 creates a table partitioned by the proper column6296 requires the migration helper to be run in DDL mode6297 changes the primary key datatype to bigint6298 removes the default from the primary key column6299 creates the partitioned table with the same non-key columns6300 creates a partition spanning over each month in the range given6301 with a non-integer primary key datatype6302 does not change the primary key datatype6303 when min_date is not given6304 with records present already6305 creates a partition spanning over each month from the first record6306 without data6307 creates the catchall partition plus two actual partition6308 when max_date is not given6309 creates partitions including the next month from today6310 without min_date, max_date6311 creates partitions for the current and next month6312 keeping data in sync with the partitioned table6313 creates a trigger function on the original table6314 syncs inserts to the partitioned tables6315 syncs updates to the partitioned tables6316 syncs deletes to the partitioned tables6317 #drop_partitioned_table_for6318 drops the trigger syncing to the partitioned table6319 drops the partitioned copy and all partitions6320 when the table is not allowed6321 raises an error6322 #enqueue_partitioning_data_migration6323 when the table is not allowed6324 raises an error6325 when run inside a transaction block6326 raises an error6327 when records exist in the source table6328 enqueues jobs to copy each batch of data6329 #cleanup_partitioning_data_migration6330 when the table is not allowed6331 raises an error6332 when tracking records exist in the batched_background_migrations table6333 deletes those pertaining to the given table6334 #create_hash_partitions6335 creates partitions for the full hash space (8 partitions)6336 creates partitions for the full hash space (16 partitions)6337 #finalize_backfilling_partitioned_table6338 when the table is not allowed6339 raises an error6340 when the partitioned table does not exist6341 raises an error6342 finishing pending batched background migration jobs6343 ensures finishing of remaining jobs and vacuums the partitioned table6344 #replace_with_partitioned_table6345 replaces the original table with the partitioned table6346 moves the trigger from the original table to the new table6347 #rollback_replace_with_partitioned_table6348 replaces the partitioned table with the non-partitioned table6349 moves the trigger from the partitioned table to the non-partitioned table6350 #drop_nonpartitioned_archive_table6351 drops the archive table6352 drops the trigger on the source table6353 drops the sync function6354 #create_trigger_to_sync_tables6355 creates the sync function6356 installs the trigger6357Gitlab::Database::Partitioning6358 .register_models6359 ensure that the registered models have partitioning strategy6360 fails when partitioning_strategy is not specified for the model6361 .sync_partitions_ignore_db_error6362 calls sync_partitions6363 when ActiveRecord::ActiveRecordError is raised6364 ignores it6365 when PG::Error is raised6366 ignores it6367 when DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP is set6368 does not call sync_partitions6369 .sync_partitions6370 manages partitions for each given model6371 with multiple databases6372 creates partitions in each database6373 without ci database6374 only creates partitions for main database (PENDING: Skipping because database ci exists)6375 when no partitioned models are given6376 manages partitions for each registered model6377 when only a specific database is requested6378 manages partitions for models for the given database6379 when partition_manager_sync_partitions feature flag is disabled6380 skips sync_partitions6381 .report_metrics6382 when no partitioned models are given6383 reports metrics for each registered model6384 when partitioned models are given6385 reports metrics for each given model6386 .drop_detached_partitions6387 drops detached partitions for each database6388 when the feature flag is disabled6389 does not call the DetachedPartitionDropper6390Gitlab::Database::PgClass6391 #cardinality_estimate6392 when no information is available6393 returns nil for the estimate6394 with reltuples available6395 returns the reltuples for the estimate6396 .for_table6397 returns PgClass for this table6398 matches the relname6399Gitlab::Database::PgDepend6400 # order random6401 .from_pg_extension6402 when having views as dependency6403 returns pg_stat_statements (PENDING: Skipping ./spec/lib/gitlab/database/pg_depend_spec.rb[1:1:1:1] because it's been fast-quarantined.)6404Gitlab::Database::PostgresAutovacuumActivity6405 is expected to be a kind of Gitlab::Database::SharedModel(abstract)6406 .for_tables6407 returns autovacuum activity for queries tables6408 executes the query6409 .wraparound_prevention6410 is expected to match (a hash including {"wraparound_prevention" => true})6411Gitlab::Database::PostgresConstraint6412 # order random6413 #primary_or_unique_constraints6414 finds primary and unique constraints6415 #including_column6416 only matches constraints on the given column6417 #valid6418 excludes invalid constraints6419 #not_including_column6420 only matches constraints not including the given column6421 #by_table_identifier6422 includes all constraints on the table6423 throws an error if the format is incorrect6424 #check_constraints6425 finds check constraints for the table6426 includes columns for the check constraints6427 #unique_constraints6428 finds the unique constraints for the table6429 #primary_key_constraints6430 finds the primary key constraint for the table6431 finds the columns in the primary key constraint6432Gitlab::Database::PostgresForeignKey6433 #by_referenced_table_identifier6434 throws an error when the identifier name is not fully qualified6435 finds the foreign keys for the referenced table6436 #by_referenced_table_name6437 finds the foreign keys for the referenced table6438 #by_constrained_table_identifier6439 throws an error when the identifier name is not fully qualified6440 finds the foreign keys for the constrained table6441 #by_constrained_table_name6442 finds the foreign keys for the constrained table6443 #by_constrained_table_name_or_identifier6444 when using table name6445 finds the foreign keys for the constrained table6446 when using identifier6447 finds the foreign keys for the constrained table6448 #by_name6449 finds foreign keys by name6450 when finding columns for foreign keys6451 fk: lazy { described_class.find_by(name: 'fk_constrained_to_referenced') }, expected_constrained: ["referenced_table_id", "referenced_table_id_b"], expected_referenced: ["id", "id_b"]6452 finds the correct constrained column names6453 finds the correct referenced column names6454 #by_constrained_columns6455 finds the correct foreign key6456 #by_referenced_columns6457 finds the correct foreign key6458 fk: lazy { described_class.find_by(name: 'fk_constrained_to_other_referenced') }, expected_constrained: ["other_referenced_table_id"], expected_referenced: ["id"]6459 finds the correct constrained column names6460 finds the correct referenced column names6461 #by_constrained_columns6462 finds the correct foreign key6463 #by_referenced_columns6464 finds the correct foreign key6465 #on_delete_action and #on_update_action6466 with an invalid on_delete_action6467 raises an error6468 fk_name: "fk_no_action", expected_action: "no_action"6469 has the appropriate on delete action6470 has the appropriate on update action6471 #by_on_delete_action6472 finds the key by on delete action6473 #by_on_update_action6474 finds the key by on update action6475 fk_name: "fk_restrict", expected_action: "restrict"6476 has the appropriate on delete action6477 has the appropriate on update action6478 #by_on_delete_action6479 finds the key by on delete action6480 #by_on_update_action6481 finds the key by on update action6482 fk_name: "fk_nullify", expected_action: "nullify"6483 has the appropriate on delete action6484 has the appropriate on update action6485 #by_on_delete_action6486 finds the key by on delete action6487 #by_on_update_action6488 finds the key by on update action6489 fk_name: "fk_cascade", expected_action: "cascade"6490 has the appropriate on delete action6491 has the appropriate on update action6492 #by_on_delete_action6493 finds the key by on delete action6494 #by_on_update_action6495 finds the key by on update action6496 fk_name: "fk_set_default", expected_action: "set_default"6497 has the appropriate on delete action6498 has the appropriate on update action6499 #by_on_delete_action6500 finds the key by on delete action6501 #by_on_update_action6502 finds the key by on update action6503 when supporting foreign keys on partitioned tables6504 #is_inherited6505 fk: lazy { described_class.find_by(name: 'fk_inherited') }, inherited: false6506 has the appropriate inheritance value6507 fk: lazy { described_class.by_referenced_table_identifier(schema_table_name('child')).first! }, inherited: true6508 has the appropriate inheritance value6509 fk: lazy { described_class.find_by(name: 'fk_constrained_to_referenced') }, inherited: false6510 has the appropriate inheritance value6511 #not_inherited6512 lists all non-inherited foreign keys6513 with two tables both partitioned6514 #child_foreign_keys6515 is the child foreign keys of the partitioned parent fk6516Gitlab::Database::PostgresHll::BatchDistinctCounter6517 unit test for different counting parameters6518 #execute6519 builds hll buckets6520 defaults batch size to 100006521 when a transaction is open6522 raises an error6523 disallowed configurations6524 raises WRONG_CONFIGURATION_ERROR if start is bigger than finish6525 raises WRONG_CONFIGURATION_ERROR if data volume exceeds upper limit6526 raises WRONG_CONFIGURATION_ERROR if batch size is less than min required6527Gitlab::Database::PostgresHll::Buckets6528 #estimated_distinct_count6529 provides estimated cardinality6530 #merge_hash!6531 merges two hashes together into union of two sets6532 #to_json6533 serialize HyperLogLog buckets as hash6534Gitlab::Database::PostgresIndexBloatEstimate6535 is expected to be a kind of Gitlab::Database::SharedModel(abstract)6536 #bloat_size6537 returns the bloat size in bytes6538 #bloat_size_bytes6539 is an alias of #bloat_size6540 #index6541 belongs to a PostgresIndex6542Gitlab::Database::PostgresIndex6543 is expected to be a kind of Gitlab::Database::SharedModel(abstract)6544 behaves like a postgres model6545 .by_identifier6546 finds the Gitlab::Database::PostgresIndex6547 raises an error if not found6548 raises ArgumentError if given a non-fully qualified identifier6549 #to_s6550 returns the name6551 #schema6552 returns the schema6553 #name6554 returns the name6555 .reindexing_support6556 only non partitioned indexes6557 only indexes that dont serve an exclusion constraint6558 only non-expression indexes6559 only btree and gist indexes6560 with leftover indexes6561 excludes temporary indexes from reindexing6562 .reindexing_leftovers6563 retrieves leftover indexes matching the /_ccnew[0-9]*$/ pattern6564 .not_match6565 excludes indexes matching the given regex6566 matches indexes without this prefix regex6567 #bloat_size6568 returns the bloat size from the estimate6569 without a bloat estimate available6570 returns 06571 #relative_bloat_level6572 calculates the relative bloat level6573 #reset6574 calls #reload6575 resets the bloat estimation6576 #unique?6577 returns true for a unique index6578 returns false for a regular, non-unique index6579 returns true for a primary key index6580 #valid_index?6581 returns true if the index is invalid6582 returns false if the index is marked as invalid6583 #definition6584 returns the index definition6585Gitlab::Database::PostgresPartition6586 associations6587 is expected to belong to postgres_partitioned_table required: false6588 behaves like a postgres model6589 .by_identifier6590 finds the Gitlab::Database::PostgresPartition6591 raises an error if not found6592 raises ArgumentError if given a non-fully qualified identifier6593 #to_s6594 returns the name6595 #schema6596 returns the schema6597 #name6598 returns the name6599 .for_parent_table6600 returns partitions for the parent table in the current schema6601 returns the partitions if the parent table schema is included in the table name6602 does not return partitions for tables not in the current schema6603 does not return partitions for tables if the schema is not the current6604 #parent_identifier6605 returns the parent table identifier6606 #condition6607 returns the condition for the partitioned values6608 .partition_exists?6609 when the partition exists6610 is expected to be truthy6611 when the partition does not exist6612 is expected to be falsey6613 .legacy_partition_exists?6614 when the partition exists6615 is expected to be truthy6616 when the partition does not exist6617 is expected to be falsey6618Gitlab::Database::PostgresPartitionedTable6619 associations6620 is expected to have many postgres_partitions6621 behaves like a postgres model6622 .by_identifier6623 finds the Gitlab::Database::PostgresPartitionedTable6624 raises an error if not found6625 raises ArgumentError if given a non-fully qualified identifier6626 #to_s6627 returns the name6628 #schema6629 returns the schema6630 #name6631 returns the name6632 .find_by_name_in_current_schema6633 finds the partitioned tables in the current schema by name6634 does not find partitioned tables in a different schema6635 .each_partition6636 without partitions6637 does not yield control6638 with partitions6639 yields control with partition as argument6640 #dynamic?6641 returns true for tables partitioned by range6642 returns true for tables partitioned by list6643 returns false for tables partitioned by hash6644 #static?6645 returns false for tables partitioned by range6646 returns false for tables partitioned by list6647 returns true for tables partitioned by hash6648 #strategy6649 returns the partitioning strategy6650 #key_columns6651 returns the partitioning key columns6652Gitlab::Database::PostgresqlAdapter::DumpSchemaVersionsMixin6653 calls SchemaMigrations touch_all and skips original implementation6654 does not call touch_all in production6655Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin6656 checking in a connection to the pool6657 calls the force disconnect callback on checkin6658 disconnecting from the database6659 when the timer is expired6660 disconnects from the database6661 when the connection has an open transaction6662 does not disconnect from the database6663 when the timer is not expired6664 does not disconnect from the database6665Gitlab::Database::PostgresqlAdapter::TypeMapCache6666 #initialize_type_map6667 caches loading of types in memory6668 only reuses the cache if the connection parameters are exactly the same6669 #reload_type_map6670 clears the cache and executes the type map query again6671Gitlab::Database::PostgresqlDatabaseTasks::LoadSchemaVersionsMixin6672 calls SchemaMigrations load_all6673Gitlab::Database::QueryAnalyzer6674 the hook is enabled by default in specs6675 does process queries and gets normalized SQL6676 does prevent recursive execution6677 #within6678 when it is already initialized6679 does initialize analyzer only once6680 does initialize user analyzer when enabled6681 does initialize user analyzer only once6682 does not initializer user analyzer when disabled6683 when initializer is enabled6684 calls begin! and end!6685 when begin! raises the end! is not called6686 when user analyzers are used6687 calls begin! and end!6688 #process_sql6689 does not analyze query if not enabled6690 does analyze query if enabled6691 does track exception if query cannot be parsed6692 does track exception if analyzer raises exception on enabled?6693 does track exception if analyzer raises exception on analyze6694 does call analyze only on enabled initializers6695 does not call analyze on suppressed analyzers6696 does call analyze on suppressed analyzers if some queries require tracking6697Gitlab::Database::QueryAnalyzers::Ci::PartitioningIdAnalyzer6698 # order random6699 when ci_partitioning_analyze_queries_partition_id_check is disabled6700 does not analyze the query6701 when ci_partitioning_analyze_queries_partition_id_check is enabled6702 when querying a routing table6703 when partition_id is present6704 when selecting data6705 behaves like a good query6706 does not raise error6707 with a join query6708 behaves like a good query6709 does not raise error6710 when removing data6711 behaves like a good query6712 does not raise error6713 when updating data6714 behaves like a good query6715 does not raise error6716 when inserting a record6717 behaves like a good query6718 does not raise error6719 when partition_id is missing6720 when inserting a record6721 behaves like a bad query6722 raises PartitionIdMissingError6723 when selecting data6724 behaves like a bad query6725 raises PartitionIdMissingError6726 when removing data6727 behaves like a bad query6728 raises PartitionIdMissingError6729 when updating data6730 behaves like a bad query6731 raises PartitionIdMissingError6732 with a join query6733 behaves like a bad query6734 raises PartitionIdMissingError6735Gitlab::Database::QueryAnalyzers::Ci::PartitioningRoutingAnalyzer6736 # order random6737 when ci_partitioning_analyze_queries is disabled6738 does not analyze the query6739 when ci_partitioning_analyze_queries is enabled6740 when analyzing targeted tables6741 when querying a non routing table6742 tracks exception6743 raises RoutingTableNotUsedError6744 when updating a record6745 raises RoutingTableNotUsedError6746 when inserting a record6747 raises RoutingTableNotUsedError6748 when analyzing non targeted table6749 does not raise error6750Gitlab::Database::QueryAnalyzers::GitlabSchemasMetrics6751 does not increment metrics if feature flag is disabled6752 properly observes all queries6753 for simple query observes schema correctly6754 is expected to receive increment({:db_config_name=>"main", :gitlab_schemas=>"gitlab_main"}) 1 time6755 for query accessing gitlab_ci and gitlab_main6756 is expected to receive increment({:db_config_name=>"main", :gitlab_schemas=>"gitlab_ci,gitlab_main"}) 1 time6757 for query accessing gitlab_ci and gitlab_main the gitlab_schemas is always ordered6758 is expected to receive increment({:db_config_name=>"main", :gitlab_schemas=>"gitlab_ci,gitlab_main"}) 1 time6759 for query accessing CI database6760 is expected to receive increment({:db_config_name=>"ci", :gitlab_schemas=>"gitlab_ci"}) 1 time6761 for query accessing gitlab_main and unknown schema6762 is expected to raise /Could not find gitlab schema for table not_in_schema/6763 for query altering an INDEX6764 is expected not to receive increment(*(any args)) 0 times6765Gitlab::Database::QueryAnalyzers::GitlabSchemasValidateConnection6766 properly observes all queries6767 for simple query observes schema correctly6768 is expected not to raise Exception6769 for query accessing gitlab_ci and gitlab_main6770 is expected to raise /The query tried to access \["projects", "ci_builds"\]/6771 for query accessing gitlab_ci and gitlab_main the gitlab_schemas is always ordered6772 is expected to raise /The query tried to access \["ci_builds", "projects"\]/6773 for query accessing main table from CI database6774 is expected to raise /The query tried to access \["projects"\]/6775 for query accessing CI database6776 is expected not to raise Exception6777 for query accessing CI table from main database6778 is expected to raise /The query tried to access \["ci_builds"\]/6779 for query accessing unknown gitlab_schema6780 is expected to raise /Could not find gitlab schema for table new_table/6781 when analyzer is enabled for tests6782 throws an error when trying to access a table that belongs to the gitlab_main schema from the ci database6783 throws an error when trying to access a table that belongs to the gitlab_ci schema from the main database6784Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification6785 context and suppress key names6786 .context_key6787 contains class name6788 .suppress_key6789 contains class name6790 when CI and other tables are read in a transaction6791 outside transaction6792 is expected not to raise Exception6793 within Project transaction6794 is expected not to raise Exception6795 within nested Project transaction6796 is expected not to raise Exception6797 outside transaction6798 is expected not to raise Exception6799 within Ci::Pipeline transaction6800 is expected not to raise Exception6801 within nested Ci::Pipeline transaction6802 is expected not to raise Exception6803 when only CI data is modified6804 outside transaction6805 is expected not to raise Exception6806 within Ci::Pipeline transaction6807 is expected not to raise Exception6808 within nested Ci::Pipeline transaction6809 is expected not to raise Exception6810 within Project transaction6811 raises error6812 when other data is modified6813 outside transaction6814 is expected not to raise Exception6815 within Project transaction6816 is expected not to raise Exception6817 within nested Project transaction6818 is expected not to raise Exception6819 within Ci::Pipeline transaction6820 raises error6821 when both CI and other data is modified6822 outside transaction6823 is expected not to raise Exception6824 when data modification happens in a transaction6825 within Project transaction6826 raises error6827 when ci_pipelines are ignored for cross modification6828 does not raise error6829 when data modification happens in nested transactions6830 raises error, with the generated sql queries included6831 when comments are added to the front of query strings6832 within Project transaction6833 raises error6834 when executing a SELECT FOR UPDATE query6835 outside transaction6836 is expected not to raise Exception6837 when data modification happens in a transaction6838 within Project transaction6839 raises error6840 when the modification is inside a factory save! call6841 does not raise an error6842 when CI association is modified through project6843 outside transaction6844 is expected not to raise Exception6845 within Ci::Pipeline transaction6846 is expected not to raise Exception6847 within nested Ci::Pipeline transaction6848 is expected not to raise Exception6849 within Project transaction6850 raises error6851 .allow_cross_database_modification_within_transaction6852 skips raising error6853 skips raising error on factory creation6854 when execution is rescued with StandardError6855 raises cross-database data modification exception6856 when uniquiness validation is tested6857 does not raise exceptions6858 when doing rollback in a suppressed block6859 does not raise misaligned transactions exception6860Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas6861 properly analyzes queries6862 for SELECT on projects for allowed_gitlab_schema=no_schema6863 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError6864 for SELECT on projects for allowed_gitlab_schema=gitlab_main6865 is expected not to raise Exception6866 for SELECT on projects for allowed_gitlab_schema=gitlab_main_clusterwide6867 is expected not to raise Exception6868 for SELECT on projects for allowed_gitlab_schema=gitlab_main_cell6869 is expected not to raise Exception6870 for SELECT on projects for allowed_gitlab_schema=gitlab_ci6871 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError6872 for SELECT on namespaces for allowed_gitlab_schema=no_schema6873 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError6874 for SELECT on namespaces for allowed_gitlab_schema=gitlab_main6875 is expected not to raise Exception6876 for SELECT on namespaces for allowed_gitlab_schema=gitlab_main_clusterwide6877 is expected not to raise Exception6878 for SELECT on namespaces for allowed_gitlab_schema=gitlab_main_cell6879 is expected not to raise Exception6880 for SELECT on namespaces for allowed_gitlab_schema=gitlab_ci6881 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError6882 for INSERT on projects for allowed_gitlab_schema=no_schema6883 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError6884 for INSERT on projects for allowed_gitlab_schema=gitlab_main6885 is expected not to raise Exception6886 for INSERT on projects for allowed_gitlab_schema=gitlab_main_clusterwide6887 is expected not to raise Exception6888 for INSERT on projects for allowed_gitlab_schema=gitlab_main_cell6889 is expected not to raise Exception6890 for INSERT on projects for allowed_gitlab_schema=gitlab_ci6891 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError6892 for INSERT on namespaces for allowed_gitlab_schema=no_schema6893 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError6894 for INSERT on namespaces for allowed_gitlab_schema=gitlab_main6895 is expected not to raise Exception6896 for INSERT on namespaces for allowed_gitlab_schema=gitlab_main_clusterwide6897 is expected not to raise Exception6898 for INSERT on namespaces for allowed_gitlab_schema=gitlab_main_cell6899 is expected not to raise Exception6900 for INSERT on namespaces for allowed_gitlab_schema=gitlab_ci6901 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError6902 for CREATE INDEX for allowed_gitlab_schema=no_schema6903 is expected not to raise Exception6904 for CREATE INDEX for allowed_gitlab_schema=gitlab_main6905 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DDLNotAllowedError6906 for CREATE INDEX for allowed_gitlab_schema=gitlab_ci6907 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DDLNotAllowedError6908 for CREATE SCHEMA for allowed_gitlab_schema=no_schema6909 is expected not to raise Exception6910 for CREATE SCHEMA for allowed_gitlab_schema=gitlab_main6911 is expected not to raise Exception6912 for CREATE SCHEMA for allowed_gitlab_schema=gitlab_ci6913 is expected not to raise Exception6914 for CREATE FUNCTION for allowed_gitlab_schema=no_schema6915 is expected not to raise Exception6916 for CREATE FUNCTION for allowed_gitlab_schema=gitlab_main6917 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DDLNotAllowedError6918 for CREATE FUNCTION for allowed_gitlab_schema=gitlab_ci6919 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DDLNotAllowedError6920 for CREATE TRIGGER for allowed_gitlab_schema=no_schema6921 is expected not to raise Exception6922 for CREATE TRIGGER for allowed_gitlab_schema=gitlab_main6923 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DDLNotAllowedError6924 for CREATE TRIGGER for allowed_gitlab_schema=gitlab_ci6925 is expected to raise Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DDLNotAllowedError6926 .require_ddl_mode!6927 when not configured does not raise exception6928 when no schemas are configured does not raise exception (DDL mode)6929 with schemas configured does raise exception (DML mode)6930 .require_dml_mode!6931 when not configured does not raise exception6932 when no schemas are configured does raise exception (DDL mode)6933 with schemas configured does raise exception (DML mode)6934Gitlab::Database::Reflection6935 #username6936 when a username is set6937 returns the username6938 when a username is not set6939 returns the value of the USER environment variable6940 #database_name6941 returns the name of the database6942 #adapter_name6943 returns the database adapter name6944 #human_adapter_name6945 when the adapter is PostgreSQL6946 returns PostgreSQL6947 when the adapter is not PostgreSQL6948 returns Unknown6949 #postgresql?6950 when using PostgreSQL6951 returns true6952 when not using PostgreSQL6953 returns false6954 #db_read_only?6955 detects a read-only database6956 detects a read-only database6957 detects a read-write database6958 detects a read-write database6959 #db_read_write?6960 detects a read-only database6961 detects a read-only database6962 detects a read-write database6963 detects a read-write database6964 #version6965 memoizes the result6966 on postgresql6967 extracts the version number6968 #postgresql_minimum_supported_version?6969 returns false when using PostgreSQL 106970 returns false when using PostgreSQL 116971 returns false when using PostgreSQL 126972 returns true when using PostgreSQL 136973 #cached_column_exists?6974 only retrieves the data from the schema cache6975 #cached_table_exists?6976 only retrieves the data from the schema cache6977 returns false when database does not exist6978 #exists?6979 returns true if the database exists6980 returns false if the database doesn't exist6981 #system_id6982 returns the PostgreSQL system identifier6983 #flavor6984 re-raises exceptions not matching expected messages6985 recognizes Amazon Aurora PostgreSQL6986 recognizes PostgreSQL on Amazon RDS6987 recognizes CloudSQL for PostgreSQL6988 recognizes Azure Database for PostgreSQL - Flexible Server6989 recognizes Azure Database for PostgreSQL - Single Server6990 recognizes AlloyDB for PostgreSQL6991 returns nil if can not recognize the flavor6992 #config6993 returns a HashWithIndifferentAccess6994 returns a default pool size6995 does not cache its results6996Gitlab::Database::Reindexing::Coordinator6997 #perform6998 when executed during the weekend6999 locking7000 acquires a lock while reindexing7001 does not perform reindexing actions if lease is not granted7002 notifications7003 sends #notify_start before reindexing7004 sends #notify_end after reindexing and updating the action is done7005 action tracking7006 calls #finish on the action7007 upon error, it still calls finish and raises the error7008 when executed during the week7009 does not start reindexing7010 #drop7011 when executed during the weekend7012 when exclusive lease is granted7013 drops the index with lock retries7014 when exclusive lease is not granted7015 does not drop the index7016 when executed during the week7017 does not start reindexing7018Gitlab::Database::Reindexing::GrafanaNotifier7019 #notify_start7020 when Grafana is configured using application settings7021 behaves like interacting with Grafana annotations API7022 POSTs a JSON payload7023 on error7024 does not raise the error and returns false7025 when request was not successful7026 returns false7027 without api_key7028 does not post anything7029 without api_url7030 does not post anything7031 when there is no additional tag7032 behaves like interacting with Grafana annotations API7033 POSTs a JSON payload7034 on error7035 does not raise the error and returns false7036 when request was not successful7037 returns false7038 without api_key7039 does not post anything7040 without api_url7041 does not post anything7042 additional tag is provided7043 behaves like interacting with Grafana annotations API7044 POSTs a JSON payload7045 on error7046 does not raise the error and returns false7047 when request was not successful7048 returns false7049 without api_key7050 does not post anything7051 without api_url7052 does not post anything7053 #notify_end7054 when Grafana is configured using application settings7055 behaves like interacting with Grafana annotations API7056 POSTs a JSON payload7057 on error7058 does not raise the error and returns false7059 when request was not successful7060 returns false7061 without api_key7062 does not post anything7063 without api_url7064 does not post anything7065 when there is no additional tag7066 behaves like interacting with Grafana annotations API7067 POSTs a JSON payload7068 on error7069 does not raise the error and returns false7070 when request was not successful7071 returns false7072 without api_key7073 does not post anything7074 without api_url7075 does not post anything7076 additional tag is provided7077 behaves like interacting with Grafana annotations API7078 POSTs a JSON payload7079 on error7080 does not raise the error and returns false7081 when request was not successful7082 returns false7083 without api_key7084 does not post anything7085 without api_url7086 does not post anything7087Gitlab::Database::Reindexing::IndexSelection7088 orders by highest relative bloat first7089 excludes indexes with a relative bloat level below 20%7090 excludes indexes smaller than 1 GiB ondisk size7091 includes indexes larger than 100 GiB ondisk size7092 with time frozen7093 does not return indexes with reindex action in the last 10 days7094 with restricted tables7095 when executed on Fridays7096 is expected not to include #<Gitlab::Database::PostgresIndex identifier: "public.some_index_119", indexrelid: 119, schema: "publ...efinition: "CREATE INDEX public.some_index_119 ON ci_builds (b...", ondisk_size_bytes: 107374182400>7097 when executed on Saturdays7098 is expected to include #<Gitlab::Database::PostgresIndex identifier: "public.some_index_130", indexrelid: 130, schema: "publ...efinition: "CREATE INDEX public.some_index_130 ON ci_builds (b...", ondisk_size_bytes: 107374182400>7099 when executed on Sundays7100 is expected not to include #<Gitlab::Database::PostgresIndex identifier: "public.some_index_141", indexrelid: 141, schema: "publ...efinition: "CREATE INDEX public.some_index_141 ON ci_builds (b...", ondisk_size_bytes: 107374182400>7101 when executed on Mondays7102 is expected not to include #<Gitlab::Database::PostgresIndex identifier: "public.some_index_152", indexrelid: 152, schema: "publ...efinition: "CREATE INDEX public.some_index_152 ON ci_builds (b...", ondisk_size_bytes: 107374182400>7103Gitlab::Database::Reindexing::ReindexAction7104 is expected to be a kind of Gitlab::Database::SharedModel(abstract)7105 .create_for7106 creates a new record for the given index7107 #finish7108 sets #action_end7109 sets #ondisk_size_bytes_end after reloading the index record7110 saves the record7111 setting #state7112 sets #state to finished if not given7113 sets #state to finished if not set to started7114 does not change state if set to failed7115Gitlab::Database::Reindexing::ReindexConcurrently#perform7116 recreates the index using REINDEX with a long statement timeout7117 when the index serves an exclusion constraint7118 raises an error7119 when attempting to reindex an expression index7120 raises an error7121 when the index is a dangling temporary index from a previous reindexing run7122 with the temporary index prefix7123 raises an error7124 with the temporary index prefix with a counter7125 raises an error7126 with dangling indexes matching TEMPORARY_INDEX_PATTERN, i.e. /some\_index\_ccnew(\d)*/7127 with normal index names7128 behaves like dropping the dangling index7129 drops the dangling indexes while controlling lock_timeout7130 with index name at 63 character limit7131 behaves like dropping the dangling index7132 drops the dangling indexes while controlling lock_timeout7133Gitlab::Database::Reindexing7134 .invoke7135 cleans up any leftover indexes7136 executes async index destruction prior to any reindexing actions7137 when there is an error raised7138 logs and re-raise7139 when async index creation is enabled7140 executes async index creation prior to any reindexing actions7141 when async index creation is disabled7142 does not execute async index creation7143 calls automatic reindexing7144 uses all candidate indexes7145 when explicit database is given7146 skips other databases7147 when async FK validation is enabled7148 executes FK validation for each database prior to any reindexing actions7149 when async FK validation is disabled7150 does not execute FK validation7151 .automatic_reindexing7152 cleans up leftovers, before consuming the queue7153 with records in the queue7154 with enough records in the queue to reach limit7155 does not perform reindexing with heuristic7156 without enough records in the queue to reach limit7157 continues if the queue did not have enough records7158 .perform_with_heuristic7159 delegates to Coordinator7160 .perform_from_queue7161 consumes the queue in order of created_at and applies the limit7162 updates queued action and sets state to done7163 updates queued action upon error and sets state to failed7164 .cleanup_leftovers!7165 drops both leftover indexes7166Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase7167 #remove_last_occurrence7168 removes only the last occurrence of a string7169 #remove_cached_html_for_projects7170 removes description_html from projects7171 removes issue descriptions7172 removes merge request descriptions7173 removes note html7174 removes milestone description7175 #rename_path_for_routable7176 for personal namespaces7177 renames namespaces called the-path7178 renames the route to the namespace7179 renames the route for projects of the namespace7180 returns the old & the new path7181 doesn't rename routes that start with a similar name7182 for groups7183 the-path group -> subgroup -> the-path0 project7184 updates the route of the project correctly7185 for projects7186 renames the project called `the-path`7187 renames the route for the project7188 returns the old & new path7189 #perform_rename7190 for personal namespaces7191 renames the path7192 for groups7193 renames all the routes for the group7194 #move_pages7195 moves the pages directory7196 #move_uploads7197 moves subdirectories in the uploads folder7198 doesn't move uploads when they are stored in object storage7199 #move_folders7200 moves a folder with files7201 #track_rename7202 tracks a rename in redis7203 #reverts_for_type7204 yields for each tracked rename7205 keeps the revert in redis if it failed7206Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces7207 #namespaces_for_paths7208 nested namespaces7209 includes the namespace7210 for child namespaces7211 only returns child namespaces with the correct path7212 has no namespaces that look the same7213 for top levelnamespaces7214 only returns child namespaces with the correct path7215 has no namespaces that just look the same7216 #move_repositories7217 moves a project for a namespace7218 moves a namespace in a subdirectory correctly7219 moves a parent namespace with subdirectories7220 #child_ids_for_parent7221 collects child ids for all levels7222 #rename_namespace7223 renames paths & routes for the namespace7224 tracks the rename7225 renames things related to the namespace7226 #rename_namespace_dependencies7227 moves the repository for a project in the namespace7228 moves the uploads for the namespace7229 moves the pages for the namespace7230 invalidates the markdown cache of related projects7231 doesn't rename users for other namespaces7232 renames the username of a namespace for a user7233 #rename_user7234 renames a username7235 #rename_namespaces7236 renames top level namespaces the namespace7237 renames child namespaces7238 #revert_renames7239 renames the routes back to the previous values7240 moves the repositories back to their original place7241 doesn't break when the namespace was renamed7242Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects7243 #projects_for_paths7244 searches using nested paths7245 includes the correct projects7246 #rename_projects7247 renames each project7248 invalidates the markdown cache of related projects7249 #rename_project7250 renames path & route for the project7251 tracks the rename7252 renames the folders for the project7253 #move_project_folders7254 moves the wiki & the repo7255 does not move the repositories when hashed storage is enabled7256 moves uploads7257 does not move uploads when hashed storage is enabled for attachments7258 moves pages7259 #move_repository7260 moves the repository for a project7261 #revert_renames7262 renames the routes back to the previous values7263 moves the repositories back to their original place7264 doesn't break when the project was renamed7265Gitlab::Database::RenameReservedPathsMigration::V17266 #rename_child_paths7267 behaves like renames child namespaces7268 renames namespaces7269 #rename_wildcard_paths7270 renames projects7271 behaves like renames child namespaces7272 renames namespaces7273 #rename_root_paths7274 renames namespaces7275 #revert_renames7276 renames namespaces7277 renames projects7278Gitlab::Database::SchemaCacheWithRenamedTable7279 when table is not renamed yet7280 uses the original table to look up metadata7281 when table is renamed7282 uses the renamed table to look up metadata7283 has primary key7284 has the same column definitions7285 has the same indexes7286 has the same column_hash7287 when the table behind a model is actually a view7288 can persist records7289 can find records7290Gitlab::Database::SchemaCleaner7291 removes comments on extensions7292 no assumption about public being the default schema7293 cleans up all the gitlab_schema_prevent_write table triggers7294 keeps the lock_writes trigger functions7295 cleans up the full schema as expected (blackbox test with example)7296Gitlab::Database::SchemaMigrations::Context7297 #schema_directory7298 returns db/schema_migrations7299 CI database7300 returns a directory path that is database specific7301 multiple databases7302 when `schema_migrations_path` is configured as string7303 returns a configured directory path that7304 when `schema_migrations_path` is configured as symbol7305 returns a configured directory path that7306 #versions_to_create7307 migrated versions is the same as migration file versions7308 returns migrated versions7309 migrated versions is subset of migration file versions7310 returns migrated versions7311 migrated versions is superset of migration file versions7312 returns file versions7313 migrated versions has slightly different versions to migration file versions7314 returns the common set7315Gitlab::Database::SchemaMigrations::Migrations7316 #touch_all7317 creates a file containing a checksum for each version with a matching migration7318 #load_all7319 when there are no version files7320 does nothing7321 when there are version files7322 inserts the missing versions into schema_migrations7323Gitlab::Database::ShaAttribute7324 #deserialize7325 converts the binary SHA to a String7326 #serialize7327 converts a SHA String to binary data7328Gitlab::Database::SharedModel7329 using an external connection7330 overrides the connection for the duration of the block7331 does not affect connections in other threads7332 raises an error if the connection does not include `:gitlab_shared` schema7333 when multiple connection overrides are nested7334 allows the nesting with the same connection object7335 raises an error if the connection is changed7336 when the block raises an error7337 re-raises the error, removing the overridden connection7338 #connection_db_config7339 returns the class connection_db_config7340 when switching the class connection7341 returns the db_config of the used connection when using load balancing7342Gitlab::Database::SimilarityScore7343 when passing empty values7344 when search is nil7345 orders by a constant 0 value7346 when rules are empty7347 orders by a constant 0 value7348 when similarity scoring based on the path7349 when searching for `git`7350 is expected to eq ["git", "gitlab", "gitaly"]7351 when searching for `gitlab`7352 is expected to eq ["gitlab", "gitlab-styles", "gitlab-danger"]7353 when searching for something unrelated7354 results have 0 similarity score7355 score multiplier7356 ranks `path` matches higher7357 annotation7358 annotates the generated SQL expression7359Gitlab::Database::TablesLocker7360 # order random7361 when running on single database7362 #lock_writes7363 does not lock any table (PENDING: Skipping because database ci exists)7364 behaves like unlock tables7365 unlocks table in schema gitlab_main and database main (PENDING: Skipping because database ci exists)7366 returns list of actions (PENDING: Skipping because database ci exists)7367 behaves like unlock tables7368 unlocks table in schema gitlab_ci and database main (PENDING: Skipping because database ci exists)7369 returns list of actions (PENDING: Skipping because database ci exists)7370 behaves like unlock tables7371 unlocks table in schema gitlab_main_clusterwide and database main (PENDING: Skipping because database ci exists)7372 returns list of actions (PENDING: Skipping because database ci exists)7373 behaves like unlock tables7374 unlocks table in schema gitlab_shared and database main (PENDING: Skipping because database ci exists)7375 returns list of actions (PENDING: Skipping because database ci exists)7376 behaves like unlock tables7377 unlocks table in schema gitlab_internal and database main (PENDING: Skipping because database ci exists)7378 returns list of actions (PENDING: Skipping because database ci exists)7379 #unlock_writes7380 does call Gitlab::Database::LockWritesManager.unlock_writes (PENDING: Skipping because database ci exists)7381 when running on multiple databases7382 #lock_writes7383 behaves like lock tables7384 locks table in schema gitlab_ci and database main7385 returns list of actions7386 behaves like lock tables7387 locks table in schema gitlab_main and database ci7388 returns list of actions7389 behaves like lock tables7390 locks table in schema gitlab_main_clusterwide and database ci7391 returns list of actions7392 behaves like unlock tables7393 unlocks table in schema gitlab_main_clusterwide and database main7394 returns list of actions7395 behaves like unlock tables7396 unlocks table in schema gitlab_main and database main7397 returns list of actions7398 behaves like unlock tables7399 unlocks table in schema gitlab_ci and database ci7400 returns list of actions7401 behaves like unlock tables7402 unlocks table in schema gitlab_shared and database main7403 returns list of actions7404 behaves like unlock tables7405 unlocks table in schema gitlab_shared and database ci7406 returns list of actions7407 behaves like unlock tables7408 unlocks table in schema gitlab_internal and database main7409 returns list of actions7410 behaves like unlock tables7411 unlocks table in schema gitlab_internal and database ci7412 returns list of actions7413 behaves like unlock partitions7414 unlocks the partition7415 behaves like lock partitions7416 locks the partition7417 behaves like unlock partitions7418 unlocks the partition7419 behaves like lock partitions7420 locks the partition7421 #unlock_writes7422 behaves like unlock tables7423 unlocks table in schema gitlab_ci and database main7424 returns list of actions7425 behaves like unlock tables7426 unlocks table in schema gitlab_main and database ci7427 returns list of actions7428 behaves like unlock tables7429 unlocks table in schema gitlab_main and database main7430 returns list of actions7431 behaves like unlock tables7432 unlocks table in schema gitlab_ci and database ci7433 returns list of actions7434 behaves like unlock tables7435 unlocks table in schema gitlab_shared and database main7436 returns list of actions7437 behaves like unlock tables7438 unlocks table in schema gitlab_shared and database ci7439 returns list of actions7440 behaves like unlock tables7441 unlocks table in schema gitlab_internal and database main7442 returns list of actions7443 behaves like unlock tables7444 unlocks table in schema gitlab_internal and database ci7445 returns list of actions7446 behaves like unlock partitions7447 unlocks the partition7448 behaves like unlock partitions7449 unlocks the partition7450 behaves like unlock partitions7451 unlocks the partition7452 behaves like unlock partitions7453 unlocks the partition7454 when not including partitions7455 does not include any table partitions7456 does not include any detached partitions7457 when running in dry_run mode7458 passes dry_run flag to LockWritesManager7459 when running on multiple shared databases7460 does not lock any tables if the ci database is shared with main database7461 when geo database is configured7462 does not lock table in geo database (PENDING: Geo database is not configured)7463Gitlab::Database::TablesSortedByForeignKeys7464 # order random7465 #execute7466 returns the tables sorted by the foreign keys dependency7467 returns both tables together if they are strongly connected7468Gitlab::Database::TablesTruncate7469 # order random7470 when truncating gitlab_ci tables on the main database7471 behaves like truncating legacy tables on a database7472 when the truncated tables are not locked for writes7473WARNING: Active Record does not support composite primary key.7474_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7475WARNING: Active Record does not support composite primary key.7476gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7477WARNING: Active Record does not support composite primary key.7478_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7479WARNING: Active Record does not support composite primary key.7480gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7481 raises an error that the tables are not locked for writes7482 when the truncated tables are locked for writes7483WARNING: Active Record does not support composite primary key.7484_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7485WARNING: Active Record does not support composite primary key.7486gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7487WARNING: Active Record does not support composite primary key.7488_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7489WARNING: Active Record does not support composite primary key.7490gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7491 truncates the legacy tables7492WARNING: Active Record does not support composite primary key.7493_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7494WARNING: Active Record does not support composite primary key.7495gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7496WARNING: Active Record does not support composite primary key.7497_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7498WARNING: Active Record does not support composite primary key.7499gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7500 does not affect the other tables7501WARNING: Active Record does not support composite primary key.7502_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7503WARNING: Active Record does not support composite primary key.7504gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7505WARNING: Active Record does not support composite primary key.7506_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7507WARNING: Active Record does not support composite primary key.7508gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7509 logs the sql statements to the logger7510 when running in dry_run mode7511WARNING: Active Record does not support composite primary key.7512_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7513WARNING: Active Record does not support composite primary key.7514gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7515WARNING: Active Record does not support composite primary key.7516_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7517WARNING: Active Record does not support composite primary key.7518gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7519 does not truncate the legacy tables if running in dry run mode7520 when passing until_table parameter7521 with a table that exists7522WARNING: Active Record does not support composite primary key.7523_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7524WARNING: Active Record does not support composite primary key.7525gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7526WARNING: Active Record does not support composite primary key.7527_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7528WARNING: Active Record does not support composite primary key.7529gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7530 only truncates until the table specified7531 with a table that does not exist7532WARNING: Active Record does not support composite primary key.7533_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7534WARNING: Active Record does not support composite primary key.7535gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7536WARNING: Active Record does not support composite primary key.7537_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7538WARNING: Active Record does not support composite primary key.7539gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7540 raises an error if the specified table does not exist7541 when one of the attached partitions happened to be locked for writes7542WARNING: Active Record does not support composite primary key.7543_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7544WARNING: Active Record does not support composite primary key.7545gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7546WARNING: Active Record does not support composite primary key.7547_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7548WARNING: Active Record does not support composite primary key.7549gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7550 truncates the locked partition successfully (PENDING: No reason given)7551 with geo configured7552WARNING: Active Record does not support composite primary key.7553_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7554WARNING: Active Record does not support composite primary key.7555gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7556WARNING: Active Record does not support composite primary key.7557_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7558WARNING: Active Record does not support composite primary key.7559gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7560 does not truncate gitlab_geo tables (PENDING: No reason given)7561 when running with multiple shared databases7562 raises an error when truncating the main database that it is a single database setup (PENDING: Skipping because database ci exists)7563 raises an error when truncating the ci database that it is a single database setup (PENDING: Skipping because database ci exists)7564 when running in a single database mode7565 raises an error when truncating the main database that it is a single database setup (PENDING: Skipping because some of the extra databases [:ci] are setup)7566 raises an error when truncating the ci database that it is a single database setup (PENDING: Skipping because some of the extra databases [:ci] are setup)7567 when truncating gitlab_main tables on the ci database7568 behaves like truncating legacy tables on a database7569 when the truncated tables are not locked for writes7570WARNING: Active Record does not support composite primary key.7571_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7572WARNING: Active Record does not support composite primary key.7573gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7574WARNING: Active Record does not support composite primary key.7575_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7576WARNING: Active Record does not support composite primary key.7577gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7578 raises an error that the tables are not locked for writes7579 when the truncated tables are locked for writes7580WARNING: Active Record does not support composite primary key.7581_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7582WARNING: Active Record does not support composite primary key.7583gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7584WARNING: Active Record does not support composite primary key.7585_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7586WARNING: Active Record does not support composite primary key.7587gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7588WARNING: Active Record does not support composite primary key.7589_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7590WARNING: Active Record does not support composite primary key.7591gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7592WARNING: Active Record does not support composite primary key.7593_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7594WARNING: Active Record does not support composite primary key.7595gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7596 truncates the legacy tables (FAILED - 4)75981st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:185:7599Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first7601RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:1857602WARNING: Active Record does not support composite primary key.7603_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7604WARNING: Active Record does not support composite primary key.7605gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7606WARNING: Active Record does not support composite primary key.7607_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7608WARNING: Active Record does not support composite primary key.7609gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7610WARNING: Active Record does not support composite primary key.7611_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7612WARNING: Active Record does not support composite primary key.7613gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7614WARNING: Active Record does not support composite primary key.7615_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7616WARNING: Active Record does not support composite primary key.7617gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7618 does not affect the other tables (FAILED - 5)76201st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:192:7621Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first7623RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:1927624WARNING: Active Record does not support composite primary key.7625_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7626WARNING: Active Record does not support composite primary key.7627gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7628WARNING: Active Record does not support composite primary key.7629_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7630WARNING: Active Record does not support composite primary key.7631gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7632WARNING: Active Record does not support composite primary key.7633_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7634WARNING: Active Record does not support composite primary key.7635gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7636WARNING: Active Record does not support composite primary key.7637_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7638WARNING: Active Record does not support composite primary key.7639gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7640 logs the sql statements to the logger (FAILED - 6)76421st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:198:7643Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first7645RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:1987646 when running in dry_run mode7647WARNING: Active Record does not support composite primary key.7648_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7649WARNING: Active Record does not support composite primary key.7650gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7651WARNING: Active Record does not support composite primary key.7652_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7653WARNING: Active Record does not support composite primary key.7654gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7655WARNING: Active Record does not support composite primary key.7656_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7657WARNING: Active Record does not support composite primary key.7658gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7659WARNING: Active Record does not support composite primary key.7660_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7661WARNING: Active Record does not support composite primary key.7662gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7663 does not truncate the legacy tables if running in dry run mode (FAILED - 7)76651st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:209:7666Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first7668RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:2097669 when passing until_table parameter7670 with a table that exists7671WARNING: Active Record does not support composite primary key.7672_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7673WARNING: Active Record does not support composite primary key.7674gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7675WARNING: Active Record does not support composite primary key.7676_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7677WARNING: Active Record does not support composite primary key.7678gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7679WARNING: Active Record does not support composite primary key.7680_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7681WARNING: Active Record does not support composite primary key.7682gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7683WARNING: Active Record does not support composite primary key.7684_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7685WARNING: Active Record does not support composite primary key.7686gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7687 only truncates until the table specified (FAILED - 8)76891st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:221:7690Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first7692RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:2217693 with a table that does not exist7694WARNING: Active Record does not support composite primary key.7695_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7696WARNING: Active Record does not support composite primary key.7697gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7698WARNING: Active Record does not support composite primary key.7699_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7700WARNING: Active Record does not support composite primary key.7701gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7702WARNING: Active Record does not support composite primary key.7703_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7704WARNING: Active Record does not support composite primary key.7705gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7706WARNING: Active Record does not support composite primary key.7707_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7708WARNING: Active Record does not support composite primary key.7709gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7710 raises an error if the specified table does not exist (FAILED - 9)77121st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:232:7713expected /The table 'foobar' is not within the truncated tables/, got #<RuntimeError: Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first> with backtrace:7714 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'7715 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'7716 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'7717 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'7718 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:234:in `block (7 levels) in <top (required)>'7719 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:233:in `block (6 levels) in <top (required)>'7720 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'7721 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'7722 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'7723 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'7724 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'7725 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'7726 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'7727 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'7728 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'7729 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'7730 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'7731 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'7732 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'7733 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'7734 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'7735 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'7736 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'7737 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'7738 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'7740RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:2327741 when one of the attached partitions happened to be locked for writes7742WARNING: Active Record does not support composite primary key.7743_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7744WARNING: Active Record does not support composite primary key.7745gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7746WARNING: Active Record does not support composite primary key.7747_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7748WARNING: Active Record does not support composite primary key.7749gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7750WARNING: Active Record does not support composite primary key.7751_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7752WARNING: Active Record does not support composite primary key.7753gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7754WARNING: Active Record does not support composite primary key.7755_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7756WARNING: Active Record does not support composite primary key.7757gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7758 truncates the locked partition successfully (FAILED - 10)77601st Try error in ./spec/lib/gitlab/database/tables_truncate_spec.rb:252:7761Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first7763RSpec::Retry: 2nd try ./spec/lib/gitlab/database/tables_truncate_spec.rb:2527764 with geo configured7765WARNING: Active Record does not support composite primary key.7766_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7767WARNING: Active Record does not support composite primary key.7768gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7769WARNING: Active Record does not support composite primary key.7770_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.7771WARNING: Active Record does not support composite primary key.7772gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.7773 does not truncate gitlab_geo tables (PENDING: No reason given)7774Gitlab::Database::Transaction::Context7775 #set_start_time7776 sets start_time7777 #increment_savepoints7778 is expected to eq 27779 #increment_rollbacks7780 is expected to eq 37781 #increment_releases7782 is expected to eq 47783 #set_depth7784 is expected to eq 27785 #track_sql7786 is expected to eq ["SELECT 1", "SELECT * FROM users"]7787 #track_backtrace7788 is expected to be a kind of Array7789 is expected to all be a kind of Array7790 is expected to eq 17791 is expected to be a kind of String7792 appends the backtrace7793 #duration7794 is expected to be >= 07795 when savepoints count exceeds threshold7796 behaves like logs transaction data7797 logs once upon COMMIT7798 logs once upon ROLLBACK7799 logs again when log throttle duration passes7800 #should_log? returns true7801 when duration exceeds threshold7802 behaves like logs transaction data7803 logs once upon COMMIT7804 logs once upon ROLLBACK7805 logs again when log throttle duration passes7806 #should_log? returns true7807 when there are too many external HTTP requests7808 behaves like logs transaction data7809 logs once upon COMMIT7810 logs once upon ROLLBACK7811 logs again when log throttle duration passes7812 #should_log? returns true7813 when there are too many too long external HTTP requests7814 behaves like logs transaction data7815 logs once upon COMMIT7816 logs once upon ROLLBACK7817 logs again when log throttle duration passes7818 #should_log? returns true7819Gitlab::Database::Transaction::Observer7820 .instrument_transactions7821 tracks transaction data7822 tracking external network requests7823 tracks external requests7824 when external HTTP requests duration has been exceeded7825 logs transaction details including exceeding thresholds7826 when external HTTP requests count has been exceeded7827 logs transaction details including exceeding thresholds7828 .extract_sql_command7829 sql: "SELECT 1", expected: "SELECT 1"7830 is expected to eq "SELECT 1"7831 sql: "/* test comment */ SELECT 1", expected: "SELECT 1"7832 is expected to eq "SELECT 1"7833 sql: "/* test comment */ ROLLBACK TO SAVEPOINT point1", expected: "ROLLBACK TO SAVEPOINT "7834 is expected to eq "ROLLBACK TO SAVEPOINT "7835 sql: "SELECT 1 /* trailing comment */", expected: "SELECT 1 /* trailing comment */"7836 is expected to eq "SELECT 1 /* trailing comment */"7837Gitlab::Database::TransactionTimeoutSettings7838 # order random7839 #restore_timeouts7840 resets value7841 #disable_timeouts7842 sets timeouts to 07843Gitlab::Database::Type::Color7844 serializes by calling #to_s7845 serializes nil to nil7846 casts by calling Color::new7847 accepts colors as arguments to cast7848 allows nil database values7849 tells us what is serializable7850 tells us what is not serializable7851Gitlab::Database::Type::IndifferentJsonb7852 # order random7853 #deserialize7854 json: nil, value: nil7855 is expected to match nil7856 is expected to match nil7857 json: "{\"key\":\"value\"}", value: {:key=>"value"}7858 is expected to match {:key=>"value"}7859 is expected to match {"key"=>"value"}7860 json: "{\"key\":[1,2,3]}", value: {:key=>[1, 2, 3]}7861 is expected to match {:key=>[1, 2, 3]}7862 is expected to match {"key"=>[1, 2, 3]}7863 json: "{\"key\":{\"subkey\":\"value\"}}", value: {:key=>{:subkey=>"value"}}7864 is expected to match {:key=>{:subkey=>"value"}}7865 is expected to match {"key"=>{"subkey"=>"value"}}7866 json: "{\"key\":{\"a\":[{\"b\":\"c\"},{\"d\":\"e\"}]}}", value: {:key=>{:a=>[{:b=>"c"}, {:d=>"e"}]}}7867 is expected to match {:key=>{:a=>[{:b=>"c"}, {:d=>"e"}]}}7868 is expected to match {"key"=>{"a"=>[{"b"=>"c"}, {"d"=>"e"}]}}7869 when used by a model7870 is expected to match {:key=>"value"}7871 is expected to match {"key"=>"value"}7872 ignores changes to other attributes7873 tracks changes to options7874Gitlab::Database::Type::JsonPgSafe7875 #serialize7876 value: nil, json: nil7877 is expected to eq nil7878 value: 1, json: "1"7879 is expected to eq "1"7880 value: 1.0, json: "1.0"7881 is expected to eq "1.0"7882 value: "str\u0000ing\u0000", json: "\"string\""7883 is expected to eq "\"string\""7884 value: ["\u0000arr", "a\u0000y"], json: "[\"arr\",\"ay\"]"7885 is expected to eq "[\"arr\",\"ay\"]"7886 value: {"key\u0000"=>"value\u0000\u0000"}, json: "{\"key\":\"value\"}"7887 is expected to eq "{\"key\":\"value\"}"7888Gitlab::Database::Type::SymbolizedJsonb7889 # order random7890 when used by a model7891 is expected to match {:key=>"value"}7892 ignores changes to other attributes7893 tracks changes to options7894 #deserialize7895 json: nil, value: nil7896 is expected to match nil7897 json: "{\"key\":\"value\"}", value: {:key=>"value"}7898 is expected to match {:key=>"value"}7899 json: "{\"key\":[1,2,3]}", value: {:key=>[1, 2, 3]}7900 is expected to match {:key=>[1, 2, 3]}7901 json: "{\"key\":{\"subkey\":\"value\"}}", value: {:key=>{:subkey=>"value"}}7902 is expected to match {:key=>{:subkey=>"value"}}7903 json: "{\"key\":{\"a\":[{\"b\":\"c\"},{\"d\":\"e\"}]}}", value: {:key=>{:a=>[{:b=>"c"}, {:d=>"e"}]}}7904 is expected to match {:key=>{:a=>[{:b=>"c"}, {:d=>"e"}]}}7905Gitlab::Database::UnidirectionalCopyTrigger7906 #name7907 when a single column name is given7908 returns the trigger name7909 when multiple column names are given7910 returns the trigger name7911 when a different number of new and old column names are given7912 raises an error7913 #create7914 when a single column name is given7915 creates the trigger and function7916 properly copies the column data using the trigger function7917 when multiple column names are given7918 creates the trigger and function to set all the columns7919 properly copies the columns using the trigger function7920 when a custom trigger name is given7921 creates the trigger and function with the custom name7922 when the trigger function already exists7923 does not raise an error7924 when a different number of new and old column names are given7925 raises an error7926 #drop7927 drops the trigger and function for the given arguments7928 when the trigger does not exist7929 does not raise an error7930Gitlab::Database::WithLockRetriesOutsideTransaction7931 #run7932 requires block7933 when DISABLE_LOCK_RETRIES is set7934 executes the passed block without retrying7935 when lock retry is enabled7936 lock_fiber7937 acquires lock successfully7938 after 3 iterations7939 behaves like retriable exclusive lock on `projects`7940 succeeds executing the given block7941 setting the idle transaction timeout7942 when there is no outer transaction: disable_ddl_transaction! is set in the migration7943 does not disable the idle transaction timeout7944 when there is outer transaction: disable_ddl_transaction! is not set in the migration7945 disables the idle transaction timeout so the code can sleep and retry7946 after the retries are exhausted7947 disables the lock_timeout7948 after the retries, without setting lock_timeout7949 behaves like retriable exclusive lock on `projects`7950 succeeds executing the given block7951 after the retries, when requested to raise an error7952 raises an error instead of waiting indefinitely for the lock7953 when statement timeout is reached7954 raises StatementInvalid error7955 restore local database variables7956 is expected not to change `connection.execute("SHOW lock_timeout").to_a`7957 is expected not to change `connection.execute("SHOW idle_in_transaction_session_timeout").to_a`7958 casting durations correctly7959 executes `SET lock_timeout` using the configured timeout value in milliseconds7960 calls `sleep` after the first iteration fails, using the configured sleep time7961Gitlab::Database::WithLockRetries7962 #run7963 requires block7964 when DISABLE_LOCK_RETRIES is set7965 executes the passed block without retrying7966 when lock retry is enabled7967 lock_fiber7968 acquires lock successfully7969 after 3 iterations7970 behaves like retriable exclusive lock on `projects`7971 succeeds executing the given block7972 setting the idle transaction timeout7973 when there is no outer transaction: disable_ddl_transaction! is set in the migration7974 does not disable the idle transaction timeout7975 when there is outer transaction: disable_ddl_transaction! is not set in the migration7976 disables the idle transaction timeout so the code can sleep and retry7977 after the retries are exhausted7978 when there is no outer transaction: disable_ddl_transaction! is set in the migration7979 does not disable the lock_timeout7980 when there is outer transaction: disable_ddl_transaction! is not set in the migration7981 disables the lock_timeout7982 after the retries, without setting lock_timeout7983 behaves like retriable exclusive lock on `projects`7984 succeeds executing the given block7985 after the retries, when requested to raise an error7986 raises an error instead of waiting indefinitely for the lock7987 when statement timeout is reached7988 raises QueryCanceled error7989 restore local database variables7990 is expected not to change `connection.execute("SHOW lock_timeout").to_a`7991 is expected not to change `connection.execute("SHOW idle_in_transaction_session_timeout").to_a`7992 casting durations correctly7993 executes `SET LOCAL lock_timeout` using the configured timeout value in milliseconds7994 calls `sleep` after the first iteration fails, using the configured sleep time7995 Stop using subtransactions - allow_savepoints: false7996 prevents running inside already open transaction7997 does not raise the error if not inside open transaction7998rspec/skipped_tests-4863614081.txt doesn't exist!7999Pending: (Failures listed here are expected and do not affect your suite's status)8000 1) Gitlab::Database::MigrationHelpers::AutomaticLockWritesOnTables when executing create_table migrations when single database does not lock any newly created tables8001 # Skipping because database ci exists8002 # ./spec/lib/gitlab/database/migration_helpers/automatic_lock_writes_on_tables_spec.rb:1028003 2) Gitlab::Database::MigrationHelpers::AutomaticLockWritesOnTables when executing create_table migrations when multiple databases for creating a gitlab_geo table behaves like does not lock writes on table allows deleting records from the table8004 # No reason given8005 # ./spec/lib/gitlab/database/migration_helpers/automatic_lock_writes_on_tables_spec.rb:438006 3) Gitlab::Database::MigrationHelpers::AutomaticLockWritesOnTables when reversing drop_table migrations when single database does not lock any newly created tables8007 # Skipping because database ci exists8008 # ./spec/lib/gitlab/database/migration_helpers/automatic_lock_writes_on_tables_spec.rb:3198009 4) Gitlab::Database::MigrationHelpers::V2#truncate_tables! with single database executes a TRUNCATE statement8010 # Skipping because database ci exists8011 # ./spec/lib/gitlab/database/migration_helpers/v2_spec.rb:4918012 5) Gitlab::Database::Partitioning.sync_partitions without ci database only creates partitions for main database8013 # Skipping because database ci exists8014 # ./spec/lib/gitlab/database/partitioning_spec.rb:1168015 6) Gitlab::Database::PgDepend.from_pg_extension when having views as dependency returns pg_stat_statements8016 # Skipping ./spec/lib/gitlab/database/pg_depend_spec.rb[1:1:1:1] because it's been fast-quarantined.8017 Failure/Error: skip "Skipping #{example.id} because it's been fast-quarantined."8018 RSpec::Core::Pending::SkipDeclaredInExample8019 # ./spec/support/fast_quarantine.rb:20:in `block (2 levels) in <top (required)>'8020 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8021 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8022 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8023 7) Gitlab::Database::TablesLocker when running on single database #lock_writes does not lock any table8024 # Skipping because database ci exists8025 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1758026 8) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables unlocks table in schema gitlab_main and database main8027 # Skipping because database ci exists8028 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1028029 9) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables returns list of actions8030 # Skipping because database ci exists8031 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1228032 10) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables unlocks table in schema gitlab_ci and database main8033 # Skipping because database ci exists8034 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1028035 11) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables returns list of actions8036 # Skipping because database ci exists8037 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1228038 12) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables unlocks table in schema gitlab_main_clusterwide and database main8039 # Skipping because database ci exists8040 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1028041 13) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables returns list of actions8042 # Skipping because database ci exists8043 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1228044 14) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables unlocks table in schema gitlab_shared and database main8045 # Skipping because database ci exists8046 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1028047 15) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables returns list of actions8048 # Skipping because database ci exists8049 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1228050 16) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables unlocks table in schema gitlab_internal and database main8051 # Skipping because database ci exists8052 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1028053 17) Gitlab::Database::TablesLocker when running on single database #lock_writes behaves like unlock tables returns list of actions8054 # Skipping because database ci exists8055 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1228056 18) Gitlab::Database::TablesLocker when running on single database #unlock_writes does call Gitlab::Database::LockWritesManager.unlock_writes8057 # Skipping because database ci exists8058 # ./spec/lib/gitlab/database/tables_locker_spec.rb:1938059 19) Gitlab::Database::TablesLocker when geo database is configured does not lock table in geo database8060 # Geo database is not configured8061 # ./spec/lib/gitlab/database/tables_locker_spec.rb:3298062 20) Gitlab::Database::TablesTruncate when truncating gitlab_ci tables on the main database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when one of the attached partitions happened to be locked for writes truncates the locked partition successfully8063 # No reason given8064 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:2528065 21) Gitlab::Database::TablesTruncate when truncating gitlab_ci tables on the main database behaves like truncating legacy tables on a database when the truncated tables are locked for writes with geo configured does not truncate gitlab_geo tables8066 # No reason given8067 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:2688068 22) Gitlab::Database::TablesTruncate when running with multiple shared databases raises an error when truncating the main database that it is a single database setup8069 # Skipping because database ci exists8070 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:3208071 23) Gitlab::Database::TablesTruncate when running with multiple shared databases raises an error when truncating the ci database that it is a single database setup8072 # Skipping because database ci exists8073 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:3268074 24) Gitlab::Database::TablesTruncate when running in a single database mode raises an error when truncating the main database that it is a single database setup8075 # Skipping because some of the extra databases [:ci] are setup8076 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:3388077 25) Gitlab::Database::TablesTruncate when running in a single database mode raises an error when truncating the ci database that it is a single database setup8078 # Skipping because some of the extra databases [:ci] are setup8079 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:3448080 26) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes with geo configured does not truncate gitlab_geo tables8081 # No reason given8082 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:2688083Failures:8084 1) Gitlab::Database::MigrationHelpers::RestrictGitlabSchema when executing migrations does raise exception when accessing feature flags for db_config_name=main while restrict_gitlab_migration=gitlab_schema_gitlab_shared does run migrate :up and :down8085 Failure/Error: expect { migration_class.migrate(:up) }.to raise_error(Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError)8086 expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError but nothing was raised8087 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:580:in `block (8 levels) in <top (required)>'8088 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:540:in `block (7 levels) in <top (required)>'8089 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8090 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:537:in `block (6 levels) in <top (required)>'8091 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:12:in `block (3 levels) in <top (required)>'8092 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8093 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:11:in `block (2 levels) in <top (required)>'8094 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8095 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8096 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8097 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8098 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8099 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8100 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8101 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8102 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8103 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8104 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8105 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8106 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8107 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8108 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8109 # ./spec/support/database/gitlab_schemas_validate_connection.rb:15:in `block (2 levels) in <top (required)>'8110 2) Gitlab::Database::MigrationHelpers::RestrictGitlabSchema when executing migrations does raise exception when accessing feature flags for db_config_name=ci while restrict_gitlab_migration=no_gitlab_schema does run migrate :up and :down8111 Failure/Error: expect { migration_class.migrate(:up) }.to raise_error(Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError)8112 expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLNotAllowedError but nothing was raised8113 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:576:in `block (8 levels) in <top (required)>'8114 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:540:in `block (7 levels) in <top (required)>'8115 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8116 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:537:in `block (6 levels) in <top (required)>'8117 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:12:in `block (3 levels) in <top (required)>'8118 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8119 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:11:in `block (2 levels) in <top (required)>'8120 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8121 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8122 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8123 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8124 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8125 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8126 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8127 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8128 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8129 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8130 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8131 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8132 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8133 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8134 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8135 # ./spec/support/database/gitlab_schemas_validate_connection.rb:15:in `block (2 levels) in <top (required)>'8136 3) Gitlab::Database::MigrationHelpers::RestrictGitlabSchema when executing migrations does raise exception when accessing feature flags for db_config_name=ci while restrict_gitlab_migration=gitlab_schema_gitlab_shared does run migrate :up and :down8137 Failure/Error: expect { migration_class.migrate(:up) }.to raise_error(Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError)8138 expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError but nothing was raised8139 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:580:in `block (8 levels) in <top (required)>'8140 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:540:in `block (7 levels) in <top (required)>'8141 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8142 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:537:in `block (6 levels) in <top (required)>'8143 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:12:in `block (3 levels) in <top (required)>'8144 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8145 # ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:11:in `block (2 levels) in <top (required)>'8146 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8147 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8148 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8149 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8150 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8151 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8152 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8153 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8154 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8155 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8156 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8157 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8158 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8159 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8160 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8161 # ./spec/support/database/gitlab_schemas_validate_connection.rb:15:in `block (2 levels) in <top (required)>'8162 4) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes truncates the legacy tables8163 Failure/Error: raise "Table '#{table_name}' is not locked for writes. Run the rake task gitlab:db:lock_writes first"8164 RuntimeError:8165 Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first8166 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118167 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8168 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8169 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8170 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8171 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:188:in `block (5 levels) in <top (required)>'8172 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:187:in `block (4 levels) in <top (required)>'8173 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8174 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8175 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8176 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8177 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8178 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8179 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8180 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8181 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8182 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8183 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8184 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8185 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8186 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8187 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8188 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8189 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8190 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8191 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8192 5) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes does not affect the other tables8193 Failure/Error: raise "Table '#{table_name}' is not locked for writes. Run the rake task gitlab:db:lock_writes first"8194 RuntimeError:8195 Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first8196 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118197 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8198 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8199 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8200 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8201 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:194:in `block (5 levels) in <top (required)>'8202 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:193:in `block (4 levels) in <top (required)>'8203 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8204 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8205 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8206 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8207 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8208 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8209 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8210 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8211 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8212 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8213 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8214 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8215 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8216 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8217 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8218 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8219 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8220 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8221 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8222 6) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes logs the sql statements to the logger8223 Failure/Error: raise "Table '#{table_name}' is not locked for writes. Run the rake task gitlab:db:lock_writes first"8224 RuntimeError:8225 Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first8226 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118227 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8228 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8229 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8230 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8231 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:203:in `block (4 levels) in <top (required)>'8232 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8233 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8234 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8235 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8236 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8237 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8238 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8239 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8240 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8241 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8242 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8243 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8244 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8245 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8246 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8247 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8248 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8249 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8250 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8251 7) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when running in dry_run mode does not truncate the legacy tables if running in dry run mode8252 Failure/Error: raise "Table '#{table_name}' is not locked for writes. Run the rake task gitlab:db:lock_writes first"8253 RuntimeError:8254 Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first8255 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118256 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8257 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8258 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8259 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8260 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:212:in `block (6 levels) in <top (required)>'8261 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:211:in `block (5 levels) in <top (required)>'8262 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8263 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8264 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8265 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8266 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8267 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8268 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8269 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8270 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8271 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8272 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8273 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8274 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8275 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8276 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8277 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8278 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8279 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8280 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8281 8) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when passing until_table parameter with a table that exists only truncates until the table specified8282 Failure/Error: raise "Table '#{table_name}' is not locked for writes. Run the rake task gitlab:db:lock_writes first"8283 RuntimeError:8284 Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first8285 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118286 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8287 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8288 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8289 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8290 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:223:in `block (7 levels) in <top (required)>'8291 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:222:in `block (6 levels) in <top (required)>'8292 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8293 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8294 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8295 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8296 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8297 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8298 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8299 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8300 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8301 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8302 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8303 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8304 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8305 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8306 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8307 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8308 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8309 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8310 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8311 9) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when passing until_table parameter with a table that does not exist raises an error if the specified table does not exist8312 Failure/Error:8313 expect do8314 truncate_legacy_tables8315 end.to raise_error(/The table 'foobar' is not within the truncated tables/)8316 expected /The table 'foobar' is not within the truncated tables/, got #<RuntimeError: Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first> with backtrace:8317 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8318 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8319 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8320 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8321 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:234:in `block (7 levels) in <top (required)>'8322 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:233:in `block (6 levels) in <top (required)>'8323 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8324 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8325 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8326 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8327 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8328 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8329 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8330 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8331 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8332 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8333 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8334 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8335 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8336 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8337 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8338 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8339 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8340 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8341 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8342 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118343 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:233:in `block (6 levels) in <top (required)>'8344 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8345 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8346 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8347 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8348 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8349 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8350 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8351 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8352 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8353 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8354 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8355 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8356 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8357 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8358 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8359 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8360 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8361 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8362 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8363 10) Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when one of the attached partitions happened to be locked for writes truncates the locked partition successfully8364 Failure/Error: raise "Table '#{table_name}' is not locked for writes. Run the rake task gitlab:db:lock_writes first"8365 RuntimeError:8366 Table 'gitlab_partitions_dynamic._test_gitlab_main_part_20220101' is not locked for writes. Run the rake task gitlab:db:lock_writes first8367 Shared Example Group: "truncating legacy tables on a database" called from ./spec/lib/gitlab/database/tables_truncate_spec.rb:3118368 # ./lib/gitlab/database/tables_truncate.rb:49:in `block in execute'8369 # ./lib/gitlab/database/tables_truncate.rb:38:in `each'8370 # ./lib/gitlab/database/tables_truncate.rb:38:in `execute'8371 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:47:in `block (3 levels) in <top (required)>'8372 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:254:in `block (6 levels) in <top (required)>'8373 # ./spec/lib/gitlab/database/tables_truncate_spec.rb:253:in `block (5 levels) in <top (required)>'8374 # ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'8375 # ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'8376 # ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'8377 # ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'8378 # ./lib/gitlab/application_context.rb:66:in `with_raw_context'8379 # ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'8380 # ./spec/spec_helper.rb:266:in `block (2 levels) in <top (required)>'8381 # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'8382 # ./spec/support/multiple_databases.rb:16:in `block (3 levels) in <top (required)>'8383 # ./spec/support/helpers/database/multiple_databases_helpers.rb:107:in `with_reestablished_active_record_base'8384 # ./spec/support/multiple_databases.rb:15:in `block (2 levels) in <top (required)>'8385 # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <top (required)>'8386 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'8387 # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'8388 # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'8389 # ./spec/support/database/gitlab_schemas_validate_connection.rb:6:in `block in with_gitlab_schemas_validate_connection_prevented'8390 # ./lib/gitlab/database/query_analyzers/base.rb:39:in `with_suppressed'8391 # ./spec/support/database/gitlab_schemas_validate_connection.rb:5:in `with_gitlab_schemas_validate_connection_prevented'8392 # ./spec/support/database/gitlab_schemas_validate_connection.rb:11:in `block (2 levels) in <top (required)>'8393Finished in 13 minutes 10 seconds (files took 58.32 seconds to load)83942883 examples, 10 failures, 26 pending8395Failed examples:8396rspec './spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb[1:2:17:1:3:1]' # Gitlab::Database::MigrationHelpers::RestrictGitlabSchema when executing migrations does raise exception when accessing feature flags for db_config_name=main while restrict_gitlab_migration=gitlab_schema_gitlab_shared does run migrate :up and :down8397rspec './spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb[1:2:17:2:1:1]' # Gitlab::Database::MigrationHelpers::RestrictGitlabSchema when executing migrations does raise exception when accessing feature flags for db_config_name=ci while restrict_gitlab_migration=no_gitlab_schema does run migrate :up and :down8398rspec './spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb[1:2:17:2:3:1]' # Gitlab::Database::MigrationHelpers::RestrictGitlabSchema when executing migrations does raise exception when accessing feature flags for db_config_name=ci while restrict_gitlab_migration=gitlab_schema_gitlab_shared does run migrate :up and :down8399rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:1]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes truncates the legacy tables8400rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:2]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes does not affect the other tables8401rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:3]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes logs the sql statements to the logger8402rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:4:1]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when running in dry_run mode does not truncate the legacy tables if running in dry run mode8403rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:5:1:1]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when passing until_table parameter with a table that exists only truncates until the table specified8404rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:5:2:1]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when passing until_table parameter with a table that does not exist raises an error if the specified table does not exist8405rspec './spec/lib/gitlab/database/tables_truncate_spec.rb[1:2:1:2:6:1]' # Gitlab::Database::TablesTruncate when truncating gitlab_main tables on the ci database behaves like truncating legacy tables on a database when the truncated tables are locked for writes when one of the attached partitions happened to be locked for writes truncates the locked partition successfully8406Randomized with seed 135468407[TEST PROF INFO] Time spent in factories: 03:15.068 (24.52% of total time)8408Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected8409RSPEC_RETRIED_TESTS_REPORT_PATH: rspec/retried_tests-4863614081.txt8410Retrying the failing examples in a new RSpec process...8411$ gem install junit_merge --no-document --version 0.1.28412Successfully installed nokogiri-1.15.4-x86_64-linux8413Successfully installed junit_merge-0.1.284142 gems installed8415==> 'gem install junit_merge --no-document --version 0.1.2' succeeded in 1 seconds.8416Running RSpec command: bin/rspec -Ispec -rspec_helper --color --failure-exit-code 1 --error-exit-code 2 --format documentation --format Support::Formatters::JsonFormatter --out rspec/rspec-retry-4863614081.json --format RspecJunitFormatter --out rspec/rspec-retry-4863614081.xml --only-failures --pattern "{,ee/,jh/}spec/{,**/}*_spec.rb"8417/builds/edith007/gitlab/ee/app/services/remote_development/service_response_factory.rb:41: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8418/builds/edith007/gitlab/ee/app/services/remote_development/workspaces/create_service.rb:28: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8419/builds/edith007/gitlab/ee/app/services/remote_development/workspaces/reconcile_service.rb:38: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8420/builds/edith007/gitlab/ee/app/services/remote_development/workspaces/update_service.rb:28: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8421/builds/edith007/gitlab/ee/lib/remote_development/agent_config/main.rb:32: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8422/builds/edith007/gitlab/ee/lib/remote_development/agent_config/updater.rb:11: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8423/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/authorizer.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8424/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/authorizer.rb:13: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8425/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:17: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8426/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:24: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8427/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:25: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8428/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/creator.rb:28: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8429/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/devfile_fetcher.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8430/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/devfile_fetcher.rb:16: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8431/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/devfile_flattener.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8432/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/editor_component_injector.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8433/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/editor_component_injector.rb:17: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8434/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/editor_component_injector.rb:18: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8435/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:43: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8436/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:54: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8437/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:102: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8438/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:126: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8439/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:159: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8440/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:202: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8441/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/post_flatten_devfile_validator.rb:235: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8442/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/pre_flatten_devfile_validator.rb:24: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8443/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/pre_flatten_devfile_validator.rb:52: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8444/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8445/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:17: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8446/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:18: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8447/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb:23: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8448/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/volume_component_injector.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8449/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/volume_component_injector.rb:13: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8450/builds/edith007/gitlab/ee/lib/remote_development/workspaces/create/volume_component_injector.rb:14: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8451/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/main.rb:43: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8452/builds/edith007/gitlab/ee/lib/remote_development/workspaces/update/authorizer.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8453/builds/edith007/gitlab/ee/lib/remote_development/workspaces/update/updater.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8454/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/agent_infos_observer.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8455/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_extractor.rb:14: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8456/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_extractor.rb:16: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8457/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_to_infos_converter.rb:14: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8458/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/input/params_validator.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8459/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/output/rails_infos_observer.rb:11: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8460/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/output/workspaces_to_rails_infos_converter.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8461/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/orphaned_workspaces_observer.rb:12: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8462/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/workspaces_from_agent_infos_updater.rb:15: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8463/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/workspaces_to_be_returned_finder.rb:16: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8464/builds/edith007/gitlab/ee/lib/remote_development/workspaces/reconcile/persistence/workspaces_to_be_returned_updater.rb:11: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!8465Run options: include {:last_run_status=>"failed"}8466Test environment set up in 0.570206294 seconds8467Gitlab::Database::MigrationHelpers::RestrictGitlabSchema8468 when executing migrations8469 does raise exception when accessing feature flags8470 for db_config_name=main8471 while restrict_gitlab_migration=gitlab_schema_gitlab_shared8472 does run migrate :up and :down84741st Try error in ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:554:8475expected Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas::DMLAccessDeniedError but nothing was raised8477RSpec::Retry: 2nd try ./spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb:5548478 for db_config_name=ci8479 while restrict_gitlab_migration=no_gitlab_schema8480 does run migrate :up and :down8481 while restrict_gitlab_migration=gitlab_schema_gitlab_shared8482 does run migrate :up and :down8483Gitlab::Database::TablesTruncate8484 # order random8485 when truncating gitlab_main tables on the ci database8486 behaves like truncating legacy tables on a database8487 when the truncated tables are locked for writes8488WARNING: Active Record does not support composite primary key.8489_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8490WARNING: Active Record does not support composite primary key.8491gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8492WARNING: Active Record does not support composite primary key.8493_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8494WARNING: Active Record does not support composite primary key.8495gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8496 truncates the legacy tables8497WARNING: Active Record does not support composite primary key.8498_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8499WARNING: Active Record does not support composite primary key.8500gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8501WARNING: Active Record does not support composite primary key.8502_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8503WARNING: Active Record does not support composite primary key.8504gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8505 does not affect the other tables8506WARNING: Active Record does not support composite primary key.8507_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8508WARNING: Active Record does not support composite primary key.8509gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8510WARNING: Active Record does not support composite primary key.8511_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8512WARNING: Active Record does not support composite primary key.8513gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8514 logs the sql statements to the logger8515 when running in dry_run mode8516WARNING: Active Record does not support composite primary key.8517_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8518WARNING: Active Record does not support composite primary key.8519gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8520WARNING: Active Record does not support composite primary key.8521_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8522WARNING: Active Record does not support composite primary key.8523gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8524 does not truncate the legacy tables if running in dry run mode8525 when passing until_table parameter8526 with a table that exists8527WARNING: Active Record does not support composite primary key.8528_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8529WARNING: Active Record does not support composite primary key.8530gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8531WARNING: Active Record does not support composite primary key.8532_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8533WARNING: Active Record does not support composite primary key.8534gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8535 only truncates until the table specified8536 with a table that does not exist8537WARNING: Active Record does not support composite primary key.8538_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8539WARNING: Active Record does not support composite primary key.8540gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8541WARNING: Active Record does not support composite primary key.8542_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8543WARNING: Active Record does not support composite primary key.8544gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8545 raises an error if the specified table does not exist8546 when one of the attached partitions happened to be locked for writes8547WARNING: Active Record does not support composite primary key.8548_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8549WARNING: Active Record does not support composite primary key.8550gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8551WARNING: Active Record does not support composite primary key.8552_test_gitlab_hook_logs has composite primary key. Composite primary key is ignored.8553WARNING: Active Record does not support composite primary key.8554gitlab_partitions_dynamic._test_gitlab_hook_logs_202201 has composite primary key. Composite primary key is ignored.8555 truncates the locked partition successfully8556Finished in 10.59 seconds (files took 50.82 seconds to load)855710 examples, 0 failures8558Randomized with seed 460898559[TEST PROF INFO] Time spent in factories: 00:00.028 (0.21% of total time)8560Loading rspec/rspec-4863614081.json...8561Merged rspec/rspec-retry-4863614081.json adding 5 results.8562Saved rspec/rspec-4863614081.json.8563A test was flaky and succeeded after being retried. Checking to see if flaky test is part of this MR...8564Flaky test was not part of this MR. 8565 Running after_script 8566Running after script...8567$ echo -e "\e[0Ksection_start:`date +%s`:report_results_section[collapsed=true]\r\e[0KReport results"8592Not uploading cache ruby-gems-debian-bullseye-ruby-3.0-protected due to policy8594Uploading artifacts...8595WARNING: auto_explain/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/edith007/gitlab) 8596coverage/: found 4 matching artifact files and directories 8597WARNING: crystalball/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/edith007/gitlab) 8598WARNING: deprecations/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/edith007/gitlab) 8599knapsack/: found 2 matching artifact files and directories 8600rspec/: found 11 matching artifact files and directories 8601WARNING: tmp/capybara/: no matching files. Ensure that the artifact path is relative to the working directory (/builds/edith007/gitlab) 8602log/*.log: found 14 matching artifact files and directories 8603WARNING: Upload request redirected location=https://gitlab.com/api/v4/jobs/4863614081/artifacts?artifact_format=zip&artifact_type=archive&expire_in=31d new-url=https://gitlab.com8604WARNING: Retrying... context=artifacts-uploader error=request redirected8605Uploading artifacts as "archive" to coordinator... 201 Created id=4863614081 responseStatus=201 Created token=64_y7yDT8606Uploading artifacts...8607rspec/rspec-*.xml: found 2 matching artifact files and directories 8608WARNING: Upload request redirected location=https://gitlab.com/api/v4/jobs/4863614081/artifacts?artifact_format=gzip&artifact_type=junit&expire_in=31d new-url=https://gitlab.com8609WARNING: Retrying... context=artifacts-uploader error=request redirected8610Uploading artifacts as "junit" to coordinator... 201 Created id=4863614081 responseStatus=201 Created token=64_y7yDT8612Job succeeded