Skip to content

chore(ci): clean-up outdated claim #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions test/cases/adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,37 +173,6 @@ def test_reset_empty_table_with_custom_pk_sequence
assert_equal 1, Widget.create(name: "weather").id
end

def test_truncate_tables
assert_operator Post.count, :>, 0
assert_operator Author.count, :>, 0
assert_operator AuthorAddress.count, :>, 0

@connection.truncate_tables("author_addresses", "authors", "posts")

assert_equal 0, Post.count
assert_equal 0, Author.count
assert_equal 0, AuthorAddress.count
ensure
reset_fixtures("author_addresses", "authors", "posts")
end

def test_truncate_tables_with_query_cache
@connection.enable_query_cache!

assert_operator Post.count, :>, 0
assert_operator Author.count, :>, 0
assert_operator AuthorAddress.count, :>, 0

@connection.truncate_tables("author_addresses", "authors", "posts")

assert_equal 0, Post.count
assert_equal 0, Author.count
assert_equal 0, AuthorAddress.count
ensure
reset_fixtures("author_addresses", "authors", "posts")
@connection.disable_query_cache!
end

private

def reset_fixtures(*fixture_names)
Expand Down
12 changes: 12 additions & 0 deletions test/cases/helper_cockroachdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,22 @@ def load_cockroachdb_specific_schema

require 'timeout'

$c = nil
module TestTimeoutHelper
def time_it
t0 = Minitest.clock_time


c = ActiveRecord::Base.lease_connection.select_all('show constraints from fk_test_has_pk').to_a
if $c != c
puts
puts @NAME
puts ?= * @NAME.size
pp c
puts
$c = c
end

timeout_mins = ENV.fetch("TEST_TIMEOUT", 5).to_i
Timeout.timeout(timeout_mins * 60, Timeout::Error, "Test took over #{timeout_mins} minutes to finish") do
yield
Expand Down
20 changes: 9 additions & 11 deletions test/config.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
default_connection: cockroachdb
connections:
cockroachdb:
arunit:
arunit: &arunit
min_messages: warning
host: 127.0.0.1
port: 26257
user: root
disable_cockroachdb_telemetry: true
# `autocommit_before_ddl` changed to default true in CockroachDB v25.1.
# This does not work with active record's test suite.
#
# This options keyword is referenced here in libpq:
# https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-OPTIONS
options: "-c autocommit_before_ddl=false"
arunit_without_prepared_statements:
min_messages: warning
<<: *arunit
prepared_statements: false
host: 127.0.0.1
port: 26257
user: root
disable_cockroachdb_telemetry: true
arunit2:
min_messages: warning
host: 127.0.0.1
port: 26257
user: root
disable_cockroachdb_telemetry: true
<<: *arunit
2 changes: 0 additions & 2 deletions test/excludes/ActiveRecord/AdapterTestWithoutTransaction.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
exclude :test_reset_empty_table_with_custom_pk, "The test fails because serial primary keys in CockroachDB are created with unique_rowid() where PostgreSQL will create them with a sequence. See https://www.cockroachlabs.com/docs/v19.2/serial.html#modes-of-operation"
exclude :test_truncate_tables, "This is override to prevent an intermittent error. Table fk_test_has_pk has constrain droped and not created back"
exclude :test_truncate_tables_with_query_cache, "This is override to prevent an intermittent error. Table fk_test_has_pk has constrain droped and not created back"
Loading