Master broken: expected no Exception, got #<ArgumentError: comparison of Integer with nil failed>
When running migration specs, we're getting the following error
1) MigrateMergeRequestMentionsToDb behaves like schedules resource mentions migration schedules background migrations
802 Failure/Error:
803 expect do
804 Gitlab::BackgroundMigration.perform(migration, arguments)
805 end.not_to raise_error
806 expected no Exception, got #<ArgumentError: comparison of Integer with nil failed> with backtrace:
807 # ./lib/gitlab/markdown_cache/active_record/extension.rb:42:in `<'
808 # ./lib/gitlab/markdown_cache/active_record/extension.rb:42:in `save_markdown'
809 # ./app/models/concerns/cache_markdown_field.rb:73:in `refresh_markdown_cache!'
810 # ./app/models/concerns/cache_markdown_field.rb:123:in `updated_cached_html_for'
811 # ./lib/gitlab/background_migration/user_mentions/models/concerns/isolated_mentionable.rb:53:in `block in all_references'
812 # ./lib/gitlab/background_migration/user_mentions/models/concerns/isolated_mentionable.rb:45:in `each'
813 # ./lib/gitlab/background_migration/user_mentions/models/concerns/isolated_mentionable.rb:45:in `all_references'
814 # ./lib/gitlab/background_migration/user_mentions/models/concerns/isolated_mentionable.rb:71:in `build_mention_values'
815 # ./lib/gitlab/background_migration/user_mentions/create_resource_user_mention.rb:26:in `block (2 levels) in perform'
816 # ./lib/gitlab/background_migration/user_mentions/create_resource_user_mention.rb:25:in `block in perform'
817 # ./app/models/concerns/each_batch.rb:94:in `block in each_batch'
818 # ./app/models/concerns/each_batch.rb:68:in `step'
819 # ./app/models/concerns/each_batch.rb:68:in `each_batch'
820 # ./lib/gitlab/background_migration/user_mentions/create_resource_user_mention.rb:23:in `perform'
821 # ./lib/gitlab/background_migration.rb:59:in `perform'
822 # ./spec/support/matchers/background_migrations_matchers.rb:6:in `block (3 levels) in <top (required)>'
823 # ./spec/support/matchers/background_migrations_matchers.rb:5:in `block (2 levels) in <top (required)>'
824 # ./spec/support/matchers/background_migrations_matchers.rb:13:in `block (2 levels) in <top (required)>'
825 # ./spec/support/shared_examples/lib/gitlab/background_migration/mentions_migration_shared_examples.rb:78:in `block (4 levels) in <top (required)>'
826 # ./spec/support/shared_examples/lib/gitlab/background_migration/mentions_migration_shared_examples.rb:67:in `block (3 levels) in <top (required)>'
827 # ./spec/support/shared_examples/lib/gitlab/background_migration/mentions_migration_shared_examples.rb:66:in `block (2 levels) in <top (required)>'
828 # ./spec/spec_helper.rb:390:in `block (3 levels) in <top (required)>'
829 # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
830 # ./spec/spec_helper.rb:381:in `block (2 levels) in <top (required)>'
831 # ./spec/spec_helper.rb:377:in `block (3 levels) in <top (required)>'
832 # ./lib/gitlab/application_context.rb:31:in `with_raw_context'
833 # ./spec/spec_helper.rb:377:in `block (2 levels) in <top (required)>'
834 # ./spec/support/database_cleaner.rb:60:in `block (2 levels) in <top (required)>'
For example from https://gitlab.com/gitlab-org/gitlab/-/jobs/1473956847